cancel
Showing results for 
Search instead for 
Did you mean: 

Why cubeMx recommend I use the timer, not systick, when I config freeRTOS?

Junde
Senior II

Hi,

The same as the title, I'm confused that why NOT just use systick as the tick of RTOS.

The aim of the systick is for good portability of the RTOS, yes?

0693W00000bhPRGQA2.png

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

> The aim of the systick is for good portability of the RTOS, yes?

Yes, FreeRTOS, for one, uses systick as its tick timer. The CubeMX/IDE configurator fully supports this and lets the RTOS manage the systick.

But the "HAL" library also needs a tick timer, by default it is the systick as the simplest choice. When the user's project contains a RTOS, the Cube advises to use a different timer for the "HAL" library.

Can these two timers be merged together? Sometimes yes, but generally no.

If you don't use the HAL library at all, there is no need for a separate timer for it and the whole issue disappears.

View solution in original post

2 REPLIES 2
Pavel A.
Evangelist III

> The aim of the systick is for good portability of the RTOS, yes?

Yes, FreeRTOS, for one, uses systick as its tick timer. The CubeMX/IDE configurator fully supports this and lets the RTOS manage the systick.

But the "HAL" library also needs a tick timer, by default it is the systick as the simplest choice. When the user's project contains a RTOS, the Cube advises to use a different timer for the "HAL" library.

Can these two timers be merged together? Sometimes yes, but generally no.

If you don't use the HAL library at all, there is no need for a separate timer for it and the whole issue disappears.

Junde
Senior II

@Pavel A.​ 

OK, I got it.

Thank yours.