cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE 1.7, MCU package L4 Series 1.17 : VTOR is not initialized

MFred.2
Associate III

In file generated by CubeMx when creating a new project, the SystemInit function does not set the register of the interrupt vector table (SCB-> VTOR) !!!

The default value is zero, which causes a crash on the first interrupt trigger, i.e. the code loops to an address 0x1FFFxxxx (system memory)

  1. freshly generated code

/**

 * @brief Setup the microcontroller system.

 * @retval None

 */

void SystemInit(void)

{

#if defined(USER_VECT_TAB_ADDRESS)

 /* Configure the Vector Table location -------------------------------------*/

 SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET;

#endif

 /* FPU settings ------------------------------------------------------------*/

#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)

 SCB->CPACR |= ((3UL << 20U)|(3UL << 22U)); /* set CP10 and CP11 Full Access */

#endif

 /* Reset the RCC clock configuration to the default reset state ------------*/

...

code of the previous version of the package

/**

 * @brief Setup the microcontroller system.

 * @param None

 * @retval None

 */

void SystemInit(void)

{

 /* FPU settings ------------------------------------------------------------*/

 #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)

   SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */

 #endif

 /* Reset the RCC clock configuration to the default reset state ------------*/

 /* Set MSION bit */

 RCC->CR |= RCC_CR_MSION;

 /* Reset CFGR register */

 RCC->CFGR = 0x00000000U;

 /* Reset HSEON, CSSON , HSION, and PLLON bits */

 RCC->CR &= 0xEAF6FFFFU;

 /* Reset PLLCFGR register */

 RCC->PLLCFGR = 0x00001000U;

 /* Reset HSEBYP bit */

 RCC->CR &= 0xFFFBFFFFU;

 /* Disable all interrupts */

 RCC->CIER = 0x00000000U;

 /* 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

}

why this register is no longer set with the default flash memory address ?

Thanks for your help

12 REPLIES 12

Hello Imen.D,

I think “There is a change request which is deployed on all STM32 series:” is not true for STM32U5xx(STM32U585 to be precise) series. Neither USER_VECT_TAB_ADDRESS nor VECT_TAB_BASE_ADDRESS is defined in the package.

 

Below is the setup details:

  1. Device is STM32U585.
  2. ST provided BL is being used in the project.
  3. This Project is TFM enabled.
  4. Application is using threadX in non-secure zone.
  5. There is no debugging possible with BL code(as of now in this setup, I tried but not able to put breakpoints in Appli Secure/Non secure code but application is crashing.

 

My problem seems as same as below screenshot and link.

https://community.st.com/t5/stm32-mcus-products/systick-handler-void-not-getting-called-with-stm32l431cbt6/td-p/615661

Nitin_0-1705815917188.png

 

I have spent enough time on this and now got completely blank. Looking out for immediate support from #ST #STM32U5 #SysTick

 

As I am relatively new to the bootloaders, any help will be much appreciated.

 

 

Also, I have 5 system_stm32u5xx.c files in my project. Which are for Secure Appli, Non secure Appli, Secure loader, Non secure loader and SBSFU projects. And I am not sure which file I should work on, I believ it is either Secure Appli or Non secure Appli.

OSpil.1
Associate II

Same on STM32L051. Weird change which makes vanilla CubeMX projects not working.
Spent few hours until found this thread.

Hello,

on STM32F723 i noted that VTOR has an hw default value different than FLASH_BASE.

SysTick interrupt works.

If I Uncomment then the VTOR has value FLASH_BASE

SysTick interrupt also works 

I am confused.

Can you point me on a complete doc about VTOR ?

The PM0253 tell me that VTOR value at reset is Unknown (Table 50).  Does exist another documentation for VTOR reset value?

Thank you 

Marco