ESP8266 ESP-12E as nodecmu

Boot ROM has 74880 baud. After this depending on firmware there is baud 9600 or 115200. (all 8N1)
Board has arrived with AT firmware.
Flash parameters: 40MHz, QIO, size 8Mbit.
Flashing with 115200 baud does’nt work for me, the uploaded image was wrong, so i’m flashing with 9600 baud, it takes around 5 minutes. (19200 also worked for me at least once).

This is version worked for me, i’m not sure, that all of theese changes are necesseary.

TL;DR

  • sudo apt-get install python-serial
  • git clone https://github.com/themadinventor/esptool.git && cd esptool
  • wget http://szabi.org/any_i/esp/0x00000.bin http://szabi.org/any_i/esp/0x10000.bin
  • sudo service ModemManager stop
  • ./esptool.py –port /dev/ttyUSB3 –baud 9600 write_flash –flash_freq 40m –flash_mode qio –flash_size 8m 0x00000 0x00000.bin 0x10000 0x10000.bin
    # /dev/ttyUSB3 -> change to yours, use dmesg to identify it

  • sudo picocom /dev/ttyUSB3 –b 9600 –omap crcrlf –imap crcrlf

Building firmware:

  • $ git clone https://github.com/nodemcu/nodemcu-firmware.git
    # (432f698fd80e0ff90ea4f209b66c77d5105ea55a at the moment)
    $ cd nodecmu-firmware
  • Patch

    diff --git a/app/include/user_config.h b/app/include/user_config.h
    index 65a80b9..16163bb 100644
    --- a/app/include/user_config.h
    +++ b/app/include/user_config.h
    @@ -7,9 +7,9 @@
    // #define FLASH_1M
    // #define FLASH_2M
    // #define FLASH_4M
    -// #define FLASH_8M
    +#define FLASH_8M
    // #define FLASH_16M
    -#define FLASH_AUTOSIZE
    +// #define FLASH_AUTOSIZE
    #define FLASH_SAFE_API// Byte 107 of esp_init_data_default, only one of these 3 can be picked
  • $ docker run –rm -ti -v `pwd`:/opt/nodemcu-firmware asmaps/nodemcu-builder make
  • sudo service ModemManager stop
  • $ docker run –rm -ti –device=/dev/ttyUSB3:/dev/ttyUSB0 -v `pwd`:/opt/nodemcu-firmware -u=”root” nodemcu-builder tools/esptool.py –baud 9600 write_flash –flash_freq 40m –flash_mode qio –flash_size 8m 0x00000 bin/0x00000.bin 0x10000 bin/0x10000.bin
    # /dev/ttyUSB3 -> change to yours, use dmesg to identify it

  • sudo picocom /dev/ttyUSB3 –b 9600 –omap crcrlf –imap crcrlf
Posted in IT