File System erased when upload hex

Hello. Im developing in platformio for a while right now. My current apllication is about wifi server. Everithing works great. But… I seems that everytime i upload my elf file with upload option, my wifi web page files in spiff partition are also erased. There are some whay to configure upload options so platformio dont erases all the flash or at least avoid to erase spiffs partition when upload my program to esp32?

That should not be happening. In a standard ESP32 project, when using “Upload” it only flashes the specific address ranges it needs to overwrite. That is: The bootloader, the partition table, the second stage bootloader and the firmware.

> pio run -t upload -v
"C:\Program Files\Python311\python.exe" "C:\Users\Max\.platformio\packages\tool-esptoolpy@src-dc58dc5b29d0330f1a2c51773f63e2a2\" --chip esp32 --port "COM15" --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 C:\Users\Max\temp\esp_max\.pio\build\nodemcu-32s\bootloader.bin 0x8000 C:\Users\Max\temp\esp_max\.pio\build\nodemcu-32s\partitions.bin 0xe000 C:\Users\Max\.platformio\packages\framework-arduinoespressif32@src-2f6a65b8b8b893b0bd8090b1a75c9fe2\tools\partitions\boot_app0.bin 0x10000 .pio\build\nodemcu-32s\firmware.bin

There is no -e or --erase-all in that command which would prompt the flash contents from being overwritten.

If you don’t use crazy extra_scripts orupload_flags to modify this, it should not erase SPIFFS. Since you say it does, it’s a potential for a bug. Please file one at with the most minimal project and procedure that reproduces the problem.

My code is mostly similar to internet examples of AsyncServer wifi server page from internet. That is my platform.ini file

platform = espressif32

board = esp-wrover-kit

framework = arduino

monitor_filters = default, time, log2file

monitor_speed = 115200

build_flags = -Os

build_unflags = -O2cntp

board_build.filesystem = littlefs

I test both spiffs and littlefs
At some point i test to use a custom partition table with .csv file, due to unrelated issue, but i left because it don’t fulfill my expected targets, i don’t use anymore these csv indication in the ini file, so i don’t believe there are related to these, i just mention to supply all the information possible.

looks like this gay in reddit has a similar issue: