If you are asking a question, please follow this template:
My goal is: don’t wants tp erase previous data while uploading new code
My actions are: I store the data in esp32 flash memory but when I manually upload new code via USB Cable then the previous data is erase but if we are giving OTA then flash memory does not erase the data.is there any method to which doesn’t erase the flash memory while uploading the code via USB.
The result I see is: when I upload new code via USB then data of flash memory will store as it is.
My expectation & question is: is there any partition systems which store the previous data in flash.
When flashing a new firmware the expected behavior is to write the application and the filesystem in the first slot.
When doing OTA update, the new firmware (application and filesystem) is written in the available slot and upon boot the files from the previous filesystem are copied over in the new filesystem.
If you need to preserve some files after flashing a new version, you can create an extra filesystem and save the data there.
- ["fstab.fs0.create", true] # use this line only when first flashing the firmware
#- ["fstab.fs0.created", true] # use this line after the first flash of the firmware