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.

How to set stack sizes for the different processor modes

Other Parts Discussed in Thread: HALCOGEN

Hi,

Whe I'm correct, each processor mode has its own stack size. I use HalCoGen to generate system initialization code. HalCoGen generates the sys_core.asm which seems to contain code to set the different stack pointers:

userSp  .word 0x08000000+0x00001000
svcSp   .word 0x08000000+0x00001000+0x00000100
fiqSp   .word 0x08000000+0x00001000+0x00000100+0x00000100
irqSp   .word 0x08000000+0x00001000+0x00000100+0x00000100+0x00000100
abortSp .word 0x08000000+0x00001000+0x00000100+0x00000100+0x00000100+0x00000100
undefSp .word 0x08000000+0x00001000+0x00000100+0x00000100+0x00000100+0x00000100+0x00000100

But I see no way to make HalCoGen use other values. I want to use larger stacks. How can I do that?

  • Sorry, Found it!

    You have to click on the RAM symbol and then you get a table of stacksizes. Exactly what I was looking for.

    B.T.W. Is there a way to check how much of the stack is/was used? Is the stack initialized with some data patern so that you can see which locations where used?

  • Cor,

    Regarding your question about stack usage - this post on the C2000 forum gives an idea that you could apply to Hercules as well:
    e2e.ti.com/.../440218

    Or - you could consider that the memory init done in hardware fills the entire SRAM with 0x00000000, and if that is enough of a pattern you could just look for a non-zero value on the stack to get an idea of how much stack has been used. Remember the stack is full descending so the stack pointer starts from the initial address and decrements as more stack it is used.