lpcware

Tranferring execution from custom bootloader to system code - LPC1853

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by dodge55 on Sat Mar 21 08:53:19 MST 2015
I have an older project using a LPC2148 that has a custom bootloader and if certain criteria are met, transfers execution to the system code located at a different location.  However, the same syntax isn't working for the LPC1853. 

The bootloader is placed at 1A000000.  The system code is placed at 1A006010.  The bootloader code runs fine until the system code transfer call is executed.

In debug (using Keil), I placed a breakpoint on the transfer call.  The assembly statement is BLX r4.  'r4' holds 0x1A006010, as I would expect.  When the statement is executed, I get a HardFault.

Here are the items of interest for the call.

#define SYSTEMBEGIN  (volatile unsigned char *) 0x1A006010
typedef void (*SYSTEM_APP)(void);

SYSTEM_APP system_app = (SYSTEM_APP)SYSTEMBEGIN;

system_app();

This syntax works perfect for the LPC2148, but not for the LPC1853, unless I'm missing something else.

Any help.

Thanks,

Sutton

Outcomes