Ahmad Edi Saputra
Junior Member level 2
[ASK] jump to specific address in STM32 Cortex-M3
Hi
i am currently using stm32f103C8, i want to build a custom bootloader in address 0x8000000 and my application will placed in 0x8008000.
in cortex M4 (stm32f407vgtx) i manage to jump to address 0x8008000 with these code
but these code seem doesn't work in cortex M3, i tried a few modification. like bellow, it doesn't work either. i am sure my application already in place. i check address 0x8008000 during debug, my binary app was already there, and yes i compile it with address 0x8008000
Best Regards
Edi
Hi
i am currently using stm32f103C8, i want to build a custom bootloader in address 0x8000000 and my application will placed in 0x8008000.
in cortex M4 (stm32f407vgtx) i manage to jump to address 0x8008000 with these code
Code:
if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000){
JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
Jump_To_Application = (pFunction) JumpAddress;
__set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
Jump_To_Application();
}
but these code seem doesn't work in cortex M3, i tried a few modification. like bellow, it doesn't work either. i am sure my application already in place. i check address 0x8008000 during debug, my binary app was already there, and yes i compile it with address 0x8008000
Code:
//JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
//Jump_To_Application = (pFunction) JumpAddress;
stackAddress = *(__IO uint32_t*) APPLICATION_ADDRESS;
SCB->VTOR = APPLICATION_ADDRESS;
__set_MSP(stackAddress);
//Jump_To_Application();
NVIC_SystemReset();
Best Regards
Edi