Skip to main content
Visitor II
January 24, 2024
Solved

STM32WL55 & FreeRTOS - Change system time base

  • January 24, 2024
  • 3 replies
  • 2371 views

Hello, I am working with the STM32WL55 core and I started the FreeRTOS test and a problem occurred to me that I would like to share with you.
The only thing I have done is define pin 15 of port B as output and I have created a FreeRTOS task, and within the task I have performed the LED switching:

hluyo_0-1706060373735.png

In addition to that, as is already known, FreeRTOS works with Sistyck and the HALs should use another clock source to avoid generating conflicts, in this case I have used timer 1.

hluyo_1-1706060394133.png

After configuring that way, I run the program and the LED stays on on the board, it does not switch as done in the programming.

Something different happens when I let the FreeRTOS and the HAL use the Systick as a clock source, the LED does blink.

What do you think is happening?

Best answer by STTwo-32

Hello @hluyo 

As you said "FreeRTOS works with Systick so is recommended for the HALs to use another clock source to avoid generating conflicts". I've personally tested using this example and it works fine. I've defined the Timebase source to both Tim1 and Tim17 and both works.

Best Regards.

STTwo-32

3 replies

STTwo-32
STTwo-32Best answer
Technical Moderator
January 26, 2024

Hello @hluyo 

As you said "FreeRTOS works with Systick so is recommended for the HALs to use another clock source to avoid generating conflicts". I've personally tested using this example and it works fine. I've defined the Timebase source to both Tim1 and Tim17 and both works.

Best Regards.

STTwo-32

AElgh
Associate III
May 26, 2024

Is it possible to use the RTC(as in the LoRaWAN-End-Node example) as the HAL time-base source (instead of any of the timers)?

AElgh
Associate III
May 26, 2024

Check the priority of the Systick in the NVIC, maybe other higher priorities tasks cut it before it finishes updating the counting.

Visitor II
December 27, 2025

Hello,

Any updates ?, i am also working on freertos in nucleo-stm32wl55jc1

 

Regards

Technical Moderator
December 28, 2025

Hello @mardaguler ,

To get started with FreeRTOS on the NUCLEO-STM32WL55JC1, use the STM32CubeWL firmware package, which provides several ready-to-use FreeRTOS examples run using STM32CubeIDE, and are easily customizable. 

Make sure to follow the instructions in the readme file and you can refer to " Getting started with STM32CubeWL" section in the UM2643 Getting started with STM32CubeWL for STM32WL Series.

If you still have issues, please create a new thread with more details as mentioned here: How to write your question to maximize your chances to find a solution.

 

 

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
Visitor II
December 28, 2025

Okey, thanks a lot.

Arda