2019-03-30 02:25 PM
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?
2019-03-30 04:24 PM
Can you share your .ioc file, please? The systick handler should be generated - unless it was accidentally unchecked in NVIC configuration.
-- pa
2019-03-30 04:59 PM
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.
2019-03-31 12:40 AM
Therr are many threads about some changes on the systick generated code and callbacks since cubemx5+