Debugging the DSP side of a DSPLink application on OMAP-L138 using CCS
From Texas Instruments Embedded Processors Wiki
Translate this page to
Contents |
Abstract
This topic discusses how to debug the DSP-side of a DSPLink application using CCS on an OMAP-L138 EVM using an external emulator.
It assumes that you are familiar with all of the content in the Getting Started Guide for OMAP-L138, you can navigate around CCS fairly well, and can rebuild the DSP Link examples.
Before you get started
- Follow the Getting Started Guide for OMAP-L138
- Rebuild the DSPLink message example and verify if it runs without any issues.
- Chose an emulator and connect according to the page: How to connect to the OMAP-L138/C6748 EVM board using CCS?
Modify the DSPLink message example
In the message example, the modification should be done at the file:
- /home/user/OMAP_L138_arm_1_00_xx_xx/dsplink_linux_1_65_xx_xx/dsplink/dsp/src/samples/message/main.c
in the main function around line 357.
/* ADD THE LINE BELOW */ volatile Int i=1; #if defined (SWI_MODE) /* SWI based application */ SWIMESSAGE_TransferInfo * info ; Int status ; #else /* if defined (SWI_MODE) */ /* TSK based application */ TSK_Handle tskMessageTask ; #endif /* if defined (SWI_MODE) */ /* ADD THE LINE BELOW AT THE END OF MAIN*/ while(i);
A rebuild of the example projects is required at this point. You can do that:
- By using Quick build instructions for OMAPL-138 and rebuilding all DSPLink
- OR
- If you already rebuilt DSPLink, you can rebuild only the DSPLink DSP side examples using:
- host $ cd OMAP_L138_arm_1_00_00_xx
- host $ make dsplink_dsp
Connecting to CCS
Set the EVM switches
- Power-off EVM and setup it to boot from SPI0 Flash (assuming that you are using SPI FLASH that is the default boot mode for the EVM):
| DIP Switch Setting—S7[5:8] | S7:8 | S7:7 | S7:6 | S7:5 |
|---|---|---|---|---|
| Position | OFF | OFF | OFF | OFF |
For more information, please see the the ZOOM OMAP-L138 eXperimenter Kit QuickStart Guide.
Connecting to CCS3
- Power on the board and abort autoboot by hitting any key (Hit any key to stop autoboot: 3) at teraterm
- Start CCS according to the configuration you chose on the page How to connect to the OMAP-L138/C6748 EVM board using CCS?.
- If when you open CCS it tries to connect automatically, then cancel/ignore - you are not going to be able to connect to the board at this point.
- Remove the GEL file so it does not interfere with your configurations. On the left, expand GEL Files and if your configuration has a GEL file associated with it, right click on the file and select Remove.
- If you chose a configuration that connects only to the DSP:
- If you chose a configuration that connects to the ARM and the DSP, when the CCS Parallel Debug Manager comes up, right click on TMS320C674XP_0 and select Open.
- Boot Linux by typing boot .
- Login as root and create a directory in your file system to be able to put your application, for example:
- target $ mkdir /opt/message
- target $ cd /opt/message
- This directory should contain:
- dsplinkk.ko
- You can get dsplinkk.ko at /home/user/OMAP_L138_arm_1_00_00_08/dsplink_linux_1_65_00_01/dsplink/gpp/export/BIN/Linux/OMAPL138/RELEASE
- message.out
- You can get message.out at /home/user/OMAP_L138_arm_1_00_00_08/dsplink_linux_1_65_00_01/dsplink/dsp/BUILD/OMAPL138GEM_0/MESSAGE/BIN/DEBUG
- messagegpp
- You can get messagegpp at /home/user/OMAP_L138_arm_1_00_00_08/dsplink_linux_1_65_00_01/dsplink/gpp/BUILD/MESSAGE/BIN/DEBUG after you build the example
- Load dsplinkk.ko module:
- insmod dsplinkk.ko
- rm -f /dev/dsplink
- mknod /dev/dsplink c 230 0
- Call the application
- ./messagegpp message.out 3
- You should see:
- root@xxx.xxx.xxx.xxx:/opt/message# ./messagegpp message.out 3
- ========== Sample Application : MESSAGE ==========
- Entered MESSAGE_Create ()
- You should see:
- ./messagegpp message.out 3
- Go to CCS and connect DSP:
- Open the file <main.c> and other source files to debug in CCS (you might need to copy it to your windows machine where CCS is)
- In the CCS DSP Window, select File->Load Symbols->Load Symbols Only, and browse to the <message.out> file (again, you might need to copy it to your windows machine where CCS is).
- In the message example, the DSP is stuck in the while(i) loop that was setup previously. To have it continue with the program, right-click on the instruction after the loop and select Set PC to cursor. Now you are able to step through the DSP-side code.
Connecting to CCS4
- Power on the board and abort autoboot by hitting any key (Hit any key to stop autoboot: 3) at teraterm
- Start CCS4, you can open a new workspace if preferred.
- Make a CCS configuration according to the emulator you are using without the GEL file. You can use this page How to connect to the OMAP-L138/C6748 EVM board using CCS? as a reference, but make sure that your configuration does not have a gel file.
- If you created the target configuration in the default CCS folder you may need to select View->Target Configurations in the menu.
- Boot Linux by typing boot .
- Login as root and create a directory in your file system to be able to put your application, for example:
- target $ mkdir /opt/message
- target $ cd /opt/message
- This directory should contain:
- dsplinkk.ko
- You can get dsplinkk.ko at /home/user/OMAP_L138_arm_1_00_00_08/dsplink_linux_1_65_00_01/dsplink/gpp/export/BIN/Linux/OMAPL138/RELEASE
- message.out
- You can get message.out at /home/user/OMAP_L138_arm_1_00_00_08/dsplink_linux_1_65_00_01/dsplink/dsp/BUILD/OMAPL138GEM_0/MESSAGE/BIN/DEBUG
- messagegpp
- You can get messagegpp at /home/user/OMAP_L138_arm_1_00_00_08/dsplink_linux_1_65_00_01/dsplink/gpp/BUILD/MESSAGE/BIN/DEBUG after you build the example
- Load dsplinkk.ko module:
- insmod dsplinkk.ko
- rm -f /dev/dsplink
- mknod /dev/dsplink c 230 0
- Call the application
- ./messagegpp message.out 3
- You should see:
- root@xxx.xxx.xxx.xxx:/opt/message# ./messagegpp message.out 3
- ========== Sample Application : MESSAGE ==========
- Entered MESSAGE_Create ()
- You should see:
- ./messagegpp message.out 3
- Go to CCS, Right click on the target configuration and select "Launch Selected Configuration":
- After the Debug perspective is launched, right click on the DSP (C674x) core and select “Connect Target".
- In the CCS menu go to Target-> Load symbols and browse to the message.out file (you might need to copy it to your windows machine where CCS is or use a samba server to browse to your Linux machine):
- If is asks you to locate the source file, browse to the main.c file folder (again, you might need to copy it to your windows machine where CCS is or use a samba server to browse to your Linux machine):
- In the message example, the DSP is stuck in the while(i) loop that was setup previously. To have it continue with the program, right-click on the instruction after the loop and select Set PC to cursor. Now you are able to step through the DSP-side code:
