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: Some questions about stack overflow

Part Number: TMS320F28377D


We carry out stack  overflow detection based on SPRA820 document. The link is as below:

https://www.ti.com/lit/an/spra820/spra820.pdf?ts=1616635990107&ref_url=https%253A%252F%252Fwww.ti.com%252Fsitesearch%252Fdocs%252Funiversalsearch.tsp%253FsearchTerm%253DSPRA820

My question is:

1. The current stack interval is 0x400~0x7FF. Can I set the stack interval to 0x300~0x7FF?

2. I want to make the stack overflow intentionally. What can be done in the program except to reduce the stack's interval?

3. The Stack Overflow diagnostic document States that the RTOSINT interrupt will be triggered after the stack overflow. I will turn off the PWM output during this interrupt. Do I need to clear the interrupt flag and interrupt enable for this interrupt function? The description for RTOSINT could not be found in the manual, Could you give me some detail description about the RTOSINT interrupt? 

Thanks a lot!

  • Hi Angela,

    1. The current stack interval is 0x400~0x7FF. Can I set the stack interval to 0x300~0x7FF?

    Do you mean you need to move the stack memory from 0x400 to 0x300? You can do that by updated the linker command file.

    .stack           : > RAMM1,     PAGE = 1

    The address 0x300 falls under RAMM0 which is by marked for program memory (PAGE 0). But, if needed, you can move that to data memory (PAGE 1) and use that foe mapping .stack section.

    2. I want to make the stack overflow intentionally. What can be done in the program except to reduce the stack's interval?

    You can call a recursive function like below. After few iteration, it should cause a stack overflow

    void recursiveFunction(uint32_t delay)
    {
        functionCallCount++;
        recursiveFunction(delay + 1UL);
    }
    Could you give me some detail description about the RTOSINT interrupt? 

    Please refer to this document for more details on RTOSINT. RTOSINT is not tied to PIE. So, there are no PIE flags which you need to clear.

    Regards,

    Veena