2024-05-27 02:20 AM
Hi all,
Version: 1.15.1
MCU : g473
Before investigate deeply on my own I wonder whether if anyone have faced the same problem with Interrupt table in general ...
I placed a breakpoint there :
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}
and surprisingly the code is never executed !
Best regards,
Solved! Go to Solution.
2024-06-07 07:02 AM
Hello @bibah,
Uncommenting the "define USER_VECT_TAB_ADDRESS" allows for the relocation of the vector table, which can be necessary for certain applications (that's why I asked about the bootloader) or when the application needs to be located at a specific address in memory, that's why maybe some details are required on your application...
In previous STM32CubeMX versions, the line #define USER_VECT_TAB_ADDRESS was uncommented by default, which would automatically relocate the vector table, but in later versions, for more flexibility, you have the choice to uncomment it if you need to.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-05-27 06:47 AM
Hello @bibah,
Have you used CubeMX to generate the code? if yes, what's the version?
Also, maybe provide some context, are you using a bootloader, or have remapped the vector table?
The SysTick timer needs to be initialized before it can trigger interrupts, I assume you did that
Maybe verify systick interrupt priority? and ensure that global interrupt is enabled
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-05-27 11:54 PM
Hi Sarra,
STM32CubeMX - STM32 Device Configuration Tool
Version: 6.11.1-RC2
Build: 20240411-0753 (UTC)
No BootLoader and no remapped the Vector Table
Early in the code generated by CubeMX
And finally I found a solution detailed here :
I uncommented /*#define USER_VECT_TAB_ADDRESS*/ in system_stm32g4xx.c so it lay on Flash now
/************************* Miscellaneous Configuration ************************/
/* Note: Following vector table addresses must be defined in line with linker
configuration. */
/*!< Uncomment the following line if you need to relocate the vector table
anywhere in Flash or Sram, else the vector table is kept at the automatic
remap of boot address selected */
#define USER_VECT_TAB_ADDRESS
#if defined(USER_VECT_TAB_ADDRESS)
/*!< Uncomment the following line if you need to relocate your vector Table
in Sram else user remap will be done in Flash. */
/* #define VECT_TAB_SRAM */
#if defined(VECT_TAB_SRAM)
#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#else
#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#endif /* VECT_TAB_SRAM */
#endif /* USER_VECT_TAB_ADDRESS */
/******************************************************************************/
My question :
Is it a normal situation the Vector Table will not be generated by default ?
Best Regards, H
2024-06-07 07:02 AM
Hello @bibah,
Uncommenting the "define USER_VECT_TAB_ADDRESS" allows for the relocation of the vector table, which can be necessary for certain applications (that's why I asked about the bootloader) or when the application needs to be located at a specific address in memory, that's why maybe some details are required on your application...
In previous STM32CubeMX versions, the line #define USER_VECT_TAB_ADDRESS was uncommented by default, which would automatically relocate the vector table, but in later versions, for more flexibility, you have the choice to uncomment it if you need to.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-06-07 07:18 AM
Ok Sarra,
Got it ! Thanks. May be you should include this feature in CubeMX ... no ?
Habib
2024-11-24 06:00 PM
Hi Sarra.S , I have met same problem while my project has a bootloader and a application, the application has correct configured VECT OFFSET , but SysTicK_Handler is not called when jump to application, do you know how to fix this?
2024-11-26 01:06 AM
Hello @lanwailan, welcome to the ST Community!
Could you please ask your question with a detailed description in a separate thread? This will help keep this thread clear and organized. I would be more than happy to support you with your query.
Thank you!
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.