Skip to main content
FDESS.2
Associate II
January 5, 2022
Solved

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

  • January 5, 2022
  • 3 replies
  • 1107 views

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.
Best answer by Sara BEN HADJ YAHYA

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.

3 replies

TDK
January 5, 2022

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
January 6, 2022

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
January 6, 2022

Thank you, it is all OK,

best regards,

Fabien.