How to load the Embedded Coder output into Code Composer Studio 4?

14 views (last 30 days)
Hello,
I am using the Embedded Coder toolbox to generate code for a Texas Instruments DSP. Embedded Coder produces some C-code which I would like to open (and build) in Code Composer Studio 4. Does somebody know how to load these C-source files into a valid CCs project?
I know Embedded Coder can also directly build the .out HEX file for the DSP. This is not an option for me because I would like to step through the C-code and fully make use of the CCs debug tools (which was possible with CCs3.3 and an older IDE link Matlab Coder Generation toolbox which automatically configured the CCs project).
Thanks in advance. Joost

Accepted Answer

Joost
Joost on 23 Mar 2012
Edited: Sebastian Castro on 3 Apr 2019
Sebastian Castro from MathWorks Technical support provided me an answer which resolved the issue:
After some investigation, it appears that the reason for this issue has to do with the "Execute" configuration in XMAKEFILESETUP. In order to make this work, you can clone the appropriate CCSv4 xmakefile configuration as outlined in the steps below:
1.Open up "xmakefilesetup" and select the appropriate CCSv4 configuration -- that is, the one that you have been using.
2. To the right of the configuration drop-down menu, click on the "New..." button and make a name for the cloned configuration. This configuration will be a MATLAB file that will be saved in the "User Configurations" directory as shown in the GUI.
You may be asked to point to your install directory for CCSv4.
3. Select this new configuration. You will see an "Execute" tab. Under "Execute tool" you will see "echo". This is the configuration that is causing the error we have been discussing.
Select the "Browse..." button next to "Execute Tool" and look for the file "$CCSINSTALL\ccsv4\scripting\bin\dss.bat". Here, $CSSINSTALL is the installation directory for your CCSv4 IDE.
4. The "Arguments" box needs to be populated with three arguments in quotation marks separated by spaces. The box should be filled out as follows:
"ARG1" "ARG2" "ARG3"
The three arguments are:
ARG1: $MATLABROOT\toolbox\idelink\extensions\ticcs\ccsdemos\runProgram.js
Here, $MATLABROOT refers to your MATLAB installation directory (for example, C:\Program Files\MATLAB\R2011a). This is a JavaScript file that is shipped with the product.
ARG2: This should be the path to a ".ccxml" configuration file generated from CCSv4.
In order to get this, you can open CCSv4 and go to "File > New > Target Configuration File". You can then specify the name, location and fill in the appropriate hardware information.
ARG3: [|||MW_XMK_GENERATED_TARGET_REF[E]|||]
So, the contents of the "Arguments" text box should at the end look like this, for example:
"C:\Program Files\MATLAB\R2011a\toolbox\idelink\extensions\ticcs\ccsdemos\runProgram.js" "C:\Users\scastro\user\CCSTargetConfigurations\myconfigname.ccxml" "[|||MW_XMK_GENERATED_TARGET_REF[E]|||]"
After taking these steps, you should be able to use this xmakefile configuration to directly do a "Build and Execute" from the Simulink model. While this does take a bit of time to set up, you only have to do it once.
  3 Comments
Jichun Qu
Jichun Qu on 19 Dec 2012
Hi, Joost, I'm now facing the same problem that you had. I've tried this approach, but in the DOS windows it says command not found. Do you have to modify something in the runProgram.js or dss.bat? By the way, have you found an alternative solution yet? I found a link from Youtube, which I think is very helpful: http://www.youtube.com/watch?v=7ed1NLD817s&feature=youtu.be Although the platform is a microcontroller, but the makefile approach is the same. After generating .out file, load the file from CCSv4, that's Target -> load program . But we must connect the target first.
Fajar Sastrowijoyo
Fajar Sastrowijoyo on 17 Jan 2013
Hi Joost, how did you manage to load the C codes to the CCS? I'm still puzzled on how to do that.
Thanks b4

Sign in to comment.

More Answers (1)

Kaustubha Govind
Kaustubha Govind on 9 Feb 2012
Support for CCS4 was only added in R2011a - so if you're using a previous version you might have trouble interfacing with CCS4. If you are using version R2011a or newer, you need to use the XMakefile configuration. See Tutorial: Using Makefiles with Code Composer Studio 4.x. I haven't tried this, but I'm assuming that this will help you use CCS tools like you could previously with the project mechanism.
  8 Comments
Joost
Joost on 22 Feb 2012
What is the 'normal' way of debugging a DSP running on Embedded Coder code? DSS?
Building the Cfiles in a new CCs project doesn't work, because CCs misses some definitions present in the Makefile.
If I start a new project as a “Standard Make Project”, the makefile is used and an .out file is generated and loaded into the DSP. Using this workflow I don't have debug options and also I get an error (the same as when I “build and execute” the Simulink model (Ctrl+B)):
<Linking>
"Evaluating build target"
"Evaluating execute target"
"echo" To customize the execute command, clone this configuration
'"echo"' is not recognized as an internal or external command,
operable program or batch file.
gmake: *** [execute] Error 1
Kaustubha Govind
Kaustubha Govind on 22 Feb 2012
Joost: The "normal" way would be to just generate a CCS IDE projects, which was only supported until CCS 3.3. I don't know if moving forward only DSS will be supported or generation of CCS projects with CCS 4.0 will be added.
The error message is strange - it says the system command "echo" could not run. Perhaps your system shell setup has been specialized? You could try running the command directly from the system command window and see if you are able to access it?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!