ESP8266 erase Flash mode config?

We can choose erase flash method like below,


How to config it in platformio.ini?
thank you.

Open PlatformIO IDE Terminal and type pio run --target erase

3 Likes

i get ** Do not know how to make File target `erase’
any ideas how to fix this?

It looks like you use outdated ESP8266 dev-platform. Please open PIO Home > Platforms > Updates and update all packages. Otherwise, you can open PIO IDE Terminal and type pio update.

1 Like

Is there actually a way to just erase some parts of the flash?
e.g. filesystem (littlefs), eeprom…

You can use tool-esptoolpy package and call esptool.py directly. See docs for erase*** sub-commands Basic Commands - ESP32 - — esptool.py latest documentation

How to call esptool.py using PlatformIO?

  1. Please ensure that you use the latest PlatformIO Core 6.0 (has not been released yet, please upgrade to the dev version using pio upgrade --dev command)
  2. Execute esptool.py:
pio pkg exec -p tool-esptoolpy -- esptool.py --help

Docs for pio exec command.

1 Like