lpcware

EraseSector error when programming LPC1347 with LPCLink2 debugger

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by pdr on Wed Aug 06 22:33:51 MST 2014
I get the below error when trying to program a LPC1347.

...
[color=#f3f]driver "EraseSector" return code: 0x1
Flash Program Summary: 14832 bytes in 0.08 seconds (190.58 KB/sec)
Stopped (Was Reset)  [Reset from Unknown]
Stopped: Breakpoint #1[/color]

It started happening as my compiled code size approached 16k.

I've tested the following scenarios:
1) Comment out a large section of my program, compile to around 12k. 
    Power up board as a ramdisk, copy over as firmware.bin, reboot
    I can now launch the debugger, and download the code as many times as I want.
    Download output looks like:
[color=#f3f]          Writing 11904 bytes to address 0x00000000 in Flash
           Erased/Wrote page  0-2 with 11904 bytes in 1933msec
           Flash Write Done
           Flash Program Summary: 11904 bytes in 1.93 seconds (6.01 KB/sec)
           Stopped (Was Reset)  [Reset from Unknown]
[/color]
2) Leave the code as is, and compile - 16048 bytes.
     Power up the board as ramdisk, copy over as firmware.bin, reboot
     or, if I've previously done step 1, I can download via the debugger.
    The code runs, but I cannot download new code without getting the "EraseSector" error and aborting the download
    The first time, the download output looks like:
[color=#f3f]         Writing 14992 bytes to address 0x00000000 in Flash
          Erased/Wrote page  0-3 with 14992 bytes in 2530msec
          Flash Write Done
          Flash Program Summary: 14992 bytes in 2.53 seconds (5.79 KB/sec)
          Stopped (Was Reset)  [Reset from Unknown]
[/color]   After, the first time, I get the EraseSector error

On the ones that work, it writes pages 0-2, on the one that breaks it, it writes pages 0-3.

Where am I going wrong.  It's a 64k part, do I need to do something differently as the program grows?

Thanks

Outcomes