lpcware

SECONDARY BOOT LOADER AND USER APPLICATION BY LPC1768

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by dariush_abbasi868 on Wed Dec 24 05:15:56 MST 2014
Hi , everybody

I have seen usb boot loader example .
but I have to make my project in another way !

I have a boot loader that started normally and at the start up check a flge for new update from external data flash.

if it is not set( not any new update ) goes to application  .
Application should be in an special address ( 0xa000 for example) .
so I can go to this address by :
void boot_jump(WORD address)
{
    asm("LDR SP,[R0]"); //Load new stack pointer address
    asm("LDR PC,[R0,#4]");//Load new program counter address
}
//************************************
void execute_user_code(void)
{
   SCB->VTOR = USER_FLASH_START & 0x1FFFFF80;
    boot_jump(USER_FLASH_START);
}

but my problem perhaps is how I can make a boot loader that I put it in 0xa000 and so jump to that it work ?
actually I use IAR compiler.

Outcomes