On STM32, I used ChibiOs. It supports a lot of STM32 peripherals with kernel functions, and a lot of familly members. But no port for Teensy.
On Teensy, I used Freertos with no problems. I used the port from tsandmann.
One of the problem with interrupt routines in core libraries, they lack some kind of weak external hook, which is called at the end of the IRQ function. I only found one on the can library.
Using this, you call your own function which put the received byte or frame in a message queue, which is awaited by a thread. The IRQ return, and the kernel switch context to the awaiting thread. This is more efficient than calling yield() in all threads and checking if bytes are available from devices.
On Teensy, I used Freertos with no problems. I used the port from tsandmann.
One of the problem with interrupt routines in core libraries, they lack some kind of weak external hook, which is called at the end of the IRQ function. I only found one on the can library.
Using this, you call your own function which put the received byte or frame in a message queue, which is awaited by a thread. The IRQ return, and the kernel switch context to the awaiting thread. This is more efficient than calling yield() in all threads and checking if bytes are available from devices.
Last edited: