How to selectively choose flash erase range during debug

Comments

2 comments

  • Avatar
    Jon Elliott

    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.

    0
    Comment actions Permalink
  • Avatar
    Matt

    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

    0
    Comment actions Permalink

Please sign in to leave a comment.