I read the postings under the the "Flash fails to write..." topic, but have problems following along and/or reproducing it. My Goal: to log single variables into flash occasionally, with minimum loss of overhead (unused Flash space). Typically two 32bit values get stored at the time, the first is an ID for the variable, the second is the current value of that variable. When the current value of a variable with a certain ID is needed, a backward search is started from the end of the Flash sector downwards - if ID is found, the value behind it is the last written value of that variable. Summary of thread so far and new questions from me: 1.) As stated in this thread, minimum write segment size on LPC is 512 bytes (per datasheet), so if just a few bytes are stored, a big overhead occurs. 2.) First suggested work-a-round was to read a 512-byte segment, add the new variables and write it back. I assume as long as the only bit changes made are erasing bits, such a re-write can be performed without a previous sector erase. Correct? 3.) "Someone" came up with a 16byte boundary I tried using a 16byte size instead of 512 when calling the IAP routines, that results in a "COUNT_ERROR" reported back. Contents of Flash did not change. So how and where can I use this 16byte write? Or does this only apply together with 2.)? In other words: a) read 512 bytes segment b) pick a block of 16 bytes all set to FF c) change data in block d) write segment back (without erase) ? TIA, Peter
Message
NOW: IAP, Flash, min seg size WAS: Flash fails to write a bit or zeroes
2004-06-16 by embeddednut
Attachments
- No local attachments were found for this message.