MATLAB Answers

Embedded Coder and C2000 PIL or External

32 views (last 30 days)
Martin Grüterich
Martin Grüterich on 9 Oct 2017
Commented: 文浩 朱 on 18 Mar 2021
I hava a Simulink-Model containing some Sensor-Calibration, Calculation and PID-Controlers and am currently compiling it for my TI F28335 DSP. I get the *.out-File and run it on my DSP. That is working fine.
Now I would like to tune the parameters and see the variables in real time. I think the term for this is "Hardware in the loop". I have installed various versions of Matlab, CCS, CGT and Bios. I am not completely sure which combination is best but it seems that R2016a and CCS6 can work together.
I also would like to know: What are the differences between SiL, PiL and external mode? Which one is best for my application?
Can I use my JTAG-Connection on the XDS100v2-Debug-Probe or do I have to connect via SCI?
Thank you very much in advance!

Answers (2)

Antonin on 12 Oct 2017
Hi Martin,
External mode is what you are looking for. It is supported over serial and CAN on the C2000 processors. Here is a detailed example on how to get started:
Make sure that you have a proper serial connection in place, these pages can help you establish your serial communication:
I hope it helps,
文浩 朱
文浩 朱 on 18 Mar 2021
Set the four pin pins of boot to SCI inF28335?choose GPIO28/29?

Sign in to comment.

Martin Grüterich
Martin Grüterich on 12 Oct 2017
Hey Antonin,
thank you very much for your links, I am sorry the problem must be somewhere else. I can compile and send the code to target (DSP) but not start the simulation.
Best regards, Martin
The error-message is as follows:
Simulation 5 92 2 Clear
09:36 AM Elapsed: 1:32 min
### Starting build procedure for model: model1
Code Generation 2 46
Elapsed: 48 sec
[...some warnings...]
### Unsupported CCS Version. Skipping CCS Project creation
"### Invoking postbuild tool "Download" ..."
C:/ti/ccsv7/ccs_base/SCRIPT~1/bin/dss.bat C:\PROGRA~1\MATLAB\R2017b/toolbox/idelink/EXTENS~1/ticcs/ccsdemos/RUNPRO~1.JS C:\PROGRA~3\MATLAB\SUPPOR~1\R2017b\toolbox\target\SUPPOR~1\tic2000\CCS_CO~1\F28335~3.CCX ../model1.out
*** User inputs:
Target Configuration: C:\PROGRA~3\MATLAB\SUPPOR~1\R2017b\toolbox\target\SUPPOR~1\tic2000\CCS_CO~1\F28335~3.CCX
Program Name: ../model1.out
Board Name: unspecified (connect to first board)
CPU Name: unspecified (connect to first CPU)
*** Starting debug session...
*** Debug Session Name: Texas Instruments XDS100v2 USB Debug Probe_0/C28xx
*** Board Name: Texas Instruments XDS100v2 USB Debug Probe_0
*** CPU Name: C28xx
*** Connecting to target...
*** Loading the program to the target...
*** Program is running.
*** Disconnecting from target...
*** Terminating debug session...
"### Done invoking postbuild tool."
### Successful completion of build procedure for model: model1
Build process completed successfully
[...some warning...]
Component:Simulink | Category:Model
Error occurred while executing External Mode MEX-file 'ext_comm':
Failed to connect to the target. A time-out occurred while waiting for the connection response from the target. Possible reasons for the time-out:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.
Component:Simulink | Category:Block diagram error
Unable to connect to the 'TI Delfino F2833x' target for 'model1'.
Component:Simulink | Category:Model error
文浩 朱
文浩 朱 on 18 Mar 2021
Set the four pin pins of boot to SCI inF28335?choose GPIO28/29?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!