Other Parts Discussed in Thread: HALCOGEN
Hello,
I am working on a real-time control project where we are using a simple task scheduler running off the RTI timer. The timer generates a 1ms tick and its ISR increments counters which are used to trigger 10ms, 100ms, and 1s tasks using the System Software Interrupts. The product will eventually be used in a safety critical application so we're trying to keep things simple and avoid using an RTOS which we'd have to certify.
The scheduler seemed to be working ok until I recently added our application software which runs in the 100ms task. This caused the microcontroller to crash shortly after returning from the application's main function which is called in the SSI ISR. After a bit of investigation, it appears the IRQ stack was overflowing and trashing the other stacks below it. I've adjusted the stack lengths in HALCoGen and it is not running happily again. However, I've ended up with an IRQ stack having to be as big as the user stack (0x800).
In the opinion of this forum's experts, is this an acceptable configuration, or is there a better way implement real time task ISRs? Eventually we'd like the higher rate tasks to be able to interrupt lower rate tasks. Is this likely to be difficult with our current arrangement?
Thanks in advance