Unfortunately, flashing the newer ESP32 devices is a bit more of a pain than the good ol days of the ESP8266 (RIP ). While trying to flash this device my typical go-to method was to use the recently deprecated esphome-flasher. However, it doesn’t work.
Per the directions in the chart below, you should be in Device Firmware Upgrade (DFU) Mode, but this did not help me.
Ultimately, I was able to flash it via CLI using the trusty esptool.py. I used a modern FW build from ESPHome. The command that worked for me was the following:
esptool.py --port /dev/tty.usbmodem01 write_flash --flash_mode dio --flash_size 4MB 0x0 /path_to_file/esphome-s2-mini-test-factory.bin