Yahoo Groups archive

Lpc2000

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

Message

Re: [gmane.comp.hardware.arm.lpc2100] Partial (Less than 512 bytes) Flash Programming

2004-08-10 by philips_apps

> Regarding the discussion of writing 16 bytes at a time, is this for 
> the LPC2106 chip or for a different processor?

It is for LPC 2104, 2105, 2106, 2114 2124 2119 2129 2194 2212 2214 
2292 2294 
 
> When calling the IAP routine to write 16 bits on an LPC2106, I get a
> return code of 6, which per the manual is
> 
>     COUNT_ERROR    Byte count is not multiple of 4 or is
>                    not a permitted value.

Minumum write size is 512 bytes.
 
> However, I *can* write 512 bytes at a time successfully.  (Yes, I am
> preparing the sector in both cases.)
> 
> Are there some additional tricks to writing just 16 bytes at a time?
> 
> Perhaps I must copy any partial data from the 512-byte portion, 
> extend with my new 16 bytes, pad out to the end with 0xFF and then 
> write 512 bytes (thus overwriting the beginning with what was 
> already there, then extending with my new data, then leaving the 
> tail as all 0xFF)?

Above mentioned approach will not work. You need to fill all bytes in 
the RAM buffer with 0xFF. Only change the 16 bytes you want to write. 
The modified 16 byte chunk must be aligned at 16 bytes boundary 
within the 512 bytes buffer. The corresponding 16 bytes in the Flash 
must  be 0xFF. If you want to write to a flash location that has 
already  been programmed then you must erase the sector.


> Is there a way to do it by calling the IAP routine with a length of 
> 16 rather than with 512?

No

Philips Apps

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.