2023-02-09 12:45 AM
The code is generated by CubeMX. And every time program run into HAL_TIM_Base_Start_IT() like the figure below, the system will block in Default Handler. However, the TIM2_IRQHandler is defined in stm32g4xx_it.c.
Does anyone have idea why it doesn't work? I also attach the code.
Solved! Go to Solution.
2023-02-09 01:24 AM
Code looks OK.
Check if the user FLASH is mapped to 0x00000000; in other words, check, if you don't boot into the default bootloader in System Memory.
Also check SCB_ICSR.VECTACTIVE value.
JW
2023-02-09 01:08 AM
Your project works on my B-G431B-ESC1, tim_ticker incrementing as expected. STM32CubeIDE asked for migrating to the latest revision, what I did.
STMicroelectronics STM32CubeMX 6.7.0.202211181646 com.st.stm32cube.common.feature.mx
STM32CubeIDE Version: 1.11.0 Build: 13638_20221122_1308 (UTC)
hth
KnarfB
2023-02-09 01:24 AM
Code looks OK.
Check if the user FLASH is mapped to 0x00000000; in other words, check, if you don't boot into the default bootloader in System Memory.
Also check SCB_ICSR.VECTACTIVE value.
JW
2023-02-09 05:42 PM
Thanks! The problem is the boot mode. When I set boot from System memory, the program works well.