Yes, I had that same thought. I tried it with my createAddressErase portion at that has been working just fine (well, one strange thing but it may be my fault). The createWearLevelErase portion seems to be having issues, and definitely wasn’t erasing when I called eraseAll.
As a test, I’m writing 10 ‘stories’, each given a page of space (4096 bytes). It’s only using 435 bytes for the test however. I run eraseAll, then read back the first 435 bytes from the first ten pages, and they have been properly erased. I write the ten stories, read them back to make sure the data is sound. Then I power cycle, and read out the data of each of those ten pages.
In the first page I’m seeing the data written to the second page. In the second page, I’m seeing REALLY old data, from numerous eraseAlls ago, from before allocating the entire flash as createAddressErase and running erase all, before going back to two separate flash spaces. From the the third page on, I’m seeing the proper data I wrote, but offset to one page earlier. The final page is the data that I wrote to the first page.
In each set of data I write I include numbers so I can tell which is which, starting with ‘0’, ending with ‘9’. To write and read, I’m starting with an offset of zero, and increasing the offset by a single page size with each loop, reading and printing the first 435 bytes.
So yeah…still something weird. Erase isn’t working for me. To be clear, I’m calling eraseAll() on the flash spaces I allocation. If I should be calling some sort of universal erase I was unaware.