Share us



RSS feeds

Update AT firmware to ESP8266 (ESP12E) in LinuxPrint

During the development of SW support of BigClown Wi-Fi module with ESP8266 in ESP12E module. Martin Grames found issue with using of SNTP or SSL, you have to update AT firmware.
Martin updated AT firmware for ESP12F and then wrote an example code cryptoclock. I tried update my Wi-Fi module with ESP12E and then I found a problem.
This tutorial should help you to update AT firmware in operating system based on Linux (in my case Linux Mint).

At first, download esptool, it is tool for uploading of binary file to ESP8266.
https://github.com/espressif/esptool

Unzip the ZIP package and run the installation in terminal.
Pro instalaci napíšete /cestaKsouboru/ pip install esptool

Create folder BIN in esptool folder and copy binary files from this link. I choose ESP8266 AT Bin V1.6.2 (8 Jun 2018). It is the latest version of AT FW which is working with 1MB FLASH, for 2MB FLASH version there are newer BIN files.

The documentaion is available on this website (ESP8266 Non-OS AT Instruction Set).

Copy these files to BIN folder in esptool. (names of files can be different.
user1.1024.new.2.bin
esp_init_data_default_v08.bin
boot_v1.7.bin
blank.bin

Check the memory layout in ESP8266 - you can find it in README of the downloaded directory.
# BOOT MODE
## download

### Flash size 16Mbit: 512KB+512KB
boot_v1.2+.bin 0x00000
user1.1024.new.2.bin 0x01000
esp_init_data_default.bin 0x1fc000 (optional)
blank.bin 0x7e000 & 0x1fe000


Then connect USB-UART convertor to ESP as following
RX - TX
TX - RX
IO0 - GND
CH_EN - VCC (3.3V)
GND - GND

Note from Martin - you can connect RESET of USB-UART convertor to CH_PD, IO0 is connected to DTR of USB-UART. After uploading the IC is automatically reseted.

And connect power supply VCC of ESP - VCC (3.3V).
IO0 has to be grounded (or connected to DTR) before powering.

Upload files
/esptool-master $ sudo python esptool.py --port /dev/ttyUSB0 write_flash \
0x00000 ./bin/boot_v1.7.bin \
0x01000 ./bin/user1.1024.new.2.bin \
0x1fc000 ./bin/esp_init_data_default_v08.bin \
0x7e000 ./bin/blank.bin \
0x1fe000 ./bin/blank.bin


From esptool

esptool.py v2.8-dev
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:e1:0f:e4
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 2MB
Flash params set to 0x0030
Compressed 4080 bytes to 2936...
Wrote 4080 bytes (2936 compressed) at 0x00000000 in 0.3 seconds (effective 123.6 kbit/s)...
Hash of data verified.
Compressed 408388 bytes to 293527...
Wrote 408388 bytes (293527 compressed) at 0x00001000 in 25.9 seconds (effective 125.9 kbit/s)...
Hash of data verified.
Compressed 128 bytes to 75...
Wrote 128 bytes (75 compressed) at 0x001fc000 in 0.0 seconds (effective 85.2 kbit/s)...
Hash of data verified.
Compressed 4096 bytes to 26...
Wrote 4096 bytes (26 compressed) at 0x0007e000 in 0.0 seconds (effective 4679.1 kbit/s)...
Hash of data verified.
Compressed 4096 bytes to 26...
Wrote 4096 bytes (26 compressed) at 0x001fe000 in 0.0 seconds (effective 4675.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...


Disconnect IO0 from GND restart the ESP module (it is not neccesary if you connect IO0 with DTR and CH_PD with RESET).

Test of communication - set baudrate to 119200 and connect USB-UART convertor to ESP module (CH_PD and VCC = VCC of convertor).
AT+GMR

If you will see this, that's right.

AT version:1.6.2.0(Apr 13 2018 11:10:59)
SDK version:2.2.1(6ab97e9)
compile time:Jun 7 2018 19:34:26
Bin version(Wroom 02):1.6.2
OK



No Comments have been Posted.

Post Comment

Please Login to Post a Comment.