How to selectively choose flash erase range during debug
Hi all,
We're using Crossworks for ARM and an LPC1343 device (32k flash, 8 k ram). We use the upper 512 bytes of flash (starting at 0x7E00) to store configuration data. However, if we choose "build and debug" the application from a fresh power on, it looks like the download process erases the entire set of flash memory.
Looking for suggestions...what is the best way to configure (in a project specific manner) the tool such that during a download everything from 0x7E00 and below is erased, but leave the upper 512 bytes untouched to preserve the saved configuration?
Thanks!
-
As long as the "Erase All" target property is set to "No" (the default), CrossWorks should only erase the sectors containing the program being downloaded - all other sectors should remain untouched.
Looking at the LPC13xx datasheet, the sector size for this region of FLASH is 4KB, so if you re-program any of the memory region 0x00007000-0x00007FFF, this whole sector will need to be erased.
As you are using a part with a decent amount of RAM, you may be able to achieve what you want my modifying the loader project so that it reads the area of FLASH you want to preserve on start up and writes it back when the download is complete.
-
Thanks Jon, I'll take a look at implementing your fix. I'm used to an MSP430 compiler using IAR, where I believe they do what you indicate already, so I was taking it for granted :). I actually only have 2.8k free, so while the erase all was set to No, I am indeed bumping into that last sector so it was wiping it.
Thanks,
Matt
Please sign in to leave a comment.
Comments
2 comments