To be fair, 'Erase_flash' does not actually erase the flash, it deletes the entry point to the program. The next time that you upload 'to the flash' it may or may not overwrite anything you stored. In fact, most times the EEPROM is retained. Using SPIFFS may work for you, as long as when you upload a new sketch, you define the same SPIFFS size.