STM32 Bootloader Vector table relocation problem which is linked with CubeMX version
Hello All,
I need to start the flash program from 0x08020000 origin. I have updated the linker file with that value as you can see at below.
/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x8020000, LENGTH = 128K //previous one was 256K
}Indeed, I have updated the vector table register which is VTOR from system_stm32f4xx.c. You can see the SystemInit function at below.
/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. //0x00
This value must be a multiple of 0x200. */
/******************************************************************************/
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 HSION bit */
RCC->CR |= (uint32_t)0x00000001;
/* Reset CFGR register */
RCC->CFGR = 0x00000000;
/* Reset HSEON, CSSON and PLLON bits */
RCC->CR &= (uint32_t)0xFEF6FFFF;
/* Reset PLLCFGR register */
RCC->PLLCFGR = 0x24003010;
/* Reset HSEBYP bit */
RCC->CR &= (uint32_t)0xFFFBFFFF;
/* Disable all interrupts */
RCC->CIR = 0x00000000;
#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
SystemInit_ExtMemCtl();
#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
/* 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 = 0x08020000UL | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
#endif
}When I configure and compile this project with STM32CubeMX version 5.0.0, everything works fine. However, when I configure and compile this project with STM32CubeMX version 6.1.1, I receive independent watchdog timer reset. What would be the source of problem? It costs my 2-3 days approximately. How can i solve the problem? Thanks in advance.
