Did I brick my ESP8266 ESP01 on Pico?

Posted on
  • I realized that I was still using 0018000902-AI03 firmware, so I decided to update it. I made a mistake of doing it on Windows because esptool.py kept timing out. Then I read about --no-stub option and added that to my command. Reading/writing started to work, but got slower and slower and timed out before reaching even 20% of flashing. I finally realized that I could have flashed it through Raspberry Pi 3+, but even there it doesn't work without --no-stub and flashing fails anyways. Whats my options?

    pi@raspberrypi:~ $ python -m esptool -p /dev/ttyACM0 -b 115200 --no-stub read_mac
    esptool.py v2.8
    Serial port /dev/ttyACM0
    Connecting...
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: 18:fe:34:9d:53:13
    Enabling default SPI flash mode...
    MAC: 18:fe:34:9d:53:13
    Hard resetting via RTS pin...
    
    pi@raspberrypi:~ $ python -m esptool -p /dev/ttyACM0 -b 115200 --no-stub write_flash 0 ESP8266_AT25-SDK112-512k.bin
    esptool.py v2.8
    Serial port /dev/ttyACM0
    Connecting...
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: 18:fe:34:9d:53:13
    Enabling default SPI flash mode...
    Configuring flash size...
    Auto-detected Flash size: 512KB
    Erasing flash...
    Took 1.05s to erase flash block
    Writing at 0x00000000... (0 %)
    A fatal error occurred: Invalid head of packet (0x13)
    
  • Hi - sorry for the delay, I was away last week.

    How did you update the firmware? Using the instructions for 'Use Espruino' at http://www.espruino.com/ESP8266#use-a-se­parate-usb-ttl-adaptor ? So actually doing the connection via the Pico?

    First I'd make sure your Pico firmware is up to date, then did you make the changes to ESP_RAM_BLOCK/ESP_FLASH_BLOCK ?

  • Yes, I used the http://www.espruino.com/ESP8266#use-espr­uino instructions on Pico, I have shim v1 and espruino_2v06_pico_1r3.bin on it. I can still get it into bootloader mode manually, but after trying to flash ESP8266_AT25-SDK112-512k.bin with esptool.py, it broke and now I get the logs above.
    My esptool.py doesn't have ESP_FLASH_BLOCK, it only has ESP_RAM_BLOCK and FLASH_WRITE_SIZE.

    I ordered 10 days ago new shims for Pico too, but I guess you haven't got time to process them yet, I only got the automated order email.

  • Do you have a USB TTL converter? I'd maybe try using that to flash the ESP8266. You'd have to solder wires onto the ESP8266 pins but it's worth a try.

    When the Pico is connected to power, A2/A3 should be open circuit so if you've got them connected to the USB TTL converter you should be fine.

  • I think I don't have, but I have this USB programmer https://www.sparkfun.com/products/12924

    and I have Arduino Uno, for which I found this guide https://dzone.com/articles/programming-t­he-esp8266-with-the-arduino-ide-in-3

  • I had the same issue as @tarmo888 (I also had no ESP_FLASH_BLOCK, so maybe that was a typo, as it's not in the v2 esptool either) but I found a solution (on Windows) after a couple of hours..

    I've come back to my Pico after some years (kickstarter backer supplied with ESP8266 & v1 shim). I soldered the ESP8266 & shim to the Pico, and it originally worked. The firmware versions reported the 0018000902-AI03 version, so I wanted to upgrade, but no matter what I tried (via the IDE or esptool) I couldn't get it to work. I think I completely clobbered the driver by trying require("Storage").eraseAll() and then reset() since re-running firmware versions reported nothing.

    So here's what worked for me - the tool espFlasher mentioned on the page in the last link on Gordon's instructions worked (I used the 64-bit version). The 0.25.0.0 FW version could be loaded provided the "Connect to Espruino" instructions on Use Espriuno (I ignored the digitalWrite lines since those are for the new shim), enabled the ESP8266 bootloader as per the instruction, and instead of running esptool.py, run the espFlasher with baud set to 115200 (via Advanced tab). After restarting, and trying the firmware versions routines, you'll see the 0.25.0.0 version reported.

  • Thanks for letting us know what fixed it for you, and glad you got it sorted in the end!

    Did you ever manage to try the IDE to update, or did that not work at all? http://www.espruino.com/ESP8266#use-the-­espruino-ide

  • Thanks @Gordon. I did originally try that since it was recommended, but I couldn't get it to work. After I shorted GPIO0 to GND, the process seemed to start, but it failed prematurely with a 'sync error' (or similar, so I can't recall the precise error). I also tried shorting the reset pin, but I think that's unnecessary/undesireable(?), but when I did that I seemed to get further (the block writing started) but it crashed out about half way (at around block 500). This is when I gave up using the IDE, and opted for the "Espruino as a makeshift USB-TTL adaptor" which eventually worked for me. I was wondering whether the '0.25.0.0 FW version' is the best one to use, but I guess it is since the 512kB ESP01 modules are not compatible, and I think those are the ones that were given out during the Pico kickstarter campaign?

    I am hoping for a new wifi-capable Espruino model in the future (maybe with an antenna connector option) as I found the ESP-01/shim approach a bit fiddly especially if a firmware update is required (but totally understandable as that was what's available at the time).

  • Did 0.40.0.0 not work ok for you? There may well be newer firmwares available though and I'm happy to update that page if someone finds them.

    Thanks - yes, I do have plans for a WiFi Espruino - but it'll be some time later this year I'm afraid as I have a few other things I need to sort out first.

  • The link associated with 0.40.0.0 went to the wifi device page, and not to a firmware file, so I've not tried it (but looking at the files page, I guess this is it: http://www.espruino.com/files/ESP8266_AT­_1_5_4.zip). It has the AiThinker files in there (AiThinker_ESP8266_DIO_8M_8M_20160615_V1­.5.4; AiThinker_ESP8266_DIO_32M_32M_20160615_V­1.5.4) , but these seem to refer to higher memory chips (which I guess are not compatible with ESP-01)?

  • Ahh! I just checked and it seems possible that even 2.0.0.0 should work: https://bbs.espressif.com/viewtopic.php?­f=46&t=2451

    The ESP01 modules are (as far as I know) 1MB (8Mbit) modules (whereas the other modules are 4MB (32Mbit). So the AiThinker_ESP8266_DIO_8M_8M_20160615_V1.­5.4 image you found should work.

    I'm not sure where the 0.40.0.0 firmware is I'm afraid - I think it's likely I never had it (apart from pre-installed on modules) which is why it wasn't linked.

    I did however just try to install the 1.1.0.0 firmware via the Web IDE on a Pico with an ESP01 on a shim and that worked fine, so I'm not sure what's up.

    I think it's possible that earlier shims didn't include the pins for boot mode, or maybe just that your shim's soldering might not have made a connection there - and I guess that would have really messed things up for you unless you had manually connected GPIO0

  • I recall reading that the v1 shims (which I have) didn't include those pins for boot load, so I had to ground GPIO0 and then momentarily ground the reset pin for the process to work with the espFlasher. When I tried the same process with the IDE, writing could only get halfway before it crashed out with an error message. At the time, I didn't record the message, but if it's helpful I can try that again to reproduce it. To confirm, is it correct that in order to flash the ESP01 via the IDE it's required to ground GPIO0 and then momentarily ground the reset pin, or is it sufficient to just ground the GPIO0 (which is what I recall reading, but that didn't work either as reported before). Thanks for the v2 info, I'll give that a go later.

  • I just tried flashing via the IDE again - here's what I did:

    • I checked the current version via IDE, and it reported AT version: 0.25.0.0, SDK version 1.1.2, Compile time Jun 17 2015
    • set GPIO0 pin to GND on the ESP101 board
    • clicked the firmware update button
    • noticed the IDE reported: syncing..
    • noticed the blue LED on the ESP01 flashing
    • after about 10s the IDE reported: "The Firmware update failed: No response to sync".

    BTW I have wondered about those later versions which appear to contain a boot loader and other code, so I guess the IDE is only loading the needed part.

    I'll keep looking into the later version as an experiment.

  • Hi,

    To confirm, is it correct that in order to flash the ESP01 via the IDE it's required to ground GPIO0 and then momentarily ground the reset pin, or is it sufficient to just ground the GPIO0 (which is what I recall reading, but that didn't work either as reported before).

    I think you would have to ground GPIO0 and then reset (or I guess just ground it and plug the Pico in).

    If connected with the shim then the IDE would automatically do the GPIO0+reset, but it sounds like in your case we don't have that.

  • if I do the following:

    • set GPIO0 pin to GND on the ESP01 board
    • clicked the firmware update button (firmware downloads)
    • when the IDE reports: syncing.., I ground the ESP01 reset pin, then the IDE reports writing block x / 1024 (where x increments)
    • blue LED flashed on ESP01 while the block value increments
    • when it gets to 512, the process bombs out with the following IDE message:

    The Firmware update failed: Unexpected response {"dir":1,"cmd":3,"len":2,"data":"\u0001\­b"}

    @Gordon, what do you think?

  • Oh wow, ok. So it would seem that the firmware update process does workbut your module is the 512k variant, so it's uploading the wrong firmware.

    I'm sorry about this - I checked with a Pico+ESP01 I had on my desk here assuming it was the same and it worked, but it must have been a 1M variant and I got confused between 0.5M/1M and 4M ones.

    I just had a quick google and found this tidbit:

    if the PCB is blue, the flashsize is 512KB if the PCB is black the flashsize is 1MB

    And it looks like I must have supplied the blue 512KB ones with the KickStarter campaign (at least that's what is in the picture on http://www.espruino.com/ESP8266)

    Sorry - it's possible I was aware at one point but in the years since this I must have forgotten.

    I did manage to find this though: https://www.sevarg.net/2016/11/20/instal­ling-latest-at-firmware-on-4mbit/

    It seems to imply that you can use AT firmware 1.3.0.0 with 'noboot' - the firmware link doesn't work now, but this seems to be the new one: https://github.com/espressif/ESP8266_NON­OS_SDK/releases/tag/v2.0.0

    I checked and v2.1.0 and later don't have 'noboot' so I guess that really is the last available firmware. Still, I guess it's a decent step up over 0.25.0.0

  • Quick update: I've now pushed an update to the IDE. It will now update to AT firmware 1.3.0.0 (SDK 2.0.0) which I think is the latest available for 512k.

    I dug out a Pico with a blue ESP8266 and it does seem to work!

    Hope that fixes things for you - I'll push an update to the docs as well later on.

  • Thanks alot Gordon. I indeed have the blue ESP01 board. I tried again the IDE method of flashing that board, grounded GPIO0 and momentarily grounded the reset pin, and I got the same result in post #15 above (i.e. interrupted write). So I reviewed that article, and found I could successfully flash the v2.0.0 firmware via the previously-described process using the espflasher application, with the 4 files each placed at respective addresses as pointed out in that sevart article (Installing the Non-Boot Firmware section) you pointed out. Thanks alot for locating that article.

    I'm wondering in the IDE update whether you're applying the v2.0.0 update as per the info in that section (for that ESP01 board).

  • I'm wondering in the IDE update whether you're applying the v2.0.0 update as per the info in that section (for that ESP01 board).

    What I did was completely erased an ESP8266, did it as per those docs and then downloaded one big 512k binary. It should have basically the same effect.

    It's an odd one because I dug out a blue ESP8266 on a Pico and flashed via the Web IDE to check that it'd be ok, and it was fine - so I wonder what's different in your case...

    Still, at least you have it working now with the latest firmware!

  • Agree - it's good to have the latest.

    FWIW here's the package lettering on the chip - is it the same as your test one?

    ESP8266EX
    282014
    POVV01

    I understand from quick research, there's some variation on the package labelling (whether it makes a difference however).

  • Yes, it's the same! The flash chip could be different I guess, but I think there's a good chance that they are from the same batch.

    The upload issues could actually be based on us having different operating systems though - I'm using Ubuntu here

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Did I brick my ESP8266 ESP01 on Pico?

Posted by Avatar for tarmo888 @tarmo888

Actions