Debugging the DSP side of a DSPLink application on OMAP 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.

Debugging the DSP using CCS for a DSPLink application on OMAP

This topic discusses how to debug the DSP-side of a DSPLink application using CCS on an OMAP3 Mistral EVM using a Blackhawk 560 emulator. It assumes that you are familiar with all of the content in the Getting Started Guide, you can navigate around CCS fairly well, and can rebuild the DSP Link examples.

This page can also help if you want to simply connect to the OMAP3530 EVM board via a JTAG emulator.

Before you get started

  • Install CCS Service Release 11 - it is available for Download at the Update Advisor webpage.
  • Install the appropriate emulation drivers. The procedure below used a Blackhawk BH-USB-560m, but Spectrum Digital emulators can also be used.
  • Rebuild the DSPLink message example and verifies it runs without any issue. For details please refer to this article.

Set the EVM switches

  • Set SW1 to 10000100
Note: this setting will enable full debug and control of the ARM and the DSP via JTAG, however DSP/BIOS Link debug can still be performed if SW1 is left in its default configuration 00000100 - see more below.
  • Set SW4 to boot your desired Linux kernel (for Samsung memory, to use TFTP/NFS, set it to 10010000)

Modify the DSPLink message example

On the GPP side it is necessary to load and release the DSP from reset in order to be able to connect to CCS. This is done by halting the GPP-side application after PROC_start().

- In the message example, this is located in the file gpp/src/samples/message/message.c (around line 327 for DSP/BIOS Link 1.51). The code below is shown for convenience, requiring a rebuild of the GPP-side application by typing make in the gpp/src/samples/message directory.
- Please be aware that if PROC_stop() is executed it holds the DSP in reset again, preventing further debugging via CCS.
     /*
      *  Start execution on DSP.
      */
    if (DSP_SUCCEEDED (status)) {
        status = PROC_start (ID_PROCESSOR) ;
        if (DSP_FAILED (status)) {
            MESSAGE_1Print ("PROC_start () failed. Status = [0x%x]\n",
                            status) ;
        }
/* Add the two lines below, and don't forget to add the #include <stdio.h> at the beginning of the file */
    MESSAGE_0Print ("Hit Enter to continue...\n");
    getchar();
    }

On the DSP side, depending on the configuration of SW1 a reset command from the GPP issued by PROC_start() may either keep the DSP halted in the reset vector or put it to run freely. This last case will require a similar modification to halt the DSP code just after main().

- In the message example, the modification should be done at dsp/src/samples/message/main.c (around line 125 for DSPLink 1.51). A rebuild is required and done by typing make in the dsp/src/samples/message directory.
/* 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 */
while(i);

Connecting to CCS

This process will depend on the settings of SW1:

SW1 set to 10000100:

  1. Start Setup Code Composer Studio and under Platform, choose bh-usb560(m) and then select Blackhawk USB560m – OMAP3530 Emulator from the list of available boards, followed by Add. Then chooseSave and Quit and start Code Composer Studio
  2. When the CCS Parallel Debug Manager comes up, double click CortexA_0. When the CCS window opens, connect the ARM by typing <alt>-c. This will make the GEL file run properly.
  3. Then select GEL->IVA2200_Startup->IVA2200_GEM_Startup
  4. Switch back to the CCS Parallel Debug Manager and open C6400PLUS_0. This will release the DSP from reset.
  5. To make sure everything is correct, in the CCS DSP window connect the DSP using <alt>-c
  6. Open a terminal (like TeraTerm). Switch back to the CCS ARM window, and disconnect the ARM using <alt>-c. This will bring up a u-boot prompt on the terminal. Boot-up Linux using the desired kernel and file system. This will cause the DSP to be reset.
  7. Load the DSPLink module (insmod dsplink.ko and mknod /dev/dsplink c 230 0)
  8. Run the modified application in both GPP and DSP sides: ./messagegpp message.out 1
  9. This will bring up an error message in the CCS DSP Window, since the emulator loses sync with the DSP as runs freely after being released from reset (configured by the GEL GEM_Startup routine). Choose disconnect and then try <alt>-c repeatedly until the emulator successfully syncs with the DSP again. Now the DSP execution is controlled by the JTAG.
  10. In the CCS DSP Window, select File->Load Symbols->Load Symbols Only, and browse to the <message.out> file. This will generate a warning that CCS does not detect <main.c>. This is expected since the project with all the source files is not open in CCS. When debugging your own application, you can either create a project to enable source code debugging instead of assembly-only or simply browse to your source file when prompted.
  11. In the message example, the DSP is stuck in the while() 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.

SW1 set to 00000100

  1. Start Setup Code Composer Studio and under Platform, choose bh-usb560(m) and then select Blackhawk USB560m – OMAP3530 Emulator from the list of available boards, followed by Add. Then chooseSave and Quit and start Code Composer Studio
  2. Switch back to the CCS Parallel Debug Manager and open C6400PLUS_0
  3. Open a terminal (like TeraTerm). Boot-up Linux using the desired kernel and file system. This will cause the DSP to be reset.
  4. Load the DSPLink module (insmod dsplink.ko and mknod /dev/dsplink c 230 0)
  5. Run the modified GPP-side application: ./messagegpp message.out 1
  6. In the CCS DSP window connect the DSP using <alt>-c
  7. In your CCS DSP Window, select File->Load Symbols->Load Symbols Only, and browse to the <message.out> file. This will generate a warning that CCS does not detect <main.c>. This is expected since the project with all the source files is not open in CCS. When debugging your own application, you can either create a project to enable source code debugging instead of assembly-only or simply browse to your source file when prompted.
  8. Bring up the source files you’d like to debug using File->open and set the appropriate breakpoints. Hit F5 to run the DSP after you are done.
  9. Hit a key in the terminal window and press Enter. The program will continue to run and the breakpoints on the DSP will (hopefully) be hit.

Special notes

  • Despite requiring additional steps, setting SW1 switch to the first configuration is useful if there is initialization code that requires immediate execution before main() - usually if there is a function that executes in GBL_init(). The second configuration is simpler and does not require as many steps.
  • If you are using a Micron Memory EVM (the above directions are for Samsung): When you Open CortexA_0 (as done in Step 2 above), you’ll need to modify the <omap3530_cortexA.gel> file (change line 221) to match your type of DDR (you can see a list of DDR types in <omap3430_sdrc_configs.gel>)
  • Some documentation on this procedure is in the DSPLink User Guide (see page 88 for DSPLink 1.51)
  • If you’ve been browsing the wiki, you may find an article explaining a similar procedure (although slightly different) here