Beneath you’ll notice all necessary information to flash a NodeMCU firmware binary to ESP8266 or ESP8285. Note that this is a reference documentation and not a tutorial with fancy screen shots. Turn to the respective tool documentation for those.

Attention

Keep in listen that the ESP8266 needs to be
put into flash mode
before y’all can flash a new firmware!

Important

When switching between NodeMCU versions, see the notes about
Upgrading Firmware.

esptool.py

A Python-based, open source, platform independent, utility to communicate with the ROM bootloader in Espressif ESP8266.

Source:
https://github.com/espressif/esptool

Supported platforms: OS X, Linux, Windows, anything that runs Python

Running esptool.py

Run the following command to flash an
aggregated
binary as is produced for example by the
cloud build service
or the
Docker image.

esptool.py --port <serial-port-of-ESP8266> write_flash -fm <flash-mode> 0x00000 <nodemcu-firmware>.bin


wink-mode

is
qio
for most ESP8266 ESP-01/07 (512 kByte modules) and
dio
for nigh ESP32 and ESP8266 ESP-12 (>=four MByte modules). ESP8285 requires
dout.

Gotchas

  • See
    beneath
    if y’all don’t know or are uncertain about the chapters of the wink chip on your device. It might assist to double check as e.thousand. some ESP-01 modules come with 512kB while others are equipped with 1MB.
  • esptool.py is under heavy development. It’south brash you run the latest version (check with
    esptool.py version). Since this documentation may non have been able to keep up refer to the
    esptool wink modes documentation
    for electric current options and parameters.
  • The firmware epitome file contains default settings
    dio
    for flash style and
    40m
    for flash frequency.
  • In some uncommon cases, the
    SDK init information
    may be invalid and NodeMCU may fail to kicking. The easiest solution is to fully erase the chip before flashing:
    esptool.py --port <series-port-of-ESP8266> erase_flash

NodeMCU PyFlasher

Cocky-independent
NodeMCU
flasher with GUI based on
esptool.py
and
wxPython.

NodeMCU PyFlasher

Source:
https://github.com/marcelstoer/nodemcu-pyflasher

Read:  Surface Pro 3 Type Cover Not Working After Firmware Update

Supported platforms: annihilation that runs Python, runnable
.exe
bachelor for Windows and
.dmg
for macOS

Disclaimer: the availability of
NodeMCU PyFlasher was announced on the NodeMCU Facebook page
only it is not an official offering of the current NodeMCU firmware team.

Putting Device Into Flash Way

To enable ESP8266 firmware flashing GPIO0 pin must exist pulled low before the device is reset. Conversely, for a normal kicking, GPIO0 must be pulled high or floating.

If you have a
NodeMCU dev kit
so you don’t need to do anything, every bit the USB connection can pull GPIO0 low by asserting DTR and reset your board by asserting RTS.

If you have an ESP-01 or other device without congenital-in USB, yous will need to enable flashing yourself by pulling GPIO0 low or pressing a “flash” switch, while powering up or resetting the module.

Which Files To Flash

If you lot build your firmware with the
cloud builder or the Docker image, or whatsoever other method that produces a
combined binary, then you can flash that file directly to accost 0x00000.

Otherwise, if you built your own firmware from source code:

  • bin/0x00000.bin
    to 0x00000
  • bin/0x10000.bin
    to 0x10000

Upgrading Firmware

There are three potential problems that arise from upgrading (or downgrading!) firmware from one NodeMCU version to another:

  • Lua scripts written for i NodeMCU version (like 0.nine.ten) may not work error-free on a more recent firmware. For case, Espressif changed the
    socket:send
    operation to be asynchronous i.e. non-blocking. See
    API documentation
    for details.

  • The NodeMCU flash file system may need to exist reformatted, particularly if its address has changed because the new firmware is different in size from the erstwhile firmware. If it is not automatically formatted then it should be valid and accept the same contents as before the flash operation. Y’all tin nevertheless run

    file.format()

    manually to re-format your flash file system. Yous will know if you demand to do this if your wink files exist but seem empty, or if information cannot be written to new files. However, this should be an exceptional case. Formatting a file organisation on a big flash device (e.yard. the 16MB parts) can accept some time. And then, on the first boot, you shouldn’t get worried if nothing appears to happen for a minute. There’s a bulletin printed to console to make yous aware of this.

  • The Espressif SDK Init Data may modify between each NodeMCU firmware version, and may demand to exist erased or reflashed. See
    SDK Init Data
    for details. Fully erasing the module before upgrading firmware will avert this issue.

Read:  Nougat Firmware for Tab S Sm T800 10.5

SDK Init Data

NodeMCU versions are compiled against specific versions of the Espressif SDK. The SDK reserves space in flash that is used to store scale and other data. Espressif refers to this area equally “Organization Param” and information technology occupies four iv Kb sectors of flash. A 5th four Kb sector is also reserved for RF calibration. – With SDK version two.x builds, these v sectors are located in the concluding pages at in the Wink retention. – With SDK version 3.x builds, these 5 sectors are located in the otherwise unused pages at Flash offset 0x0B000-0x0FFFF, between the
bin/0x00000.bin
segment at 0x00000 and the
bin/0x10000.bin
to 0x10000.

If this data gets corrupted or you are upgrading major SDK versions, then the firmware may non boot correctly. Symptoms include messages like
rf_cal[0] !=0x05,is 0xFF, or endless reboot loops and/or fast blinking module LEDs. If y’all are seeing one or several of the above symptoms, ensure that your bit is fully erased earlier flashing, for example past using
esptool.py. The SDK version iii.10 firmware builds detect if the RF calibration sector has been erased or corrupted, and will automatically initialise information technology with the correct content before restarting the processor. This works for all SDK supported flash sizes.

Make up one’s mind wink size

The easiest way to determine the flash capacity is to load the firmware and and so
impress(node.info'hw'.flash_size)
which reports the flash size in Kb. Alternatively, if you want to determine the capacity of the flash chip
before
a firmware is installed so you lot can run the following control. This will return a 2 hex digit
Manufacturer
ID and a iv digit
Device
ID and the detected flash size.

Read:  Firmware Update on Dell C2600dn Fails - Communication Error

esptool.py --port <serial-port> flash_id
The chip ID can and then be looked up in
https://review.coreboot.org/plugins/gitiles/flashrom/+/master/include/flashchips.h.