FreeRTOS + SystemClock Behavior
Hello,
I am using STM32L4A6VGTxP with CubeIDE and want to create a system with FreeRTOS.
However, I am having the following problem when running the system under FreeRTOS while changing the SystemClock.
Is there a solution?
Configuration
・Custom boards using the STM32L4A6VGTxP microcontroller
・Using STM32CubeIDE v1.9.0
・Firmware Package STM32Cude FW_L4 V1.17.2
・FreeRTOS v10.3.1 with CMSIS v2
Problem Description
FreeRTOS is initialized with the system clock set at HSI 16MHz at microcontroller startup.
If the system clock is subsequently changed, the OS time remains set at 16MHz.
How can I synchronize the OS time when the system clock is changed?
For example
(1) If you change the system clock from HSI 16MHz to HSI 80MHz
-> osDelay(1000), the Delay time will be 250ms
Execute osEventFlagsWait(ef_id, flags, options, 1000), the timeout time will be 250ms
When HAL_Delay(1000) is executed, Delay time becomes 1000ms.
(2) When changing from HSI 16MHz to MSI 4MHz
→When osDelay(1000) is executed, Delay time becomes 4000ms
When osEventFlagsWait(ef_id, flags, options, 1000) is executed, timeout time becomes 4000ms
Execute HAL_Delay(1000), Delay time will be 1000ms
Thank you.
