AnsweredAssumed Answered

How to jump from one application to another?

Question asked by gearhead1107 on Oct 10, 2017
Latest reply on Oct 11, 2017 by gearhead1107

Hey folks, I'm trying to jump from a boot-loader into an application. So far (with the help of folks on here) I've:

void run_program(void)
{
uint32_t runProgramAddress;


// Manual Entry Point
runProgramAddress = 0x00020000;
runProgram = (void (*) (void))runProgramAddress;
runProgram();
}

0x20000 is the location of the program that works when flashed independently. I've also tried using the address 0x20410 to go into the .text section, and 0x20454 to go to .text.main section (according to the corresponding .map file)

 

In all the above cases, the program seems to hang and it gets caught at WDOG_EWM_IRQ_Handler() at 0x450. Is there anything I need to do prior to making the jump, or any special assembly commands I should be using?

 

Thanks!

 

10/11/17 Update:

I've also tried re-writing the jump function as the following:

typedef int(*FuncPtr)();
FuncPtr Fseg_Main = (FuncPtr) BOOTLOADER_ADDRESS;
Fseg_Main();

and dabbled with some _asm commands to manually set the SP to the new address and the PC to the address incremented by 4, but still no luck. In another ARM example, the SCB Vector Table Offset Register had to be modified before the jump - going to look into modifying it. 

Outcomes