I am working on LPC2648(ARM7). Facing the same issue as Alex got. Using reset vector address(Here 0x00030058), able to jump to app(starting address: 0x00030000) from my user defined boot(Starting address: 0x00000000).
But following codes didn't work.
__asm void boot_jump(){
/* Load main stack pointer with application stack pointer initial value,
stored at first location of application area */
ldr r0, =0x30000
ldr r0, [r0]
mov sp, r0
/* Load program counter with application reset vector address, located at
second word of application area. */
ldr r0, = 0x30004
ldr r0, [r0]
mov pc, r0
}
OR
__asm void start_application(unsigned long location)
{
ldr r1, [r0,#0] // get the stack pointer value from the program's reset vector
mov sp, r1 // copy the value to the stack pointer
ldr r0, [r0,#4] // get the program counter value from the program's reset vector
bx r0 // jump to the start address
}
Using keil compiler with which hex file is getting generated. I have used hex to bin converter and opened the generated bin in HxD Hex editor to verify the stack and program counter address as part of the file. But didn't observe the addresses in the file.
What can be wrong and how to correct it?