Binary to update ESP8266 firmware to Espressif firmware. Requires user to press buttons.
Dependencies: BufferedSerial mbed
Fork of ESPQuickFlash by
How to Use
This program will update the firmware on a connected ESP8266 to the Espressif Firmware. The user will need to put the ESP8266 board into FW Update mode and follow instructions as given on the serial console.
Between each block transfer power cycle the ESP8266 and put back into FW Update mode. On the Seeed Grove Serial WiFi module this requires a short press followed by a long press on the esp8266 reset button untill the light on the module goes red.
Terminal Settings
9600 baud 8-N-1
Video of how its done
esptoc.py
- Committer:
- mbedAustin
- Date:
- 2016-04-18
- Revision:
- 1:7cb29c3c51ac
- Parent:
- 0:d84cdaf22096
File content as of revision 1:7cb29c3c51ac:
#!/usr/bin/env python import sys import time FILE_TEMPLATE = """ /*** Auto generated on %s ***/ struct flash_page { uint32_t address; uint32_t size; const char *data; }; #define FLASH_COUNT %d struct flash_page FLASH_PAGES[FLASH_COUNT] = { %s }; """ PAGE_TEMPLATE = """ { 0x%05x, 0x%05x, (const char []){ %s }}""" def main(*args): if len(args) < 2: print 'Usage: %s <address> <file> <address> <file>...' % sys.argv[0] sys.exit(-1) pages = [] for addr, filename in zip(*[iter(args)]*2): with open(filename, 'rb') as file: addr = int(addr, 0) data = file.read() size = len(data) lines = zip(*[('0x%02x' % ord(x) for x in data)]*16) array = ',\n '.join(','.join(line) for line in lines) pages.append(PAGE_TEMPLATE % (addr, size, array)) sys.stdout.write(FILE_TEMPLATE % ( time.strftime("%d/%m/%Y"), len(pages), ',\n'.join(pages) )) if __name__=="__main__": main(*sys.argv[1:])