Author Topic: ESP32 Flashing Circuit  (Read 1420 times)

0 Members and 1 Guest are viewing this topic.

Offline machinehumTopic starter

  • Contributor
  • Posts: 22
  • Country: ca
ESP32 Flashing Circuit
« on: June 16, 2023, 11:13:00 pm »
This circuit https://imgur.com/a/BoR4CH2 has 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: [Select]
[machinehum@whitebox zephyr-upstream]$ west flash --esp-device /dev/ttyUSB0
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner esp32
-- runners.esp32: Flashing esp32 chip on /dev/ttyUSB0 (921600bps)
esptool.py v4.5
Serial port /dev/ttyUSB0
Connecting......................................

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.html
FATAL 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.bin

I've tried swapping TX and RX. I've put 100nF at the EN pin. I've read this https://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!
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28741
  • Country: nl
    • NCT Developments
Re: ESP32 Flashing Circuit
« Reply #1 on: June 16, 2023, 11:15:26 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: machinehum

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6542
  • Country: es
Re: ESP32 Flashing Circuit
« Reply #2 on: June 16, 2023, 11:37:52 pm »
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
« Last Edit: June 16, 2023, 11:39:57 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: spostma

Offline globoy

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: ESP32 Flashing Circuit
« Reply #3 on: June 17, 2023, 02:11:49 am »
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.
 

Offline machinehumTopic starter

  • Contributor
  • Posts: 22
  • Country: ca
Re: ESP32 Flashing Circuit
« Reply #4 on: June 19, 2023, 08:22:58 pm »
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.

I'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.
 

Offline machinehumTopic starter

  • Contributor
  • Posts: 22
  • Country: ca
Re: ESP32 Flashing Circuit
« Reply #5 on: June 21, 2023, 08:32:13 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf