How to upload nodemcu firmware with esptool

In the article about the Nodemcu firmware building

Nodemcu firmware building

we created in the bin folder the  0x0000.bin and 0x100000.bin files and copied the  blank.bin and esp_init_data_default.bin files from the Espressif SDK.

According to the esptool tool documentation

esptool

the generic  command to load the firmware is the following

In our case, as we have a development kit with 4M of flash and an 9600 USB bps we have to specify the following parameters

  • mode=dio
  • size=32m

 Always according to the esptool documention, not generating the firmware with docker, we merged the two files, 0x0000.bin and 0x100000.bin,  into the nodemcu_float.bin file

 For our development kit we need to use the other two files

  • esp_init_data_default.bin: default init data.
  • blank.bin: to reset the configuration.

according to the mapping available at the following link

ESP8266 Guide

In our case we have to use (4M flash)

  • 0x3FC000 address for  esp_init_data_default.bin.
  • 0x3FE000 address for blank.bin

In the shell command window move into nodemcu-firmware and set the PATH variable

Then execute the following commands, with /dev/ttyUSB0 as COM port of the nodemcu dev kit

  • Flash erase

  • Firmware upload

In the next article we’ll upload our custom LUA code on the nodemcu dev kit.

Lua sample code