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.

TMS320F28027: how can I know the actual size of the stack under CCS debug mode

Part Number: TMS320F28027

Hi,

In CMD file there are codes below:

PAGE 1 : /* Data Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */

RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */

/* Allocate uninitalized data sections: */
.stack : > RAMM1, PAGE = 1

In projects properties "set C system stack size" is 0x300.

1. So the limit of the stack size is 0x300 or 0x400?

In SPRU430F, it's said that "The SP always points to the next empty location in the stack.", does it mean that if SP=0x408, then the actual stack size is 0x008(0x408-0x400)?

But when I debug the code in CCS, I can observe like below: SP=0x404, but in memory browser *(0x404)=0x740D, it's not empty.

2. How can I know the actual stack size when I step the code through CCS?

  • 3. In SPRU430F, it's said that "At reset, the SP is initialized, so that it points to address 0000 0400", can I change this address? If not, the memory from 0x000-0x3FF cannot be allocated for stack, right?
    4. Can I allocate flash other than RAM to store stack?
  • Hi Howard,

    1. So the limit of the stack size is 0x300 or 0x400?
    [Katta] It is 0x300. The value given in CCS GUI is overriding the value given in linker cmd file. You can check in the .map file to get the final length used to allocate.

    Thanks,
    Katta