lpcware

LPC1277 link at flash offset 0x2000 to hex file

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by kiryat8 on Thu Jan 01 07:43:24 MST 2015
I am trying to link my code to at absolute position that my secondary bootloader expects - 0x2000 in the flash.
I have done this many times with the LPC1768 by just changing the xxx_mem.ld file's flash origin as shown below.
I then take the bin file and use it for OTAP and direct USB loading.
In my LPC1277 project I wanted to use Flash Magic to flash the secondary bootloader with the erase all flash option and then flash my program hex code without any erase options.
Flash Magic complains that I am overwriting code with the program hex file.
From what I can see the hex file does not start at 0x2000 as I would expect.
What am I doing wrong?

xx_mem.id file:
MEMORY
{
  /* Define each memory region */
  MFlash128 (rx) : ORIGIN = 0x02000, LENGTH = 0x1E000 /* 128K bytes */
  RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x2000 /* 8K bytes */


}
  /* Define a symbol for the top of each memory region */
  __top_MFlash128 = 0x0 + 0x20000;
  __top_RamLoc8 = 0x10000000 + 0x2000;

Post build steps:
arm-none-eabi-size ${BuildArtifactFileName}
arm-none-eabi-objcopy -O binary ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.bin
checksum -p ${TargetChip} -d ${BuildArtifactFileBaseName}.bin
arm-none-eabi-objcopy -I binary -O ihex ${BuildArtifactFileBaseName}.bin ${BuildArtifactFileBaseName}.hex

Start of hex file:
:1000000000200010FF200000D1200000D3200000BD
:100010000000000000000000000000005D7DFFEF18
:10002000000000000000000000000000D5200000DB
:100030000000000000000000D7200000A1360000F2
:10004000DB200000DB200000DB200000DB200000C4
:10005000DB200000DB200000DB200000DB200000B4
:10006000DB200000DB200000DB200000DB200000A4
:100070009D2E0000DB200000DB200000DB200000C4
:10008000DB200000DB200000894700004D48000015
:10009000DB20000071210000DB200000DB200000DD
:1000A00000000000814D0000DB200000DB2000008C
:1000B00000000000DB200000DB200000A86300003F
:1000C000000000100C0000000C0000104C040000A8
:1000D000FEE7FEE7FEE7FEE7FEE7FEE710B50023DA

The linker map file is attached.

Any help would be appreciated.
Thank you

Original Attachment has been moved to: map.txt.zip

Outcomes