Reading the first flash sector in bootloader mode

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

Reading the first flash sector in bootloader mode

436 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amrbekhit on Mon Dec 22 09:26:23 MST 2014
Hello all,

In bootloader mode (specifically, I'm using the CAN bootloader on an LPC11C14), the first 512 bytes of the boot block are mapped to address 0, according to the datasheet. When using the bootloader commands to read the memory starting from address 0, you get the remapped bootblock data and not the actual data in flash. How would you go about using the bootloader read commands to actually read the flash data in sector 0?

Amr
Labels (1)
0 Kudos
1 Reply

383 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DF9DQ on Thu Jan 15 00:23:33 MST 2015
Hi Amr,

You need to find a way to set the device to user flash mode. Since you can't write directly to a peripheral register via the loader, you could try and download a piece of code, and then execute it to do the actual change in the register.

I'm a CAN illiterate, so can't try it myself...  but my suggestion is to download the following 12 bytes into the SRAM (@ 0x10000000 with "Write to RAM"), and then execute it in thumb mode (with "Go"):
0x01 0x48 0x02 0x21 0x01 0x60 0x70 0x47 0x00 0x80 0x04 0x40


The code sets SYSMEMREMAP=0x02, and hopefully returns to allow sending further commands...

Rolf
0 Kudos