This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: online stack overflow detection

Part Number: TMS320F28377D

Application report SPRA820 explained a detection method for online stack overflow. The latest version of this report was published in 2003. Is this detection method still available for 28377D? Do I need to change something? e.g register address?

  • Hi,

    Yes, this report is still valid and applicable for F28377D device.

    Regards,

    Vivek Singh
  • Hi,

    When I tried to execute the following code in CPU1 or CPU2, it both failed and returned 1. It means that the software failed to gain control of watchpoint.

    /* Confirm that the application owns the watchpoint */
    if((*WP_EVT_ID & 0xC000) != 0x4000) /* Software failed to gain control of watchpoint */
    {
    asm(" EDIS"); /* Disable EALLOW protected register access */
    return(1); /* Return error code */
    }

    The Analysis Block Watchpoint Registers definition are as below:
    #define WP 0
    /* Address and value definitions for Emulation Watchpoint Registers */
    #if WP == 0
    #define WP_MASK (volatile Uint32 *)0x00000848 /* WP0 MASK register addr */
    #define WP_REF (volatile Uint32 *)0x0000084A /* WP0 REF register addr */
    #define WP_EVT_CNTL (volatile unsigned int *)0x0000084E /* WP0 EVT_CNTL register addr */
    #define WP_EVT_ID (volatile unsigned int *)0x0000084F /* WP0 EVT_ID register addr */
    #define EVT_CNTL 0x080A /* EVT_CNTL value for WP0 */
    #else #define WP_MASK (volatile Uint32 *)0x00000828 /* WP1 MASK register addr */
    #define WP_REF (volatile Uint32 *)0x0000082A /* WP1 REF register addr */
    #define WP_EVT_CNTL (volatile unsigned int *)0x0000082E /* WP1 EVT_CNTL register addr */
    #define WP_EVT_ID (volatile unsigned int *)0x0000082F /* WP1 EVT_ID register addr */
    #define EVT_CNTL 0x081A /* EVT_CNTL value for WP1 */
    #endif
  • This occurs if you have debugger connected and breakpoint(s) set.
    Remember that a breakpoint may also be set via enabled clock or some other debugger actions.
    Then the application can't use this breakpoint/watchpoint because it's blocked by the debugger.
    This should not occur in standalone mode.
  • Did the suggestion from Stephan help you resolve the issue?