Skip to content

Flashing

Gunnar Skjold edited this page Jun 4, 2022 · 12 revisions

In the Release section of this repository, you will find precompiled binaries for ESP8266 and ESP32 boards.

Use esptool.py for flashing. The procedure differs for ESP8266 and ESP32. Substitute the command with appropriate COM port.

ESP8266

esptool.py --chip esp8266 --port <port> --baud 115200 --before default_reset --after hard_reset write_flash 0x0 firmware.bin Substitute <port> with correct COM port your device is connected to. Ex /dev/ttyUSB0 for Linux or COM1 for Windows

ESP32

For ESP32 you will need three files to flash the device, firmware.bin and partitions.bin you get from the Release section of this repository. The third file is the bootloader file that you can get from Arduino ESP32 bootloader. The default bootloader is bootloader_dio_40m.bin

esptool.py --chip esp32 --port <port> --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin

When firmware is already installed and you use esptool to upgrade to a new version, a shorter command can be used to avoid config being overwritten

Substitute <port> with correct COM port your device is connected to. Ex /dev/ttyUSB0 for Linux or COM1 for Windows

esptool.py --port <port> --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x10000 firmware.bin

Erase flash

If the device stops responding or unpredictable behaviour, a flash erase might be needed before flashing. Read more here

esptool.py --port <port> erase_flash

No USB-TTL adapter? How to use Raspberry PI GPIO for flashing

The below wiring is valid for Pow-K, but can be adapted for any board that does not have a USB-TTL adapter

External power header:

  • PI GPIO 2 (5V) to "+"
  • PI GPIO 6 (Ground) to "GND"

FTDI 3v3 header:

  • PI GPIO 9 (GND) to "GND" (J2)
  • PI GPIO 8 (GPIO UART TX) to "tx" (J2)
  • PI GPIO 10 (GPI UART RX) to "rx" (J2)

Put the board in flash mode (hold PROG and click RESET), then use esptool as explained above with port /dev/ttyAAMA0