Content originally posted in LPCWare by Almaz on Fri Sep 21 03:31:03 MST 2012
I learned how to jump out of the "bootloader" in the "application", if "application" does not use interrupts:
/****************************************************************/
#include "LPC11xx.h"
#include "core_cm0.h"
#include "system_LPC11xx.h"
__ASM void __jump_( )
{
ldr r0, =0x1000
ldr r0, [r0]
mov sp, r0
ldr r0, =0x1004
ldr r0, [r0]
mov pc, r0
}
int main(void)
{
SystemInit();
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6);
__jump_( );
while(1);
}
/********************************************************************/
But when i try to copy all interrupt vectors table:
/********************************************************************/
#include "LPC11xx.h"
#include "core_cm0.h"
#include "system_LPC11xx.h"
__ASM void __jump_( )
{
ldr r0, =0x1000
ldr r0, [r0]
mov sp, r0
ldr r0, =0x1004
ldr r0, [r0]
mov pc, r0
ldr r0, =0x1008
ldr r0, [r0]
ldr r1, =0x0008
mov [r1], r0
ldr r0, =0x100C
ldr r0, [r0]
ldr r1, =0x000C
ldr r1, [r1]
mov pc, r1
......................
//exactly the same set of commands
......................
ldr r0, =0x10BC
ldr r0, [r0]
ldr r1, =0x00BC
ldr r1, [r1]
mov pc, r1
}
int main(void)
{
SystemInit();
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6);
__jump_( );
while(1);
}
Is not work.
The set of commands:
ldr r0, =0x10BC
ldr r0, [r0]
ldr r1, =0x00BC
ldr r1, [r1]
mov pc, r1
Don't work. Where I was wrong?