Other Parts Discussed in Thread: HALCOGEN, CODECOMPOSER,
Info:
HalcoGen: 04.07.01
CodeComposer: 8.1.0.00011
MicroController: TMS570LS3137
Compiler: TI v18.1.2.LTS
Reference Link: This
Hello,
I have been tasked with figuring out our stack usage, and came across the link above which helped a great deal. When trying to figure out how much we were using vs allocated I noticed a discrepancy.
In the sys_link.cmd we have:
STACK (RW) : origin=0x08000000 length=0x00003000
(Overall Stack 0x3000)
but when I looked at _coreInitStackPointer_ in sys_core.asm I noticed
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
(Overall stack 0x1500 and user stack 0x1000)
When I went to HalcogGen to try and have the Overall Stack match what we put in the sys_link.cmd file, HalcoGen would not let me change the first Stack length for the Stack Base Address section. I can change the length for the other Stack Base/Stack Length Sections.
I searched through SPNU499c.pdf and the SPNU151R.pdf file for info and didn't really find anything except in SPNU151R.pdf section 6.7.6 which states:
The FIQ, supervisor, abort, IRQ, and undefined modes have separate stacks that are not automatically
set up by the C/C++ run-time environment. If you have interrupt routines in one of these modes, you
must set up the software stack for that mode. However, ARM Cortex-M processors have two stacks,
and the main stack (MSP), which is used by IRQ (the only interrupt type for Cortex-M), is automatically
handled by the compiler.
So my questions are:
- Is 0x1500 the maximum Stack length for this processor/microcontroller?
- If not, can I manually change it in the sys_core.asm file?
- Does the Stack Size called out in the sys_link.cmd really do anything? (or what does it do?)
- Is there an issue with sys_link.cmd not matching the sys_core.asm?
- Where can I find information regarding the minimum/maximum stacks sizes for this processor?
Thanks for your time and information.
Regards,
Ryan