# erasing lpc2292 flash problem

**URL:** <https://community.sparkfun.com/t/erasing-lpc2292-flash-problem/2928>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [October 17, 2006, 7:11am UTC](https://community.sparkfun.com/t/erasing-lpc2292-flash-problem/2928 "2006-10-17T07:11:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![volunteer](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@volunteer](https://community.sparkfun.com/u/volunteer)\
**Post date:** [October 17, 2006, 7:11am UTC](https://community.sparkfun.com/t/erasing-lpc2292-flash-problem/2928/1 "2006-10-17T07:11:42Z")

</div>

Hi,

I used OpenOCD to program the LPC2292 internal flash. And I met a problem. I used the command flash info 0 to get the information about the flash, and it listed 18 sectors, from sector 0 to sector 17, which is exactly the same as the datasheet. However, when I tried to erase all the sectors with command flash erase 0 0 17, it always said:" invalid sector number." Then I changed to flash erase 0 0 16, and it was correct. What’s problem?

And I studied the source code(Re98), which I am using, in which it sets the sector number to be 18. Therefore it seems there’s no mistake with the source code.

Here’s my flash configuration.

flash bank lpc2000 0x0 0x40000 0 0 lpc2000\_v1 0 11059 calc\_checksum

Regards,

Kevin

---

<div class="post-metadata">

**Author:** ![Dominic](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dominic](https://community.sparkfun.com/u/Dominic)\
**Post date:** [October 17, 2006, 7:32am UTC](https://community.sparkfun.com/t/erasing-lpc2292-flash-problem/2928/2 "2006-10-17T07:32:47Z")

</div>

The last sector is protected, because it contains the bootloader. You can’t erase that sector, nor can you program it, using the normal IAP routines, which OpenOCD uses, too.

Regards,

Dominic

---

<div class="post-metadata">

**Author:** ![volunteer](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@volunteer](https://community.sparkfun.com/u/volunteer)\
**Post date:** [October 17, 2006, 7:55am UTC](https://community.sparkfun.com/t/erasing-lpc2292-flash-problem/2928/3 "2006-10-17T07:55:14Z")

</div>

Thank you!

Regards,

Kevin
