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.

TMS320F2812: Stack pointer and size questions and issues

Part Number: TMS320F2812


I had some questions about the stack on the TMS320F2812 since I'm currently running into issues with stack running out of space.

The board I'm working with has an external memory of size 256KB connected to XINTF zone 2. Currently, all data memory in the program is being placed at the start of external memory, and stack has full use of the L0 and L1 SARAM starting at address 0x8000. The problem is that L0 and L1 only total 8KB, and the stack is growing larger than that.

Are there any larger memory regions on the TMS320F2812 that are available for use as the stack? I wanted to use the external memory, but it looks like the stack pointer is only 16 bits, so it can't point at that address. I was having trouble finding the right document for thechip though, so I could be wrong about that. Can you confirm my understanding of that as well?

Thank you for your time and any help!

  • Hello Gregory,

    Your understanding is correct.  On F2812 device, 8Kw (8Kx16) is the largest stack you can get by combining L0 and L1 SARAMs.  The stack pointer cannot reach above 16 bits, so you cannot use XINTF zone 2.

    What is making your stack so large?  Do you have large local variables in some functions?  Declare them as 'static' which will put them in global memory in the .ebss section instead of on the stack.

    Also, realize that F2812 is an old device.  There are better, newer choices available.  For one, F28335 is similar to F2812 but would allow a much larger stack.

    Regards,

    David

  • The hardware is defined already, so I don't have an option to update the chip to a newer one. The stack is growing large partly due to the software size, but also because of additional stack used during automated testing. Due to some other requirements, I'm unable to make just about anything static.

    Anyways, I'm looking into other options on my end as well, I just wanted to confirm my understanding of the stack on the chip. Thank you for the reply!