Binary to update ESP8266 firmware to Espressif firmware. Requires user to press buttons.

Dependencies:   BufferedSerial mbed

Fork of ESPQuickFlash by Christopher Haster

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

Committer:
mbedAustin
Date:
Mon Apr 18 21:23:56 2016 +0000
Revision:
1:7cb29c3c51ac
Parent:
0:d84cdaf22096
Updated example to use 2wire board (Seeed Grove serial WiFi module) and ask for user input between files.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
geky 0:d84cdaf22096 1 #include "mbed.h"
geky 0:d84cdaf22096 2 #include "BufferedSerial.h"
geky 0:d84cdaf22096 3
geky 0:d84cdaf22096 4
geky 0:d84cdaf22096 5 // Include the actual image
geky 0:d84cdaf22096 6 #include "flash_image.h"
geky 0:d84cdaf22096 7
geky 0:d84cdaf22096 8 // Cross include definitions
geky 0:d84cdaf22096 9 //#define DEBUG 1
geky 0:d84cdaf22096 10 #define LED_STATUS 1
geky 0:d84cdaf22096 11 DigitalOut led_blue(LED_BLUE);
geky 0:d84cdaf22096 12 DigitalOut led_green(LED_GREEN);
geky 0:d84cdaf22096 13
geky 0:d84cdaf22096 14 #include "slip.h"
geky 0:d84cdaf22096 15 #include "esp_command.h"
geky 0:d84cdaf22096 16
geky 0:d84cdaf22096 17
geky 0:d84cdaf22096 18 int main() {
mbedAustin 1:7cb29c3c51ac 19 ESPCommand<BufferedSerial> esp(D1, D0, PTC6); // Change PTC6 to user button on your platform
geky 0:d84cdaf22096 20 led_blue = 1;
geky 0:d84cdaf22096 21 led_green = 1;
geky 0:d84cdaf22096 22
geky 0:d84cdaf22096 23 for (int i = 0; i < FLASH_COUNT; i++) {
geky 0:d84cdaf22096 24 if (!esp.flash_write(
geky 0:d84cdaf22096 25 FLASH_PAGES[i].address,
geky 0:d84cdaf22096 26 FLASH_PAGES[i].data,
geky 0:d84cdaf22096 27 FLASH_PAGES[i].size))
geky 0:d84cdaf22096 28 error("Error writing flash at 0x%05x!\r\n", FLASH_PAGES[i].address);
geky 0:d84cdaf22096 29 }
geky 0:d84cdaf22096 30
geky 0:d84cdaf22096 31 // Signal we're done
geky 0:d84cdaf22096 32 printf("Finished\r\n");
geky 0:d84cdaf22096 33
geky 0:d84cdaf22096 34 while (true) {
geky 0:d84cdaf22096 35 led_green = !led_green; // toggle led
geky 0:d84cdaf22096 36 wait(0.2f);
geky 0:d84cdaf22096 37 }
geky 0:d84cdaf22096 38 }