In the article about the 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
the generic command to load the firmware is the following
1 |
esptool.py --port <serial-port-of-ESP8266> write_flash -fm <mode> -fs <size> 0x00000 <nodemcu-firmware>.bin |
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
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
1 2 3 |
/home/sviluppo/esp8266/nodemcu-firmware export PATH="$HOME/esp8266/esp-open-sdk/xtensa-lx106-elf/bin/:$PATH" alias xgcc="xtensa-lx106-elf-gcc |
Then execute the following commands, with /dev/ttyUSB0 as COM port of the nodemcu dev kit
- Flash erase
1 2 |
./tools/esptool.py --port /dev/ttyUSB0 --baud 9600 erase_flash ./tools/esptool.py --port /dev/ttyUSB0 --baud 9600 write_flash -fm dio -fs 32m 0x3FE000 ./bin/blank.bin |
- Firmware upload
1 |
./tools/esptool.py --port /dev/ttyUSB0 --baud 9600 write_flash -fm dio -fs 32m 0x00000 ./bin/nodemcu_float.bin 0x3fc000 ./bin/esp_init_data_default.bin |
In the next article we’ll upload our custom LUA code on the nodemcu dev kit.