LPC17xx Secondary bootloader

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC17xx Secondary bootloader

732 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sapana.hanchate on Fri May 10 22:43:36 MST 2013
Hi

I am developing secondary bootloader for LPC1788. I have followed application notes AN10866. I have used LPCXpresso to compile code instead of keil uvision. For boot jump I have added new .s file which is as follows

.global boot_jump

.section text
.syntax unified

boot_jump:
ldr sp, [r0]
ldr pc, [r0, #4]


Bootloader is working fine. I can update firmware.bin in windows.
Issue is when I call function execute_user_code(), processor calls HardFaultISR() in application and code stucks.

I have divided flash as described in document. Also I have divided RAM for bootloader and user application as below

In application
MEMORY
{
  /* Define each memory region */
  MFlash512 (rx) : ORIGIN = 0x0004000, LENGTH = 0x0007C000 /* 512k - 16k */
  RamLoc64 (rwx) : ORIGIN = 0x10001000, LENGTH = 0x0F000 /* 64k - 4k */
  RamPeriph32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32k */

}
  /* Define a symbol for the top of each memory region */
  __top_MFlash512 = 0x00002000 + 0x0007E000;
  __top_RamLoc64 = 0x10001000 + 0x0F000;
  __top_RamPeriph32 = 0x20000000 + 0x8000;


In bootloader
MEMORY
{
  /* Define each memory region */
  MFlash512 (rx) : ORIGIN = 0x0, LENGTH = 0x04000 /* 16k */
  RamLoc64 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x1000 /* 4k */
  RamPeriph32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32k */

}
  /* Define a symbol for the top of each memory region */
  __top_MFlash512 = 0x0 + 0x04000;
  __top_RamLoc64 = 0x10000000 + 0x1000;
  __top_RamPeriph32 = 0x20000000 + 0x8000;


Can somebody help me to figure out why processor throwing hardfault interrupt.

Thanks in advance.

Sapana
0 Kudos
Reply
0 Replies