2023-09-21 01:40 PM
Hello,
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:
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET;
Tested on HAL library version 1.4.0 - 1.5.1
STM32CubeIDE 1.12.1
If the issue is known, sorry for spamming.
2023-09-21 01:50 PM - edited 2023-09-21 01:56 PM
#bugreport
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).
2023-09-21 02:31 PM
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.
See:
2023-09-22 11:17 AM - edited 2023-09-22 11:18 AM
Maybe. Then the bug should be reported against the CubeMX/IDE generator not creating a viable project from the template.