Question
STM32F103x8 interupt not working after relocate
Posted on November 16, 2016 at 02:56
I have problem after relocating, my interrupt stop working.
A brief explanation about my firmware i) the bootloader (0x08000000) ii) the main application (0x08004000) In my bootloader, I relocate the code as shown below:pFunction jump_to_application;
uint32_t jump_address;
#define APPLICATION_ADDRESS 0x08004000
if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000) == 0x20000000) {
jump_address = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
jump_to_application = (pFunction) jump_address;
_set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
jump_to_application();
}
and in my main app, I offset the vector table as
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x4000);
When i try debug for my bootloader, it is able to relocate to the main app, and the interrupt is working.
But, when I power off and power it on, the bootloader can relocate to the main app, but the interrupt in the main app is not working.
May I know how can I solve this problem?