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
Revision 1:7cb29c3c51ac, committed 2016-04-18
- Comitter:
- mbedAustin
- Date:
- Mon Apr 18 21:23:56 2016 +0000
- Parent:
- 0:d84cdaf22096
- Commit message:
- Updated example to use 2wire board (Seeed Grove serial WiFi module) and ask for user input between files.
Changed in this revision
--- a/BufferedSerial.lib Mon Apr 18 20:36:49 2016 +0000 +++ b/BufferedSerial.lib Mon Apr 18 21:23:56 2016 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/sam_grove/code/BufferedSerial/#9ee15ae3d1a3 +http://developer.mbed.org/users/sam_grove/code/BufferedSerial/#a0d37088b405
--- a/esp_command.h Mon Apr 18 20:36:49 2016 +0000 +++ b/esp_command.h Mon Apr 18 21:23:56 2016 +0000 @@ -36,12 +36,11 @@ class ESPCommand { private: SLIPPacket<SERIAL> _slip; - DigitalOut _reset; - DigitalOut _prog; + DigitalIn _button; public: - ESPCommand(PinName tx, PinName rx, PinName reset, PinName prog) : - _slip(tx, rx), _reset(reset, 1), _prog(prog, 1) {} + ESPCommand(PinName tx, PinName rx, PinName button) : + _slip(tx, rx), _button(button){} private: bool command_start(char cmd, uint16_t len) { @@ -87,21 +86,15 @@ } bool sync_frame() { - // Reset board - _reset = 0; - _prog = 1; - wait_ms(250); - _reset = 1; - wait_ms(250); - _reset = 0; - _prog = 0; - wait_ms(250); - _reset = 1; - wait_ms(250); // Flush serial line _slip.flush(); + printf("\r\nPower cycle ESP, put into FW Update mode, push user button\r\n"); + int temp_button = _button; + while( temp_button == _button){;} // wait for button press + printf("\r\nContinuing Now\r\n"); + // Send sync frame uint32_t x = 0;
--- a/main.cpp Mon Apr 18 20:36:49 2016 +0000 +++ b/main.cpp Mon Apr 18 21:23:56 2016 +0000 @@ -16,7 +16,7 @@ int main() { - ESPCommand<BufferedSerial> esp(D1, D0, D2, D3); + ESPCommand<BufferedSerial> esp(D1, D0, PTC6); // Change PTC6 to user button on your platform led_blue = 1; led_green = 1;
--- a/mbed.bld Mon Apr 18 20:36:49 2016 +0000 +++ b/mbed.bld Mon Apr 18 21:23:56 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/cbbeb26dbd92 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f \ No newline at end of file