2025-09-08 5:11 PM
I am using custom board with STM32G030F6P6. Used Cube Mx to generate code with LL library. Interrupts not working, I need to add this SCB->VTOR = FLASH_BASE; in main.c
Even after this also ADC DMA interrupt wont work. Need to rewrite the ADC_Init() to get it work.
Just keeping you informed. Same thing happened with STM32G030C8T6 also
2025-09-08 6:40 PM
This is strange. VTOR normally is not initialized in any generated code, either HAL or LL. It should be initialized in the function SystemInit, in system_stm32xxxx.c.
2025-09-08 9:14 PM
the below code is latest generated by CubeMX for STM32G030F6P6. 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 */
this is in HAL code generated by Cube MX for STM32G070RBT6. Three years ago
/**
* @brief Setup the microcontroller system.
* @PAram None
* @retval None
*/
void SystemInit(void)
{
/* Configure the Vector Table location add offset address ------------------*/
#ifdef VECT_TAB_SRAM
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#else
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
#endif
}
I never knew about, we need to define it.