Which bootloader to flash

I am trying to flash a blank / raw esp32-wroom-32U (u.fl antenna connector version) via serial UART (using usb to serial 3.3v adapter) using the esp32 download tool provided by Esspressif. The objective is to get to OTA mode using ESPH of course. I looked in the folders associated with ESPH for a .bin file for bootloader and only found the partition.bin and of course the saved compiled application .bin file.

In my Arduino esp32 folders I find:

bootloader_dio_40m.bin
bootloader_dio_80m.bin
bootloader_dout_40m.bin
bootloader_dout_80m.bin
bootloader_qio_40m.bin
bootloader_qio_80m.bin
bootloader_qout_40m.bin
bootloader_qout_80m.bin

Which is best/appropriate choice? I haven’t found an explanation of the differences…

A link to or brief elucidation of the necessary settings for the Espressif tool or an alternative that is not dependent on setting up and verifying a complete IDE would be welcome also.

Thanks.
Q

You are in the esphome section of the forum. Are you in fact using esphome? From your question it would appear not.

Yeah they are, though that’s an interesting acronym.

The way I get ESP32 boards prepared for OTA flashing is:

  • Use ESPhome to create a simple config file with the device type and wifi parameters.
  • Compile it in esphome (click the overflow icon with the three dots)
  • Save/download the .bin file
  • Use the included esp flashing tool to flash the .bin file.
  • You now have OTA flashing available from esphome.

Also see the second FAQ:

Well if he isusing esphome, he doesn’t need to screw around finding bootloaders, all of that is handled by the esphome compilation process.

I simply plug the device into my nuc which has esphome loaded, and upload directly from esphome to the device. Once you have done that you can attach it to a power supply anywhere in wifi range of your AP and OTA further iterations of your firmware. Easy as pie, no other machine needed.

Sure for ESP8266 devices but (some or all?) ESP32s aren’t that easy. They don’t get recognised as a serial device (even after restarting esphome). The procedure above is the way.

I have never had that issues with the esp32’s I have tried. It is certainly good to have options though.

Must just be some ESP32s then. I used to be able to get ESPhome to recognise these but since a few updates ago have had to use the flasher tool method.

tom_I:
Are you starting with blank chips? As indicated in my initial post, I am starting with a bare module. As far as I know these are not shipped with bootloader programmed unless you pay for it and specify a different number or suffix. I didn’t.

ALL:
I have successfully flashed and tested from esp input pin through HA and back out to esp output pin. I used a different esp device with an already present bootloader, usb converter etc on board. Since I didn’t see any mention of ESPH replacing bootloader etc. and I was having difficulty getting blank boards to flash, and since my search did not shed any light, I needed to ask before wasting a lot more time.

It turns out I was having power quality issues - not the power supply but a ground loop. This was either corrupting data as transmitted but I was seeing good hash messages from esp module so that points to a problem as it was flashed.

The question of bootloader is still a little open since I had successfully put a bootloader on the esp previously. Will post a conclusion once I complete the process from a blank module to fully flashed board…

Thanks for the input.

Q

For anyone interested, I did some digging into the bootloader flashing on the ESP32 to be able to flash the ESP32 on the Adafruit MatrixPortal (which ships with a different FW).

In looking at the ESPHome-Flasher source code I noticed that they read the header of the ESPHome buildoutput (i.e. Firmware.bin) and determine the flash frequency and mode. With that info, they pull the appropriate bootloader out of the list posted above directly from Espressif’s Github. The tool then flashes the bootloader, the partitions, the OTA handler, and then the Firmware. If you need to flash this directly as I did, the following command should serve useful (note the flash mode may be different for each chip):

 esptool.py --port COM3 --chip esp32 --baud 115200 --after hard_reset write_flash -z --flash_mode dio 0x1000 .\bootloader_dio_40m.bin 0x8000 .\partitions.bin 0xE000 .\boot_app0.bin 0x10000 .\firmware.bin
1 Like