NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Debugging DSP side using DSPLink NOTIFY module
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.
Contents
Overview[edit]
Several times, it is difficult to debug the DSP-side in GPP-DSP applications using DSP/BIOS Link. For example:
- JTAG/CCS is not available
- Failure is seen only in very specific condition, such as:
- Release build, where source-level debugging is not possible
- Race conditions which are not duplicated if emulator is connected
- 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[edit]
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.:
<syntaxhighlight lang='c'>
- 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) */
</syntaxhighlight>
- Define the callback function:
<syntaxhighlight lang='c'>
- 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) */
</syntaxhighlight>
- Send notification from DSP-side:
<syntaxhighlight lang='c'> 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 */) ;
</syntaxhighlight>
Usage[edit]
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[edit]
- 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 inPROC_attach()
, so the callback can be received anytime after that (onceNOTIFY_register()
is called). - The only thing to ensure is that
NOTIFY_notify()
must be used afterDSPLINK_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, theDSPLINK_init()
inmain()
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, soNOTIFY_notify()
can be called anytime after this. This enables debugging using NOTIFY very early in the DSP/BIOSTM boot process.