Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Debugging DSP side using DSPLink NOTIFY module

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.

Overview

Several times, it is difficult to debug the DSP-side in GPP-DSP applications using DSP/BIOS Link. For example:

  1. JTAG/CCS is not available
  2. Failure is seen only in very specific condition, such as:
    1. Release build, where source-level debugging is not possible
    2. Race conditions which are not duplicated if emulator is connected
    3. Before execution reaches a place where the emulator can be connected/DSP execution can be stopped.

In such cases, it is very simple to use NOTIFY module as follows. Note that NOTIFY has no dependency on POOL or any other modules within DSPLink, and hence is the simplest to use of all the modules.

Method

The method to use NOTIFY for DSP-side debugging is:

  • Include notify.h in both the GPP and DSP-side application.
  • Register notification on the GPP-side for a callback function. Only minor code is needed. E.g.:
#if defined (DEBUG_APPLICATION)
NOTIFY_register (ID_PROCESSOR, /* Processor ID to talk with. */
                 0,            /* IPS ID to be used */
                 5,            /* IPS event number. Choose any unused number */
                 myFxnDebug,   /* Callback function for debugging */
                 NULL          /* Parameter (if any) for callback function */) ;
#endif /* if defined (DEBUG_APPLICATION) */
  • Define the callback function:
#if defined (DEBUG_APPLICATION)
   Void myFxnDebug (Uint32 eventNo, Pvoid arg, Pvoid info)
   {
       printf ("In notify callback info %d\n", info) ;
   }
#endif /* if defined (DEBUG_APPLICATION) */
  • Send notification from DSP-side:
NOTIFY_notify (ID_GPP, /* Processor ID to send notification to. */
               0,      /* IPS ID to be used */
               5,      /* IPS event number. Choose any unused number. */
               info    /* 32-bit information to be sent across */) ;

Usage

The notifications sent from DSP-side will be received as callbacks, and the print will be seen. This mechanism can be used for:

  • Getting information about sequence of operations on the DSP-side: A specific code can be assigned to each possible operation in the sequence on DSP-side. Based on the received callbacks on GPP-side, this can be decoded to get the actual sequence that has occurred.
  • Validity of data structures and any corruption. The 32-bit payload with the NOTIFY_notify() call can be used to send this information.

Other information

  • NOTIFY API is available in DSPLink v1.40.05 (1.40.03 onwards).
  • The callback will be received even if the NOTIFY_notify() call is made in DSP’s main function. This is because the GPP interrupt is registered in PROC_attach(), so the callback can be received anytime after that (once NOTIFY_register() is called).
  • The only thing to ensure is that NOTIFY_notify() must be used after DSPLINK_init() is called so that the modules have been initialized on DSP-side. Usually they will get initialized before main (e.g. if POOL is used). But if POOL, CHNL and MSGQ are all scaled out, the DSPLINK_init() in main() is the one that actually initializes these modules on DSP-side.
  • If POOL, CHNL and MSGQ are all included in the build, the very first init (i.e. POOL_init()) initializes the modules, so NOTIFY_notify() can be called anytime after this. This enables debugging using NOTIFY very early in the DSP/BIOSTM boot process.