electroRF
Member
Hi guys,
I got a design problem in the code which I need to solve, and thought I could get nice ideas here.
Each task in the OS has its own dedicated stack. (The OS was internally written here).
When a failure occur in any of the tasks, the task calls an Error Handler Function which handles the error.
The problem is that the Error Handler Function uses ~1KB due to local variables, and therefore it causes a stack overflow to the stack of the Task which called the Error Handler function.
Increasing the size of each Task's Stack is not something that can be afforded.
How would you handle this situation?
I thought of dedicating the Error Handler Function its own stack.
But perhaps something in the flow should be changed?
Any advice is appreciated
Thank you.
I got a design problem in the code which I need to solve, and thought I could get nice ideas here.
Each task in the OS has its own dedicated stack. (The OS was internally written here).
When a failure occur in any of the tasks, the task calls an Error Handler Function which handles the error.
The problem is that the Error Handler Function uses ~1KB due to local variables, and therefore it causes a stack overflow to the stack of the Task which called the Error Handler function.
Increasing the size of each Task's Stack is not something that can be afforded.
How would you handle this situation?
I thought of dedicating the Error Handler Function its own stack.
But perhaps something in the flow should be changed?
Any advice is appreciated
Thank you.