Category:ESP8266 Firmware ToolChain

From ElectroDragon
Revision as of 18:39, 24 January 2017 by Chao (Talk | contribs) (Batch Flashing Nodemcu, Deploy firmware)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Pre-build firmware

Custom Interpreter

SDK

Flash Firmware

Updating Firmware Flash Guide

  • Please see the guideline image on the right, this will be used in esp flash download tool, arduino IDE, etc
Option value Description
flash mode QIO -
flash frequency 40mhz -
upload using "serial" in arduino IDE
CPU frequency 80mhz -
flash size 4MBytes (3M SPIFSS), or 32Mbit old ESP8266 board should use 4Mbit (512Mbytes)
reset mode nodemcu  ? not sure about this one
upload speed 115200 up to 576000 is fine, speed up the flashing progress
upload port choose your own serial port -
crystal frequency 26mhz in esp flash download tool

Firmware Details

Boot Process

  • Reset vector is 0x40000080.
  • Boots into Espressif code in IROM0.
  • Loads SPI ROM data.
  • Starts executing ESP SDK-code shadowed SPI ROM (unconfirmed).

SPI Flash ROM Layout

Address Size Name Description
00000h 248k app.v6.flash.bin User application
3E000h 8k master_device_key.bin OTA device key
40000h 240K app.v6.irom0text.bin SDK libraries
7C000h 8k esp_init_data_default.bin Default configuration
7E000h 8k blank.bin Filled with FFh. May be WiFi configuration.

ESPtool

  • ESPTool
  • Install dependence if necessary, for lubuntu, first install python-pip, than pip install pyserial
apt-get install python-pip
pip install pyserial
  • More functions by using -h, for specific command try ie esptool.py write_flash -h.:
   Run esptool {command} -h for additional help
   load_ram            Download an image to RAM and execute
   dump_mem            Dump arbitrary memory to disk
   read_mem            Read arbitrary memory location
   write_mem           Read-modify-write to arbitrary memory location
   write_flash         Write a binary blob to flash
   run                 Run application code in flash
   image_info          Dump headers from an application image
   make_image          Create an application image from binary files
   elf2image           Create an application image from ELF file
   read_mac            Read MAC address from OTP ROM
   flash_id            Read SPI flash manufacturer and device ID
   read_flash          Read SPI flash content
   erase_flash         Perform Chip Erase on SPI flash
  • read flash ID:
./esptool.py --baud 115200 --port /dev/ttyUSB0 flash_id
Connecting...
Manufacturer: e0
Device: 4016

Batch Flashing Nodemcu, Deploy firmware

  • After finish coding, upload your code lua into target board, better be complied
  • dump out the flash content out and save as firmware.bin file for batch deploy
  • use this firmware.bin for new products
  1. So first setup the esptool.py working environment
  2. read out the flash content by command
./esptool.py --baud 115200 --port /dev/ttyUSB0 read_flash 0 4194304 output.bin
  1. 4194304 mbits = 4MB, read flash time take at least more than 5 minutes
  2. 2097152 mb = 2MB, 1048576 mbits = 1MB, 524288 = 512 KB, 262144 = 256 KB
  3. use flash download tool flash normally
  • Also can try dump mem out, like RAM, etc, dumping the ROM (64 KiB) from the chip:
./esptool.py dump_mem 0x40000000 65536 iram0.bin

Pages in category "ESP8266 Firmware ToolChain"

This category contains only the following page.