How can Embedded Coder 6.3 (R2012b) generate code that allows debugging in Code Composer Studio v5.x?

1 view (last 30 days)
I am using Code Composer Studio (CCS) v5.x to interact with a Texas Instruments processor. With CCS v3.3, I
could easily debug the source code generated by Embedded Coder, e.g., I could add breakpoints and step
through it. However, I can no longer do so in CSS v5.x. What should I do to allow debugging of the generated
source code in CSS v5.x?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Oct 2013
First, please follow these steps:
1a) Open the "Configuration Parameters" window and navigate to the
"Code Generation" -> "IDE Link" pane.
2a) Ensure that the "Compiler options string" field includes:
-g -D"_DEBUG"
3a) Generate code using Embedded Coder 6.3 (R2012b) or higher.
To allow step-debugging of the generated source code:
1b) Open CCS and connect to the target hardware.
2b) From the "Run" menu, select the Load option and navigate to the location of the OUT file
that was generated by Embedded Coder 6.3 (R2012b) or higher.
3b) Hit Play/Resume button in CCS.
4b) From the "File" menu in CCS, select "Open File" and browse to the Embedded-Coder generated
source code you wish to debug -- located one directory level up from the OUT file. After
opening the source file, add a breakpoint to the desired location, and CCS will stop there
during program execution.
To allow debugging in a project-based workflow:
*** Initial steps:
1c) Create or use a sample project within CCS to compile and connect to the target hardware.
2c) The debug perspective should open and you should now be connected to your hardware with the
source code for the example open in the debug window.
3c) Close the code debug window for your example code. Do NOT terminate the debug session or
disconnect from your hardware.
4c) Using the perspective tool buttons on the upper right of the toolbar in CCS, select the Edit
perspective to go back to that perspective without disconnecting from your hardware.
5c) Once in the Edit perspective, create a new CCS project and define the appropriate processor
and the same debug connection that was used in the example program to connect to the hardware.
6c) Once a new CCS project has been created, select that project in the project hierarchy pane
to ensure it is open and selected.
7c) From the "File" menu, select "Import" and import the location of the source files generated
by Embedded Coder using the "File System" import method.
8c) Return to the Debug perspective using the toolbar on the top right of CCS v5.x.
9c) From the "Run" menu, select the "Load" option and navigate to the location--in the same path
that you imported the file system above--of the OUT file that was generated by Embedded Coder
6.3 (R2012b)or higher.
Usually, this can be found in the DebugMW if you used the "Debug" configuration in the IDE Link
dialog within MATLAB or from the CustomMW directory if you used a "Custom" configuration in the
IDE Link dialog. Then, load this file.
Code Composer Studio should have opened the "main" program in the source code window. You may
now execute the code. Every time you hit the pause button and the execution halts within another
source file,that file should open automatically within the CCS debug perspective source code
window. Alternatively, you can go back to the Edit perspective and open as many source files as
you wish. Do NOT terminate your debug session when you do this, however.
*** Recurrent steps:
10c) After generating code using Embedded, Coder complete steps (1c) - (4c).
11c) Then, select the project you created in step (5c) in the project hierarchy pane.
12c) Finally, complete steps (8c) and (9c).
  1 Comment
Sriram Narayanan
Sriram Narayanan on 26 Feb 2015
Hi Aaru,
The target preferences settings have moved to Coder Target -> Target Hardware Resources tab in the Config Params of the model.
-Sriram

Sign in to comment.

More Answers (0)

Products


Release

R2012b

Community Treasure Hunt

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

Start Hunting!