Hey All,
I'm looking at implementing a boot loader in to project. The communication interfaces that i will be using are RS-485 and Ethernet. The specific MCU i'm using is a LPC1788 from NXP. I have looked around forums to find a boot loader that i could use but i have had no luck. If someone could give me example code or point me in the write direction for implementing it this would be much appreciated.
Matt
This application note explains what you have to do:
www.nxp.com/.../AN10866.pdf
Basically the last things your bootloader does is: - Disable _all_ interrupts - Load the SP-register according to your firmware to boot - Load the PC-register according to your firmware to boot
The last two steps can be coded as follows:
static __asm void BootJump(UInt32 firmwareStartAddress) { LDR SP, [R0] ;Load new stack pointer address LDR PC, [R0, #4] ;Load new program counter address }
After that, your firmware is executed. Make sure to relocate your interrupt vector table as a first step in your firmware before enabling any interrupts! You can do that using CMSIS-function NVIC_SetVectorTable. You can use the linker-symbol __Vectors to get the interrupt vector table base address to calculate the offset that you have to provide to NVIC_SetVectorTable automatically.
HTH!