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.

Stack size and Stack location

Hi,

I am working on 28069.

In the datasheet, it is specified that uppon reset, Stack Pointer is initiallized with RAMM1 start address.

This limit stack size to 0x400 words (size of RAM M1).

1. Must I place the stack in RAMM1

2. Can I make stack size larger

Thanks

Ben

  • Hi Ben,

    Ben Niazof said:
    1. Must I place the stack in RAMM1

    Yup in RAMMx, something like this:

    .stack              : > RAMM0        PAGE = 1

    or

    .stack           : > RAMM1,     PAGE = 1

    Ben Niazof said:
    2. Can I make stack size larger

    Yes, by navigating to : Project -> Properties -> Build -> C2000 Linker -> Basic Options -> Set C system stack size

    Regards,

    Gautam

  • As the stack pointer is only 16 bits wide, the stack has to be placed within low 64K. You can place it also in L0 to L6. You can also join M0 and M1 and place it there. This will double your stack size.

    If you place it in secure RAM, and if you are using CSM, you have to keep in mind that any code running from non-secure RAM can not use stack in secure RAM.

    You can set the size in linker settings

    I also found this app note useful as the CPU does not have any stack pointer monitoring www.ti.com/.../getliterature.tsp;fileType=pdf

    Regards, Mitja
  • Thanks,
    That's helpful.