Flash ESP32-S2 with ESPHome

If you need to use arduino framework instead of ESP-idf you need to add specific board type for the firmware to compile.

  board: lolin_s2_mini
  variant: ESP32S2
    type: arduino
    version: 2.0.3
    platform_version: 5.0.0

Then you should be able to use it with the web flasher. If not working try erasing flash first, and NOT rebooting the unit after. It's also important to drive Pin 0 low for programming, there's a dedicated button for that.

pip install --upgrade esptool
esptool.py --chip esp32-s2  --port /dev/cu.usbmodem01 erase_flash

Hope it will save you a bit of frustration, took me way too long to figure out !