ESP32 Flashing Circuit - Page 1
Forum section: electronics / general

author: machinehum
author_rank: Contributor
timestamp: June 16, 2023, 11:13:00 pm
content: This circuithttps://imgur.com/a/BoR4CH2has been the bane of my existence for months now. I always use the C232HD-DDHSP-0 cable for flashing (normal FTDI cable) instead of the USB/Serial Chip. This cable works great, but other chips and other cables do not.Now I have the CH340C onboard, it isn't working.Code:[machinehum@whitebox zephyr-upstream]$ west flash --esp-device /dev/ttyUSB0-- west flash: rebuildingninja: no work to do.-- west flash: using runner esp32-- runners.esp32: Flashing esp32 chip on /dev/ttyUSB0 (921600bps)esptool.py v4.5Serial port /dev/ttyUSB0Connecting......................................A fatal error occurred: Failed to connect to Espressif device: No serial data received.For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.htmlFATAL ERROR: command exited with status 2: /usr/bin/python /home/machinehum/projects/zephyr-upstream/modules/hal/espressif/components/esptool_py/esptool/esptool.py --chip auto --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/machinehum/projects/zephyr-upstream/build/esp-idf/build/bootloader/bootloader.bin 0x8000 /home/machinehum/projects/zephyr-upstream/build/esp-idf/build/partitions_singleapp.bin 0x10000 /home/machinehum/projects/zephyr-upstream/build/zephyr/zephyr.binI've tried swapping TX and RX. I've put 100nF at the EN pin. I've read thishttps://pcbartists.com/design/embedded/esp32-ch340-programmer-schematic/Does anyone know of a flashing circuit (where you don't have to press the reset button) that works? Any help would be much appriciated!

author: nctnico
author_rank: Super Contributor
timestamp: June 16, 2023, 11:15:26 pm
content: There are timing differences between the various USB-UART converter chips / OSses. If the chip you are trying to program is picky where it comes to timing, some combinations may never work.

author: DavidAlfa
author_rank: Super Contributor
timestamp: June 16, 2023, 11:37:52 pm
content: Check this circuit.In the CH340E version the TNOW pin functionality will change to DTR by adding that resistor, but it will only work if the chip revision is B51 or greater.Source:https://twitter.com/patrick_riscv/status/1509353599100284928

author: globoy
author_rank: Frequent Contributor
timestamp: June 17, 2023, 02:11:49 am
content: Try a 1 uF cap on nReset (EN). That's what Espressif recommends and I saw some boards where I originally used a 100 nF cap fail when moving to Windows 10 - and also starting with OS X Monterey, you have to use a USB3->USB2 hub or programming will fail.

author: machinehum
author_rank: Contributor
timestamp: June 19, 2023, 08:22:58 pm
content: Quote from: globoy on June 17, 2023, 02:11:49 amI'll give that a go, thanks. If that doesn't work, I think it's time for me to read the docs and maybe break out the scope to see what's going on. It's just frustrating because flashing the chip should be something that's relatively straight forward, and all of these "os dependent" and "FTDI dependent" things shouldn't really exist in my mind.

author: machinehum
author_rank: Contributor
timestamp: June 21, 2023, 08:32:13 pm
content: I can't get this thing to work... I got a successful flash by tapping the reset button during the "connecting......." output. But no automatic flashing at all.