stm32g070cbt6 bootloader; jump to app
Hello everybody,
I am developing a bootloader that is currently writing to flash, but I am not being able to jump to the written blocks.
The bootloader runs from 0x8000000. Built with arduino_stm32.
App starts at 0x8009000.
I can test the app with the linker set to 0x8000000 with no problems seen.
So, the bootloader runs, loads the app binary to 0x8009000 and I am not able to jump to it properly.
I think I have done what other developers did in most forum posts.
Added the jump function I am using. After the Jump() call, the PC stops and I can not step the code in asm.
void BootJump(uint32_t *Address) {
uint32_t JumpAddress = 0x08009004;
pFunction Jump = (pFunction)JumpAddress;
HAL_RCC_DeInit();
HAL_DeInit();
/* 5. Disable SysTick and clear its exception pending bit, if it is used in the bootloader, e. g. by the RTX. */
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
/*8. Load the vector table address of the user application into SCB->VTOR register.
Make sure the address meets the alignment requirements of the register. */
SCB->VTOR = (uint32_t)Address;
/* 9. Set the MSP to the value found in the user application vector table. */
__set_MSP(*(__IO uint32_t*)0x08009000);
/* 10. Set the PC to the reset vector value of the user application via a function call. */
Jump();
}
Bootloader linker:
Thanks for any tips!
