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

main.cpp

Committer:
mbedAustin
Date:
2016-04-18
Revision:
1:7cb29c3c51ac
Parent:
0:d84cdaf22096

File content as of revision 1:7cb29c3c51ac:

#include "mbed.h"
#include "BufferedSerial.h"


// Include the actual image
#include "flash_image.h"

// Cross include definitions
//#define DEBUG 1
#define LED_STATUS 1
DigitalOut led_blue(LED_BLUE);
DigitalOut led_green(LED_GREEN);

#include "slip.h"
#include "esp_command.h"


int main() {
    ESPCommand<BufferedSerial> esp(D1, D0, PTC6); // Change PTC6 to user button on your platform
    led_blue = 1;
    led_green = 1;
    
    for (int i = 0; i < FLASH_COUNT; i++) {
        if (!esp.flash_write(
                FLASH_PAGES[i].address, 
                FLASH_PAGES[i].data, 
                FLASH_PAGES[i].size))
            error("Error writing flash at 0x%05x!\r\n", FLASH_PAGES[i].address);
    }
    
    // Signal we're done
    printf("Finished\r\n");
    
    while (true) {
        led_green = !led_green; // toggle led
        wait(0.2f);
    }
}