Showing results for 
Search instead for 
Did you mean: 

Incomplet SystemInit() for STM32G474

Associate II


Recently I spent some time solving the problem of incorrect CPU operation. After generating the project (completely basic, only TIM6 set as TimeSource for HAL), the program diverged when trying to enter the interrupt from TIM6 (I'm guessing). Known Issue: Signal Handler on 0xFFFFFFF9.
To confirm the problem, a colleague generated a similar project on another computer and received the same situation.
Running the example, however, did not cause such situations. However, generating a new project based on the *ioc file from the example again caused the above-mentioned problem.

It turned out that the following line of code was missing in the "system_stm32g4xx.c" file in the SystemInit() function:

Tested on HAL library version 1.4.0 - 1.5.1
STM32CubeIDE 1.12.1

If the issue is known, sorry for spamming.

Pavel A.
Evangelist III


This seems to be a bug in the template system_stm32g4xx.c : missed `#else` after `#if defined(USER_VECT_TAB_ADDRESS)`

As alternative, Cube should define USER_VECT_TAB_ADDRESS in the project settings (and it must match the target address).


This is a deliberate design choice by ST. Unfortunately, they don't consider this a bug.

The solution is to #define USER_VECT_TAB_ADDRESS in your system_*.c file. By default it is commented out.



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

Maybe. Then the bug should be reported against the CubeMX/IDE generator not creating a viable project from the template.