__asm void boot_jump( uint32_t address )
{
LDR SP, [R0] ;Load new stack pointer address
LDR PC, [R0, #4] ;Load new program counter address
}
/**
* @brief Jump to second program
*
* @param address
*/
void jumpToProgram (uint32_t address)
{
SCB->VTOR = address & 0x3FFFFF80;
boot_jump(address);
}
//some code here
...
// jumping to second program from bootloader
else if(memcmp("jump\r", str, strlen("jump\r")) ==0 )
{
vTaskEndScheduler();
jumpToProgram(0x10000);
}
...
|