Other Parts Discussed in Thread: SYSBIOS
Hello,
ive come across a problem with my software which causes it to randomly fail due to stack overflow issue. At first im using an RTOS with roughly 10 Tasks. When an interrupt occurs it is mostly inside the stack of one of them. In order to do this all task stacks have to be larger to fit the random occurance of the various interrupts. Not only this wastes a lot of memory but im slowly reaching the memory limits of the part.
My question is now how do i redirect the stack pointer to a dedicated stack section only for interrupts. Also how does a rewrite of the stack pointer interact with interrupt nesting. In my understanding each entry of an isr has to first check if the stackpointer is within its dedicated section if not perform a rewrite otherwise just leave it as it is. The last isr that did the stack point relocation has to revert it to the original.
What would be the right way to implement this in software and in the linker and are there maybe other ways to achieve something similar. The number of important interrupts is rather small (3 or so) is it better to use an other technique to statically have a stack for each interrupt instead of a shared for all interrupts.
Thanks in Advance
Tobias