2010-02-12 08:23 AM
2011-05-17 04:40 AM
Wouldn't this make more sense?
-Clive void app_start(void) { u32 *resetvector = (u32 *)(0x08004004); // 32-bit point void (*runapp)(); printf(''The code start is %08X\n'',*resetvector); irq_disable(); runapp=(void(*)())(*resetvector); runapp(); }2011-05-17 04:40 AM
The sample code looks like this:
JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4); Jump_To_Application = (pFunction) JumpAddress; __set_MSP(*(__IO uint32_t*) ApplicationAddress); Jump_To_Application(); I am not doing this, Very possibly the problem. The only issue will be translating the routine to set_MSP GCC assembly. Any help would be appliciated __ASM void __set_MSP(UINT32 mainStackPointer) { msr msp, r0 bx lr }2011-05-17 04:40 AM
No Need, its in the header. Will let you know if this works...
void __set_MSP(UINT32 topOfMainStack) { __ASM volatile (''MSR msp, %0\n\t'' ''BX lr \n\t'' : : ''r'' (topOfMainStack) ); }2011-05-17 04:40 AM
Its working.
Using the code above. I suspect that it got an exception when I didn't change the stack before jumping. # So many thanks, sorry i can't get you a pint and for anyone else, the solution is in AN2557 sample code.