cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX v5.1.0 DOESN'T GENERATE SysTick_Handler!!!!!

TDK
Guru

Because SysTick_Handler is defined as weak, with a fallback to Default_Handler (which is a infinite while loop), this means the first time your program generates a SysTick event, your program crashes.

Hopefully this post prevents others from wasting an hour trying to figure out why their code doesn't run.

This is with STM32CubeMX v5.1.0 and the latest STM32F4 firmware.

How the hell does this stuff make it through QA? Does ST even have QA?

If you feel a post has answered your question, please click "Accept as Solution".
3 REPLIES 3
Pavel A.
Evangelist III

Can you share your .ioc file, please? The systick handler should be generated - unless it was accidentally unchecked in NVIC configuration.

-- pa

TDK
Guru

Pavel,

Attached is the IOC. The issue was indeed that the checkbox you mentioned was unchecked.

The issue is repeatable:

Open cube v5.1.0, create a new project, select STM32F429DISC1 board, choose "Yes" to "Initialize all peripherals with their default Mode".

Then go to NVIC -> Code generation. Observe that the "Generate IRQ handler" for "System Tick Timer" is unchecked. On hover, the tooltip says "IRQ handler is provided by FreeRTOS".

Okay. However, I don't want FreeRTOS. Why is it now enabled by default anyway? That seems like a very nontrivial change to the previous defaults. So I disabled FreeRTOS. After this, the checkbox is still disabled and SysTick_Handler never gets created.

If you feel a post has answered your question, please click "Accept as Solution".
S.Ma
Principal

Therr are many threads about some changes on the systick generated code and callbacks since cubemx5+