Debugging DSPLink using SET FAILURE REASON prints

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Overview

When a DSPLink API call fails with error, the error code provides information about the type and cause of failure.

However, sometimes, even though the error code is known, it is not clear why the failure is occurring. For example, a generic failure code is seen DSP_EFAIL, which may be returned from multiple locations within DSPLink. It is not immediately obvious where the failure lies. In this case, the further level of debugging can be used, by just enabling SET_FAILURE_REASON print.

SET_FAILURE_REASON is a technique used within DSPLink to log failure occurring at any location within the source code. By printing the failure reason, it gives immediate information about the file, line number and failure code, which can be used to understand why the failure has occurred. Since DSPLink source code is available for reference, the reason for failure can be identified in most cases.

Enabling SET_FAILURE_REASON prints on user-side

If TRACE is enabled, in case of any API failure, SET_FAILURE_REASON prints will start coming within the output to the console. For instructions on enabling trace, refer to the Enabling trace in DSPLink article.

Enabling SET_FAILURE_REASON prints on kernel-side

File: ${DSPLINK}/dsplink/gpp/src/gen/trc.c
Function: TRC_SetReason()
Existing Code:

#if defined(DDSP_DEBUG)
    TRC_3PRINT (TRC_LEVEL7,
                "Failure [0x%x] in [0x%x] at line %d\n",
                status, FileId, Line) ;
#endif  /* #if defined(DDSP_DEBUG) */

Add:

PRINT_Printf ("Failure [0x%x] in [0x%x] at line %d\n",
                   status, FileId, Line) ;
Failure [0x8000800C] in [0x71B] at line 455 

To interpret this:

E2e.jpg For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Debugging DSPLink using SET FAILURE REASON prints here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox