High tick rate?

I’m porting an application from ChibiOS to FreeRTOS, and I’m curious about the tick rate. I’ve read that going above 1kHz isn’t advisable because you’re starving the application runtime, but we’re currently running ChibiOS at 100kHz and many virtual timers rely on such resolution.

How inadvisable is running FreeRTOS at such high tick rates?

It is really an application writers choice bounded only by physics (how quickly can the MCU process interrupts). The trade off is the amount of time spent going in an out of the interrupt is time taken away from processing application tasks. Normally if 100KHz processing is required we would recommend doing it outside of the RTOS. For example, set the priority of the 100KHz interrupt above the interrupt priorities that get masked by FreeRTOS critical sections (so the the kernel doesn’t introduce any jitter in the 100Khz timing), then do whatever processing needs to be done at that rate from within the ISR - on the assumption if you are doing something that frequently then it is not going to be long running code. Doing so does mean you can’t access the FreeRTOS API from inside the interrupt though as only interrupts at or below those used to implement critical sections can call FreeRTOS API functions.

1 Like

Thank you for the detailed reply!