MATLAB Answers

Running Simulink models on a TI C2000 MCU

4 views (last 30 days)
Armin Lensker
Armin Lensker on 18 Jul 2017
Commented: Armin Lensker on 24 Jul 2017
Hello,
I have a problem concerning Simulink Coder. I wanted to compile a simple Simulink model to run it on the C2000 Microcontroller F28069M by Texas Instruments (TI) (the model should only toggle a GPIO pin every half a second). In the Model Configuration I already chose all the right options: I selected the right target hardware, chose the mode "Build, load and run" and I also checked the option "Boot from flash". But Simulink only seemed to build the C code without running it on the MCU. There was not even an error when I clicked on "Build" and had the MCU disconnected. Then I deactivated the checkbox "Generate code only" in the Simulink preferences and now Simulink seems to do what I want. But everytime I am trying to build the model, an error occurs in the Diagnostic Viewer:
C:/TI_CCSv6/ccsv6/tools/compiler/TI-CGT~1.1/bin/cl2000 --compile_only --large_memory_model --cla_support=cla0 --silicon_version=28 --define="LARGE_MODEL" -i"/~SupportFiles/DSP280x_headers" -i"/~SupportFiles/DSP280x_headers/include" -i"C:/TI_CCSv6/ccsv6/tools/compiler/TI-CGT~1.1/include" -v28 -ml --float_support=fpu32 -DMODEL=Toggle_Pin_J1_Nr5 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DONESTEPFCN=1 -DTERMFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=1 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DSTACK_SIZE=512 -DONESTEPFCN=1 -DTERMFCN=0 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=1 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DRT -DSTACK_SIZE=512 -DMODEL=Toggle_Pin_J1_Nr5 -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/Armin/Documents/MATLAB/Toggle_Pin_J1_Nr5_ert_rtw -IC:/Users/Armin/Documents/MATLAB -IC:/PROGRA~1/MATLAB/extern/include -IC:/PROGRA~1/MATLAB/simulink/include -IC:/PROGRA~1/MATLAB/rtw/c/src -IC:/PROGRA~1/MATLAB/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/rtw/c/ert -IC:/MATLAB_Packages/texasinstrumentsc2000/toolbox/target/supportpackages/tic2000/src -IC:/PROGRA~1/MATLAB/toolbox/target/extensions/processor/tic2000/include -IC:/PROGRA~1/MATLAB/toolbox/rtw/targets/common/can/blocks/tlc_c -IC:/MATLAB_Packages/texasinstrumentsc2000/toolbox/target/supportpackages/tic2000/inc -IC:/TI_ControlSUITE/device_support/f2806x/v151/F2806x_common/include -IC:/TI_ControlSUITE/device_support/f2806x/v151/F2806x_headers/include -IC:/PROGRA~1/MATLAB/toolbox/shared/can/src/scanutil --output_file="MW_c28xx_board.obj" "MW_c28xx_board.c"
The command "C:/TI_CCSv6/ccsv6/tools/compiler/TI-CGT~1.1/bin/cl2000" is either written wrong or could not be found.
The configuration of the Embedded Coder Package for C2000 MCUs was successful and I set every path to the TI software components correctly. Why does Simulink suddenly need the path "C:/TI_CCSv6/ccsv6/tools/compiler/TI-CGT~1.1/bin/cl2000" which I never specified during the setup? The communication between my laptop and the MCU should also be okay, because I can establish a connection via Code Composer Studio (CCSv6) by TI. I am using MATLAB R2015b. Could someone help me resolving this problem?
Best regards, Armin
  2 Comments
Armin Lensker
Armin Lensker on 24 Jul 2017
Hi, thanks for your help! ;) I already managed to solve the problem in the meantime: When I installed the support package in MATLAB, I accidentally set the wrong path for the code generation tools. I picked the folder for the C6000 MCUs because I had not installed the CGT for the C2000 MCUs at that time. I installed them later and changed the path to the CGT using the command "checkEnvSetup". Unfortunately, setting the path using "checkEnvSetup" is not enough. One has to re-run the setup process using the command "targetupdater". There I could replace the wrong path with the right one for C2000 MCUs.

Sign in to comment.

Accepted Answer

Antonin
Antonin on 24 Jul 2017
Try running the following command and make sure to go through the steps of setting up the compiler path.
>> targetupdater
I hope it helps,
Antonin.
  1 Comment
Armin Lensker
Armin Lensker on 24 Jul 2017
Hi, thanks for your help! ;) I just noticed your answer a minute ago. I already used the command you mentioned in the meantime and it worked (see my comment on Don Zheng's comment).

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!