Debugging the DSP side of a DSPLink application on OMAP-L138 using CCS

From Texas Instruments Wiki
Jump to: navigation, search

END OF LIFE

DSP Link is still available for download, but no further releases or updates are planned. Please see IPC Software Options for details and alternatives.

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

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:

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

  1. Power on the board and abort autoboot by hitting any key (Hit any key to stop autoboot: 3) at teraterm
  2. Start CCS according to the configuration you chose on the page How to connect to the OMAP-L138/C6748 EVM board using CCS?.
  3. 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.
  4. 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:
    DsplinkremoveGELCC3.JPG



    • 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.


    DsplinremoveGELPPCC3.JPG



  5. Boot Linux by typing boot .
  6. 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
  7. Load dsplinkk.ko module:
    insmod dsplinkk.ko
    rm -f /dev/dsplink
    mknod /dev/dsplink c 230 0
  8. 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 ()
  9. Go to CCS and connect DSP:

    DsplinkconnectCCS3.JPG



  10. 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)
  11. 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).
  12. 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.

    DsplinksetpcursorCCS3.JPG



Connecting to CCS4

  1. Power on the board and abort autoboot by hitting any key (Hit any key to stop autoboot: 3) at teraterm
  2. Start CCS4, you can open a new workspace if preferred.
  3. 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.
  4. If you created the target configuration in the default CCS folder you may need to select View->Target Configurations in the menu.

    1 - view target configuration.JPG



  5. Boot Linux by typing boot .
  6. 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
  7. Load dsplinkk.ko module:
    insmod dsplinkk.ko
    rm -f /dev/dsplink
    mknod /dev/dsplink c 230 0
  8. 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 ()
  9. Go to CCS, Right click on the target configuration and select "Launch Selected Configuration":

    2 - lauch target.JPG



  10. After the Debug perspective is launched, right click on the DSP (C674x) core and select “Connect Target".

    3 connect DSP.JPG



  11. 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):

    4 load symbols.JPG



    5 loadsymbols 2.JPG



  12. 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):

    6 locate source file.JPG



    7 browse to source file.JPG



  13. 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:

    8 set pc to cursor.JPG