Skip to main content
FDESS.2
Associate II
Jan 5, 2022 3:23 PM UTC
Solved

STM32G4xxx FW v1.5.0 : blocked in main.c/HAL_init() because IRQ handler not configured by SystemInit()

There is an issue in STM32G4 MCU FW package v1.5.0 in system_stm32g4xx.c ligne 189 :

#if defined(USER_VECT_TAB_ADDRESS)
 SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#endif /* USER_VECT_TAB_ADDRESS */

there is no #else, so SCB->VTOR is not initialised if USER_VECT_TAB_ADDRESS is not defined.

As a result, main.c stay blocked in HAL_Init() when setting systick IRQ, or systick IRQ (and none other IRQ) are called.

To fixe that, code should be replaced by something like that :

#ifdef USER_VECT_TAB_ADDRESS
 SCB->VTOR = USER_VECT_TAB_ADDRESS| VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#else
 SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
#endif

This topic has been closed for replies.
Sara BEN HADJ YAHYA
ST Technical Moderator
Jan 6, 2022 12:19 PM UTC

Hello @FDESS.2​ ,

Thanks for your feedback,

As @TDK​  mentioned the change was intended and deployed on all STM32 series.

For more details please check this thread STM32CubeIDE 1.7, MCU package L4 Series 1.17 : VTOR is not initialized

If you issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.

3 replies

TDK
Jan 5, 2022 3:58 PM UTC

I believe this was previously declared as "intended" in a post by ST. Will reply if I can find it.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Sara BEN HADJ YAHYA
ST Technical Moderator
Jan 6, 2022 12:19 PM UTC

Hello @FDESS.2​ ,

Thanks for your feedback,

As @TDK​  mentioned the change was intended and deployed on all STM32 series.

For more details please check this thread STM32CubeIDE 1.7, MCU package L4 Series 1.17 : VTOR is not initialized

If you issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
FDESS.2
FDESS.2Author
Associate II
Jan 6, 2022 1:01 PM UTC

Thank you, it is all OK,

best regards,

Fabien.