Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: SV: [lpc2000] Flash Programming Question

2004-06-16 by Karl Olsen

--- In lpc2000@yahoogroups.com, "Lasse Madsen" <lm@h...> wrote:

> Is it possible to write in flash during regular operation ???
> 
> I thourgh it was only possible to write in flash with the 
bootloader, and
> have cursed many times that the LPC2106 didnt have an eeprom for 
storing
> memory variables but I guess these where false assumptions !?!?

You can write to flash from application, see the Flash IAP section in 
the manual.  Caveats are:

When the IAP functions for erasing or writing flash run, the flash 
itself isn't accessible.  This means that you must either disable all 
interrupts around the IAP calls, or copy the interrupt handlers and 
vectors to RAM.

Also remember that the IAP functions use the 32 top bytes of RAM, in 
addition to some stack space.  So don't initialize stack pointers to 
the very top of RAM.

If you use gcc, be sure to compile either as Thumb, or with 
interworking support, so that it uses BX to call the IAP entry at 
0x7FFFFFF1.  If not, gcc will use a MOV PC instruction which doesn't 
switch from ARM to Thumb mode.

Karl Olsen

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.