2024-05-09 01:06 PM
I was about to configure the FreeRTOS for my project when I noticed the following:
TICK_RATE_HZ TICK_RATE_HZ must be between 1 and 1 000. Parameter Description: Sets the tick interrupt frequency. The value is specified in Hz. Warning: The max value is 1000, as higher values generate compilation errors (division by zero) |
Does it mean 1000Hz is the fastest FreeRTOS can work with, and anything else should follow a bare-metal approach?
I found this related topic, but it is not clear to me if that applies to STM32. Hence, I would appreciate the opinion of the experts here.
2024-05-09 01:16 PM
I am not an expert for rtos...but what the AI says :
According to the search results, a moderate task switch rate is around 300 per second per processor. However, this rate can vary depending on the system’s usage and configuration.
>Does it mean 1000Hz is the fastest FreeRTOS can work with, and anything else should follow a bare-metal approach?
Right.
>but it is not clear to me if that applies to STM32.
This is not specific for a cpu - its the rtos system, you choose. Look at Azure, standard is 10ms tick.
But you can set it up to 1ms, same as FreeRTOS .
2024-05-09 03:49 PM - edited 2024-05-09 04:27 PM
@eduardo_reis wrote:
Does it mean 1000Hz is the fastest FreeRTOS can work
It means what it says - that is the fastest tick rate that is allowed*.
Note that this doesn't mean the fastest CPU clock rate which can be used...
@eduardo_reis wrote:it is not clear to me if that applies to STM32.
It's not specific to any particular microcontroller - it's a FreeRTOS thing.
So you'd be better asking on the FreeRTOS forums.
EDIT:
* Actually, from the post you cited, and others such as this:
https://forums.freertos.org/t/freertos-high-tick-rate-for-machine-control/6913
it seems that tick rates >1kHz are possible - but strongly advised against.
Both of those posts give some reasons why it could be a Bad Thing.
You'd probably be best explaining your actual goal on the FreeRTOS forums, and asking them for their advice on how best to achieve that within FreeRTOS.