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.

TMS320F280025: Disable and later reenable watchpoint (claimed by software)

Part Number: TMS320F280025

Hi,

I am using the application note/application report "Online Stack Overflow Detection on the TMS320C28x DSP" to monitor the stack. I am also using a non-destructive RAM check (from the diagnostic lib). Of course, when the RAM check is checking the RAM where the the stack is located, the stack overflow detections triggers as the memory is written to.

Therefore I want to disable the watchpoint before the memory check and later reenable it. Unfortunately I cannot find any detailed information about the "Analysis Block" and how it works in detail. The only information I got is from the app note itself.

Based on that I tried this:

#define WP_EVT_CNTL (volatile unsigned int *)0x0000084E // WP0 EVT_CNTL register addr
void DisableStackOverflow()
{
    *WP_EVT_CNTL = 0x001; // Write 0x0001 to EVT_CNTL to disable watchpoint
    // of the watchpoint
    asm(" RPT #1 || NOP"); // Wait at least 3 cycles for the write to occur
}



void ReenableStackOverflow()
{
    *WP_EVT_CNTL = 0x002; // Write 0x0002 to EVT_CNTL to enable watchpoint
    // of the watchpoint
    asm(" RPT #1 || NOP"); // Wait at least 3 cycles for the write to occur
}

However, this doesn't work:
Although I am calling DisableStackOverflow() before the RAM check, I still receive the RTOSINT.

Can someone point me to the documentation I need? Or tell me if this is feasible at all?

Thank you very much,
Andreas

  • Hi Andreas,

    Let me check with the SW team. Somebody will get back to you in next couple of days.

    Best Regards,

    Nirav

  • Hi Andreas,

    Sorry for the slight delay with this. Not sure if this is the right sequence for this, will check and get back if there is a better way to handle this.

  • Hi all,

    I had a look again as well, and I found this solution:

    #define WP_EVT_CNTL (volatile unsigned int *)0x0000084E // WP0 EVT_CNTL register addr
    void DisableStackOverflow()
    {
        // Enable EALLOW protected register access
        asm(" EALLOW");
    
        *WP_EVT_CNTL = 0x001; // Write 0x0001 to EVT_CNTL to disable watchpoint
        // of the watchpoint
        asm(" RPT #1 || NOP"); // Wait at least 3 cycles for the write to occur
    
        // Successful Return
        asm(" EDIS");
    }
    
    
    
    void ReenableStackOverflow()
    {
        // Enable EALLOW protected register access
        asm(" EALLOW");
    
        *WP_EVT_CNTL = 0x080A; // Write 0x0002 to EVT_CNTL to enable watchpoint
        // of the watchpoint
        asm(" RPT #1 || NOP"); // Wait at least 3 cycles for the write to occur
    
        // Successful Return
        asm(" EDIS");
    }

    So basically I missed the EALLOW in the first place and also you have to reenable the watchpoint  with also writing its configuration again.

    Both problems could have been avoided if there was a proper documentation available for the analysis block.

    Best regards,
    Andreas