Skip to content

Wrong tick-timing with STOP0 mode #19

Answered by jefftenney
govindadas asked this question in Q&A
Discussion options

You must be logged in to vote

There are two different system ticks. The FreeRTOS tick and the HAL tick. They are independent and concurrent.

If you are using lptimTick.c, the FreeRTOS tick is provided by an LPTIM timer. If you are not using lptimTick.c, the FreeRTOS tick is provided by the SysTick timer. The FreeRTOS tick rate is set by configTICK_RATE_HZ.

The HAL tick is provided by a timer of your choice. In CubeMX, see Pinout & Configuration -> System Core -> SYS -> Timebase Source. The HAL configures the selected timer to provide a 1000 Hz tick rate.

When you call HAL_Delay(), you are delaying based on the HAL tick. These delays are busy-wait delays -- not OS friendly and not power friendly. When you call osDelay()

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@govindadas
Comment options

@Olstyle
Comment options

@govindadas
Comment options

@Olstyle
Comment options

@govindadas
Comment options

Comment options

You must be logged in to vote
1 reply
@govindadas
Comment options

Answer selected by govindadas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants