How To Jump To Application Program

From Bitcoin Wiki
Revision as of 10:43, 7 January 2016 by Johnson-Fan (talk | contribs) (Created page with "<big><big>When we don't want to updata application program,</big></big> <br /> <big><big>the bootloader program should run to application program.</big></big><br /> <big><big>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

When we don't want to updata application program,
the bootloader program should run to application program.
In order to achieve this goal, we can add under code in your bootloader program.

asm volatile("ldr r0, =0x4000"); //"the 0x4000 is my application program's MSP point, you must change it adapt to your"
asm volatile("ldr r0, [r0]");
asm volatile("mov sp, r0");

asm volatile("ldr r0, =0x4004"); //"the 0x4004 is my application program reset-function entry address, you must change it adapt to your"
asm volatile("ldr r0, [r0]");
asm volatile("mov pc, r0");