EmbeddedRelated.com
Forums
Memfault Beyond the Launch

IAP Flash Erase/Write Sector 0

Started by davidxytac July 12, 2010
Hi,

IAP commands for erasing and writting Internal Flash failed. I found the first 62 ( about ) of the sector 0 can not be erased, which leads to the failure of writting. Does anyone know why the first 62 bytes are protected. And how to disable the protection for erasing and writting?

Thank you,
david

An Engineer's Guide to the LPC2100 Series

--- In l..., "davidxytac" wrote:
2010 Jul 12
>
> Hi,
>
> IAP commands for erasing and writting Internal Flash failed. I found the first 62 ( about ) of the sector 0 can not be erased, which leads to the failure of writting. Does anyone know why the first 62 bytes are protected. And how to disable the protection for erasing and writting?
>
> Thank you,
> david
>

The solution was found, and, some time later, one of us (David & I) had a spare, split, millisecond; so we'll share the solution for the next folks writing a self loading secondary bootloader :

Problem = cannot program bottom 64 bytes of internal Flash reliably w/ IAP (or maybe ISP).
Cause = The first 64 bytes of the LPC-23xx internal flash are remapped, depending on the MEMMAP register. The (ISP and the) IAP impact the mode of that register.

See:
LPC23XX User manual Rev. 03 2009 August 25
Chapter 2: LPC23XX memory addressing
Section 5.1 Memory Mapping Control Register (MEMMAP - 0xE01F C040) pg 27 of 707

See also some discussions regarding Internal Flash (IAP & ISP), including:
Chapter 29: LPC23XX Flash memory programming firmware
Section 3.1 Memory map after any reset

Chapter 29: LPC23XX Flash memory programming firmware
8.7 Compare
Table 553. IAP Compare command

Thanks,
- Laser Plumb Bob
***********


Memfault Beyond the Launch