Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE
Dear TI support team,
When enabling optimizer level 0 on CPU1 of F28379D C2000 chip, I encounter a stack overflow. When disabling the optimizer, the stack usage is at ~5% of a 2K stack. When enabling the optimizer, stack usage jumps to ~104% resulting in an ITRAP. I fill the stack with pattern "A5A5" and I noticed that only the first few bytes of the stack are utilized, and then the SP (stack pointer) jumps down to near the end of the stack and starts utilizing the end of the stack, such that there is a large region of unused stack as noted by "A5A5".
I already ruled out static inline functions on my side, although C2000ware uses static inline functions so maybe the stack context frame is large and leaves a large memory region of stack unused?
Using the Stack Usage window I can see the stack usage of every function and nothing sticks out to me as concerning.
I set a hardware watchpoint for the end of the stack and I keep hitting the SCIB RX interrupt. However, I don't think it is the SCI B RX interrupt that is causing issues by itself since I have two modes that utilize SCI B RX interrupt, one of the modes causes stack overflow, and the other mode does not. The mode that causes stack overflow is more math/cpu intensive so I'm wondering if something is causing an overflow, but it's just weird to me that the stack pointer would skip such a large region of stack memory and utilize something near the end of the stack.
Any pointers on how to figure out the root cause would be great.
Thanks!
