Code is running in tickless mode:
Code: Select all
#define CH_CFG_ST_FREQUENCY 10000
#define CH_CFG_ST_TIMEDELTA 2
#define CH_CFG_TIME_QUANTUM 0
I have managed to observe the following:
1. The code is still running - no crashes or stack overflows.
2. Most threads are sleeping; a couple are waiting for events (one will never get triggered; the other is timer-driven):
3. Interrupts still work - one serial port is still receiving messages OK, and sets a semaphore to trigger processing; however they aren't processed because the processing thread is somewhere else. (Normally the processing thread is in a loop waiting on this semaphore).
4. The thread which initiates transactions on the second serial port isn't looping as it should; presumably because its sleeping somewhere.
5. It appears that Timer 2, which generates the system tick/timing, isn't triggering. The counter itself is still going, but a breakpoint on its ISR is never hit, and the register contents look as if timer interrupts are disabled:
I don't think its a hardware problem; mostly because the problem is apparent on several boards, and also because I'm reasonably certain the same boards ran for longer periods of time when the code was simpler.
Any suggestions on where to go from here in tracking this down? I'll not reset the processor until tomorrow just in case there's more useful information to be gleaned.