PlatformIO Community

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


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.


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 directly. See docs for erase*** sub-commands Basic Commands - ESP32 - — latest documentation

How to call 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
pio pkg exec -p tool-esptoolpy -- --help

Docs for pio exec command.

1 Like