Preparing a NodeMcu Board


Step 1: downloading the firmware:

Since NodeMcu system occupies a lot of the module's memory, the firmware is usually custom built using only the modules (think of modules as libraries) you really need. This is done through this website: https://nodemcu-build.com . This website sends your firmware through an email link. So you have to write down your e-mail and select the modules you want.

For the purpose of my studies, I'll order a firmware with the standard modules plus two extra ones I think I'll need (highlighted in red):

I also added the SSL/TLS module:

Eventually I received an e-mail with two links: one for the integer version and the other for the floating point version:

Their size difference is not much, but if your program is too big or you need faster execution, you may prefer the integer version.

Flashing your binary image to your board:

You should use one of the programs listed below:

Note: When you download your .bin image from nodemcu-build.com, you don't have to worry about addresses, if you have to specify it, just use 0x00000 (usually the defaut).

A comparison of all programs available can be found at: https://frightanic.com/iot/tools-ides-nodemcu/

Command line flashers:

Command line tools:

esptool.py

This is the most used tool. It's a python program, so it needs python installed.

esptool-ck

This is the tool used by the Arduino IDE to upload programs. It is written in C. Very powerful, but not an easy thing to master. Check my GUI for it.

Note on uploading a binary image from nodemcu-built.com using esptool-ck:

esptool.py and some other tools define the device's memory size at the time of uploading. That is not the case with esptool-ck!

I found this comment on the web about esptool-ck:

igrr commented on 10 May 2016:

The binary header contains 512k setting:

$ dd if=user1.bin bs=1 count=4 2>/dev/null | xxd
0000000: ea04 0000

High four bits of the fourth byte contain flash size:

0 = 512K, 1 = 256K, 2 = 1M, 3 = 2M, 4 = 4M.

Your binary generation process did not set correct flash size header. This usually happens when the author of software assumes that flash size setting will be handled later by esptool.py.

When you download your firmware from nodemcu-built.com, it assumes you will flash it with something similar to esptool.py and gives you a file prepared for 512K.

To fix this, I use an Hex editor (I use "ICY Hexplorer", but anyone will do) and manually change the high part (left) of the fourth byte of the .bin file.

For example, to change from 512K into 4M, you must change this...

into this:

GUI flashers:

Esptool-ck GUI

This is the tool I created to flash my NodeMcu boards. It is experimental, and I would appreciate feedback on it. It is able to create a new binary file with the memory issue mentioned above fixed. Windows only.

nodemcu flasher:

I think this is the "official" flasher developed by the nodemcu team. Its has a GUI interface, but it's Windows only.

nodemcu py flasher:

A GUI for esptool.py.

espcut

In my experience, Espcut has a few quirks, but does flashing pretty well. Windows only.

nexide

I have not tried this one. Seems to be Linux only.

results matching ""

    No results matching ""