Skip to main content
Graduate II
May 9, 2024
Solved

Is it possible to have faster tick rates on FreeRTOS?

  • May 9, 2024
  • 2 replies
  • 4986 views

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.

    This topic has been closed for replies.
    Best answer by Andrew Neil

    @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.

    2 replies

    Super User
    May 9, 2024

    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 .

    Super User
    May 9, 2024

    @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.