cancel
Showing results for 
Search instead for 
Did you mean: 

SysTick_Handler and RTOS

Ahajr.1
Associate II

Hello , 

I had started a project with STM32F410RB wish communicate with a keyboard and LCD

Actually i wrote my program that call SysTick_Handler from stm32f4xx_it.c to interact keyboard and detect if there is a button pressed and wrote caracter on LCD. Everything in going  well until here.

Now i would like to integrate RTOS on my project to communicate with other board and i'm planning to create 2 task, one for (keyboard/LCD) and one for the other board

I would like to hear from your experience if i'm making mistakes and what things should i take care about?

Thank you in advance

Best Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @Ahajr.1​ and welcome to the Community =)

By default, the STM32Cube HAL is built around a unique timebase source which is the ARM-Cortex system timer (SysTick).

However, HAL-timebase related functions are defined as weak so that they can be overloaded to use another hardware timebase source.

This is strongly recommended when the application uses an RTOS, since this middleware has full control on the SysTick configuration (tick and priority) and most RTOSs requires SysTick and force the SysTick priority to be the lowest. Using the SysTick remains acceptable if the application respects the HAL programming model, that is, does not perform any call to HAL timebase services within an Interrupt Service Request context (no dead lock issue).

FreeRTOS requires your SysTick to work correctly. So, I recommend you to follow the UM1718 to configure sysTick with RTOS in section : Example of configuration using SysTick and FreeRTOS.

You can get more details on how to use the STM32Cube firmware with RTOS in this user manual UM1722 "Developing Applications on STM32Cube with RTOS" - comes also with description of a set of examples-

In the STM32CubeF4 package, you will find a FreeRTOS example which is available for boards marked with "x" in the table 1 from AN4739: STM32Cube firmware examples for STM32F4 Series, like: \STM32Cube_FW_F4_V1.26.1\Projects\STM32F412G-Discovery\Applications\FreeRTOS

Hope this helps you!

Please mark my answer as best by clicking on the "Select as Best" button if it helped =)

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

1 REPLY 1
Imen.D
ST Employee

Hello @Ahajr.1​ and welcome to the Community =)

By default, the STM32Cube HAL is built around a unique timebase source which is the ARM-Cortex system timer (SysTick).

However, HAL-timebase related functions are defined as weak so that they can be overloaded to use another hardware timebase source.

This is strongly recommended when the application uses an RTOS, since this middleware has full control on the SysTick configuration (tick and priority) and most RTOSs requires SysTick and force the SysTick priority to be the lowest. Using the SysTick remains acceptable if the application respects the HAL programming model, that is, does not perform any call to HAL timebase services within an Interrupt Service Request context (no dead lock issue).

FreeRTOS requires your SysTick to work correctly. So, I recommend you to follow the UM1718 to configure sysTick with RTOS in section : Example of configuration using SysTick and FreeRTOS.

You can get more details on how to use the STM32Cube firmware with RTOS in this user manual UM1722 "Developing Applications on STM32Cube with RTOS" - comes also with description of a set of examples-

In the STM32CubeF4 package, you will find a FreeRTOS example which is available for boards marked with "x" in the table 1 from AN4739: STM32Cube firmware examples for STM32F4 Series, like: \STM32Cube_FW_F4_V1.26.1\Projects\STM32F412G-Discovery\Applications\FreeRTOS

Hope this helps you!

Please mark my answer as best by clicking on the "Select as Best" button if it helped =)

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen