Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BufferedSerial mbed
Fork of ESPQuickFlash by
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
