Wow, that was easy.
I totally overlooked the obvious that the flash is initialized with 0xffs. (I for some reason thought it was undefined.) Took your advice and allocated a space in flash (0x2000) to be an initialized word and just read and rewrote that with an "initialed" value if it hadn't been initialized... and obviously did my parament initialization if it wasn't already initialized the first time.
Thanks for the advice!
I'd put a 'dummy' variable in flash. Once things are initialized, 'zero' the dummy variable by just writting a 00h pattern over it. Once that happens, the only way to 'unzero' it would be to reprogram the part.
If you're talking about something that could move... Put a BLOCK of addresses, with each pointer being valid for a possible block. Then you can have a loader just drop data into locations. If it has to 'move', then zero the pointer. If your program has to 'find' the blocks, just have it start a walk and ignore 00 entries.
Depending on complexity, you might be able to just put 'no data' as FF, Data as a value (with a known value structure) and 00 as 'voided data', then have your program walk till it finds valid data.
One caveat is to make sure you don't put a data type that could possibly have a 00 value as the head of the block. If that can happen, then you'll have to make sure you add at least one byte to your structure that can be FF (no data), 00 (erased data), any other value (data block follows).
Message Edited by mke_et on 03-02-200603:03 PM