Other software tools
- NodeMCU PyFlasher – easy to use GUI flasher based on esptool.py. (Windows or Mac)
- Esptool.py – the official flashing tool from Espressif. (Requires Python)
- Esptool executable – Esptool in executable form, no Python required. (Windows, Linux or Mac)
Serial-to-USB adapter with 3.3V supply
The power supplied to the device is one of the most important elements for both flashing the device and for stable operation. You must ensure that the device receives sufficient power (current AND appropriate voltage level) to properly flash the firmware on the device.
- CH340G is a reliable and very cheap adapter (example 1, 2).
- FTDI FT232 – these adapters have a lot of fakes in the market so buy only from reliable sources (example). Buy only the variant with a separate 3.3V regulator on PCB!
- CP2102 or PL2303 – works with certain devices, but using an external 3.3V supply might be necessary. Not recommended for beginners!
- RaspberryPi – only for advanced users. External 3.3V supply necessary.
- NodeMCU and D1 mini (Pro/Lite) boards have a micro USB upload port and don’t require an adapter.
Don’t forget to install drivers for your serial-to-USB adapter.
Some adapters can be switched between 3.3V and 5V for the data pins, but still provide 5V on the power pin which will fry your device. You MUST make sure both the data and VCC pins are set for 3.3V.
BACKUP STOCK FIRMWARE
You will need a working copy of esptool.py. You might already have it with you IDE of choice, make sure you locate it and it’s up to date.
The examples below assume you have esptool.py somewhere in the path, otherwise specify the full path to the tool.
Serial port device
When –port argument is not specified, esptool.py will enumerate all connected serial ports and try each one until it finds an Espressif device connected (source)
For Linux / macOS, use full device path (/dev/ttyUSB*, /dev/cu.* or /dev/tty.*). If you are using Windows, mode utility will display all available serial devices (COM*)
To backup the image you will need to boot your board in flash mode. The procedure is exactly the same as when you are getting ready to flash a new image and it will depend on your device. Check the supported hardware page for instructions. After each command esptool will reset the device.
Flash size can be determined by running flash_id command. Example output with ESP12E board:
$ esptool.py flash_id esptool.py v2.7-dev Serial port /dev/ttyUSB0 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi MAC: xx:xx:xx:xx:xx:xx Uploading stub... Running stub... Stub running... Manufacturer: 20 Device: 4016 Detected flash size: 1MB Hard resetting via RTS pin...
To perform full backup you will need to specify starting address as 0 and size as flash size in bytes (either hex or decimal):
$ esptool.py read_flash --help usage: esptool read_flash ... address size filename positional arguments: address Start address size Size of region to dump filename Name of binary dump $ esptool.py --port /dev/ttyUSB0 read_flash 0x00000 0x400000 d1-mini.bin
For 1MB board:
$ esptool.py --port /dev/ttyUSB0 read_flash 0x00000 0x100000 esp-1MB-backup.bin
To restore the image, you only need to specify the starting address:
$ esptool.py --port /dev/ttyUSB0 write_flash 0x00000 d1-mini.bin
To completely erase the flash before you Flash EvAk firmware:
esptool.py --port /dev/ttyUSB0 erase_flash
HOW TO FLASH YOUR ESP8266 CHIP WITH EVAK FIRMWARE
Before you start take a backup of your original firmware. We are not responsible if you damage your hardware or device becomes unusable.
2-Erase stock firmware of your device example:
$ esptool.py --port /dev/ttyUSB0 erase_flash
3-Upload EvAk firmware to your device example:
$ esptool.py --port /dev/ttyUSB0 write_flash 0x00000 broker.bin