Developing a custom bootloader for stm32f407VET. Query on reset behavior.
My bootloader starts from 0x08000000 and my application starts from 0x08004000. After i flash the application through UART I jump to my application using the code below.
HAL_UART_DeInit(uart_handle);
HAL_RCC_DeInit();
HAL_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__disable_irq();
/* execute the new program */
JumpAddress = *((__IO uint32_t*) (APPLICATION_ADDRESS_BANK_1 + 4));
/* Jump to user application */
JumpToApplication = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS_BANK_1);
JumpToApplication();
After i jump to my application the SBC->VTOR is loaded with 0x08004000 in system init and the application runs. All the interrupts are managed through the vector table of my application.
What should be the behavior when a reset occurs while my application is running. Should it go to the reset handler of my application i.e. at ox08004004 or the reset handler of my bootloader (0x080000004)
