How to Flash your ESP32

Posted on
  • I have successfully flashed the ESP32-CAM , the LILYGO® TTGO and official expressif ESP32-WROOM-32D using the following code.

    Since I haven't seen it clearly written anywhere I figured I'd share this with everyone.

    esptool.py  --chip esp32    --port /dev/cu.SLAB_USBtoUART --baud 921600  --after hard_reset write_flash -z  --flash_mode dio  --flash_freq 40m  --flash_size detect  0x1000 bootloader.bin 0x8000 partitions_espruino.bin 0x10000 espruino_esp32.bin
    

    I tried the .bin but could NOT get it to work. so you'll go to the "directory" of the latest version (v2.04 right now) and you'd download all the files from there:
    https://www.espruino.com/binaries/esprui­no_2v04_esp32/

    of course the only thing you've change is the port "/dev/cu.SLAB_USBtoUART " to what ever it is on your computer.

  • Yes, I too struggled with this couple of times.
    Than discovered there is a README_flash.txt in the ESP32 directory that shows pretty much the commands you used.
    IIRC, saw somewhere that first you have to flash all parts as above, and after that you can just flash espruino_XvYY_esp32.bin to upgrade.

    Actually the docs tell you to do this, but starts with building from source. So splitting Building and Flashing to separate paragraphs would be a good idea IMO. Or even better, moving the Build instructions down, and only showing the download & flashing instructions in the "Getting Started" sections would make it clearer. Maybe the docs were not updated since ESP32 builds are available...

    You can always send a PR https://github.com/espruino/EspruinoDocs­/blob/master/boards/ESP32.md :)

  • I had some issues, found the cure and need to post it here, for future use. Had strange reboots, googled for hours and finaly found this:

    "Some of our readers reported that they could only upload code when
    the ESP32 was powered with 5V. However, we were always successful
    providing 3.3V supply."

    I can use Espruino Pico with a 1 meter cable, add nokia display and temperature sensor. But not here. ESP is more heavy, feed it more, use better and shorter cables.

  • Mon 2020.01.20

    "Some of our readers reported that they could only upload code when
    the ESP32 was powered with 5V. However, we were always successful
    providing 3.3V supply."

    @7oo1er would you please look back through the browser history and post the link to the quote in post #3 please. Google did not return any suitable links using all or part of those exact words.


    I believe this quote is taken out of context.


    How can it be possible that driving a CPU chip with a higher (and not rated for, possibly damaging the chip, by the way) voltage be okay, but also be successful at a lower voltage?
    Running off a TTL converter perhaps?


    'ESP is more heavy, feed it more, use better and shorter cables'

    I'm not entirely sure what the above is intending to imply.

    The reason the Pico works from a 1 meter USB cable is that it's own circuit board contains an onboard regulator to convert the USB 5v output to the 3v3 volts needed by the STM32 CPU chip.

    "On-board 3.3v 250mA voltage regulator, accepts voltages from 3.5v to 16v"

    http://www.espruino.com/Pico



    While there are many flavors of ESP32 and circuit breakout board mounts,

    "2.2V to 3.6V operating voltage"

    http://www.espruino.com/ESP32

    what is intended by "better", "shorter" cables for "heavy" use? The power demands for these CPU chips are in the mA range. The restriction of a shorter cable is ridiculous at a meter length. (yes physical properties, diameter, length, wire resistance, etc. need to be considered with many tens of feet however)

    If the intent is not to drive additional boards or Neopixel strips from their on board regulator, (which any prudent project would not be doing anyway) then I would totally agree.


    Please explain the "But not here." reference to the ESP32. Thank you.

  • Hello!
    Wow, so long post! Thank you! I'll break my answer.

    1. Link with that quote: ESP32-CAM Troubleshooting Guide. Just add quotes when google it.
    2. My humble opinion. I had lost many hours with reflash and rerun, edit sketches, search for other sketches (tried Arduino based), google why this thing can't run simple things. Reason was: bad cable, that can't feed the board enough. I choose to post this reminder here: please feed the board.
    3. I did a check with a cheap and not very accurate "USB tester", short cable can give 1A from powerbank to resistor, 1m cable can't. Enough for Pico, too bad for ESP32.
    4. My friend is making a flight cockpit emluator with several Megas. Suddenly they stopped to reflash. All of them. He spend 4 hours in research, reinstall, change drivers. Real reason: motherboard change in pc. New MB can't reflash with old cable and front USB case connection. He took a short cable from Mega package and everythyng works as usual.
    5. BTW, had such dance with a R300 printer. It looked ok in devices, but can't print. Same cure: change the cable.

    So. Cables are fake friends. And yes, I think it's related to "How to Flash your ESP32" topic.

  • Oh yes, checked some of my USB cables just this weekend: most had <0.5 ohm resistance.
    The ones came with a third-party nRF kit had 5-6 ohm resistance. Fine for the nRF's couple of milliamps. Not good for anything else.
    The short (0.4m) IKEA ones are ok. The longer (1.5m) ones had higher resistance.
    The best one was a 1.5m long that came with my phone. Don't have the exact number right now, but had lower resistance than the 0.4m Ikea ones.

    Also, the cable or the connectors can wear out after use :(

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

How to Flash your ESP32

Posted by Avatar for DamianMontero @DamianMontero

Actions