Page 1 of 1

esp32 flashing over UART using FTDI cable and esptool

Posted: Tue Nov 19, 2019 9:34 am
by GreenGiant
I've read through many similar posts on this topic but am still having no luck. If anyone is able to point out my error, much appreciated!

Using a TTGO32 with UART0 (tx:GPIO1, rx:GPIO3) connected to a USB to UART dongle, then into my laptop. The dongle is good, used it before for console stuff.
GPIO0 and 2 I have on some fly leads so I can pull them low before resetting to enter bootloader mode.
GPIO13 permanently pulled high to force 3V3 logic.

There is a blinky programme on the chip at the moment. If I hold GPIO0+2 low and reset, blinky doesn't run, so I assume I am entering the bootloader mode ok? Let them float and reset, blinky starts.

Using idf.py menuconfig I have set the flash mode to DIO. I have also tried DOUT with no luck.

The command idf.py sends to esptool is as follows:

Code: Select all

esptool.py -p COM7 -b 460800 --after no_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 memohub.bin
Serial port is detected correctly but then times out trying to connect.

I feel like I am missing something obvious?

PS: Reason for this is I will be ultimately using the WROOM32 module on a design without it being on the usual breakout board, so need to prove the concept, and get familiar with, programming over UART without using the onboard CP210x chip.

Code: Select all

esptool.py v2.8
Generated C:/Users/simon/Documents/alcuris/code/hub_esp32/build/memohub.bin
esptool.py -p COM7 -b 460800 --after no_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 memohub.bin
esptool.py v2.8
Serial port COM7
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

Re: esp32 flashing over UART using FTDI cable and esptool

Posted: Thu Nov 21, 2019 10:11 am
by ESP_Sprite
That effectively means there is no communication with the ESP32 bootloader. Can be lots of things: loose wires, wrong serial port, power supply issues... If you use the normal terminal and boot the ESP32 into download mode, what do you see? You should see some bootup messages ending in 'waiting for download', if not, there's something off with your hardware.

Re: esp32 flashing over UART using FTDI cable and esptool

Posted: Thu Nov 21, 2019 4:59 pm
by GreenGiant
Thanks for the reply.

If I flash this board over USB, then connect up the UART, I get the usual post to the console. It just refuses to detect the bootloader.

Interestingly I tried a different board (devkit v1) and everything worked first time.

My suspicion is there is something on the original board that is messing with the UART or the bootstrapping pins.

Not to worry though, working on a different board as I say so I know I am doing things right which was the outcome I wanted. I don't need to delve into the schematics of the board, I'll just use the working one for now for prototyping.

I'll leave this post up for anyone else banging their head against a wall wondering why their UART flashing isn't working. The may have a similar issue.

Cheers.