I've enabled one serial port (SD2) for debugging traces, one timer (TIM2), and a couple of GPIO.
STM32 uses HSI16 as the main clock source. I can observe the (scaled) clock on a GPIO (using MCO)
I'm running TIM2 with HAL_GPT in continuous mode, with a callback (4MHz, ARR: 0xFFFF).
The callback is configured to toggle a GPIO on each call.
I can observe that the callback never gets called when the main() function is running a busy loop (something like for(;;) {}).
If I add some call to osalThreadSleepMilliseconds() in this loop, the callback is called.
I would have expected that the "main" (unique) thread would get preempted by the TIM2 ISR, but it seems it is not, so I guess I missed an important point somewhere (configuration)? I'm pretty sure it is not related to TIM2, as I can observe that the SD2 traces do not get output if a busy loop is called right after chprintf() has been called - I guess same symptom, ISR is not executed.
There is something critical I did not get about ChibiOS & OS-less mode it seems. I would have expected the ISR to execute even if the main() function was running a busy loop.
Any clue?
I tried to locate some demo about os-less environments, but I failed to find a matching example.
I've read that osalThreadSleepMilliseconds() uses a virtual timer, which seems to be documented as a part of the RT subsystem, so I got even more confused
Unrelated question: is the IRQ priority level (order, boundaries, ..) documented somewhere?
Thanks