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:
  /* 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:

The linker map file is attached.

Any help would be appreciated.
Thank you

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