I have an application where I must save chunks of data to flash memory. The flash memory used: https://datasheet.datasheetarchive.com/originals/dk/DKDS-24/460477.pdf
In the datasheet, it is mentioned that I cannot write to the page that has already been written ( even if it is half empty). I would like some advice regarding what is the best way to manage the writes to the memory?
My questions:
The only other way I can think of is to simply write 1 chunk of data per page which sounds like a complete waste of memory. But considering that I have 16384 pages available, saving 16384 chunks of data might be more than enough for my application.
PAGE
[CHUNK1] 13 [CHUNK2] 13 [CHUNK3] ........
END OF PAGE
Appreciate all the help.
According to chapter 8.2.13 you can write to previously unwritten bytes. So you don't read the target page to be able to write few bytes. Just use the correct address and write the chunk.
If you have a fixed size of chunks, you don't need a separator, specifically if the contents of each chunk is binary. ASCII separators are solutions for stream-like data. This will give you 10 chunks per page.
Just in case that you want to use all space, you can write a function that knows how to split a chunk to write it in two adjacent pages. Think of some kind of HAL, hardware abstraction layer.