2
\$\begingroup\$

I recently broke my USB port on ESP 32 ...

enter image description here

... so I need somehow program it. I have this FTDI programmer. ...

enter image description here

I tried to flash it (I pushed boot and EN button together and when Arduino IDE finished compilation and started flashing, I released EN and then boot button.)

Connection:

ESP 32 VIN ... VCC programmer (3.3 V)

ESP 32 GND ... GND programmer

ESP 32 TX ... RX programmer

ESP 32 RX ... TX programmer

After this attempt I get this error:

enter image description here

I tried to use this programmer to program Arduino nano and it works. Do you have any sugesstions about programming this ESP 32 without USB port?

\$\endgroup\$
4
  • \$\begingroup\$ You may be missing a key connection or initialization, or you may need to disconnect the on-board USB-serial chip. \$\endgroup\$ Commented Jul 13, 2019 at 17:01
  • \$\begingroup\$ I'm not experienced with ESP32; I bought one and played with one time. I have some experience with ESP8266. I can easily program ESP8266 using an USB-to-serial adapter, BUT, when booting up ESP8266, some pins have to be grounded, and some pins connected to +Vcc. If you connected only Vcc, GND, TX and RX, ESP can't know that you want to write to it, instead of just run the written code. Also, this breakout board probably has connections made in order that the serial data goes to the ESP32 from that little squared chip (near the boot switch), which probably makes USB to serial translation. \$\endgroup\$ Commented Jul 14, 2019 at 1:14
  • \$\begingroup\$ I'm trying the same thing but with no luck (external power source used). You used the rx2/tx2 or rx0/tx0 pins? \$\endgroup\$ Commented Apr 14, 2020 at 13:09
  • \$\begingroup\$ I am used tx0. You need to push boot button then en button while you are still holding boot. After this, click upload in arduino IDE. \$\endgroup\$ Commented Apr 14, 2020 at 13:42

6 Answers 6

5
\$\begingroup\$

It's unclear from the image if you have set the FTDI adapter to the correct voltage 5.0V or 3.3V (it should be 3.3V).

I have experience programming bare ESP32 modules in this manner, but never a break-out board like this.

Looking at your log and reading through esptool.py is seems clear that you have communication in both directions, otherwise it should have failed earlier - BUT I would verify this by disconnecting one wire (TX, RX) at a time and try a download, just make sure that the download behavior does indeed change.

How are you powering the ESP32? It looks like you are taking VCC from the FTDI adapter. The ESP32 is a bit power hungrier than many other controllers, are you sure your FTDI adapter is able to power it adequately?

Removing the USB/TTL bridge should not be necessary as it should be passive with no USB connected, and most ESP32 breakout boards include a resistor on the bridge TX output to make sure you can "override" the signal externally, like you are doing now. However, if you keep being unable to program I would remove it or cut the relevant traces just to be sure.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ The problem was in powering ESP32. You were right, FTDI adapter wasn't abe to power ESP32. \$\endgroup\$ Commented Jul 14, 2019 at 14:45
5
\$\begingroup\$

One also needs to connect DTR and RTS pins. Below is a circuit schematic on how to achieve proper data transmission on a ESP32 MCU boards Using a CH340C SOP-16.

circuit schema

from this author here: https://en.kohacraft.com/archives/make-a-circuit-using-ch340c-for-esp32-writingsuccess.html

This can be done using the CH340K MSOP-10 (10 pin; smaller package).

To add a flash LED status one needs to connect the "EMAC_RX_DV" pin. In the ESP-32 WROOM-32x board is on GPIO 27, PIN 12. See the figure below on how is made for an ESP-32S: UART SETUP for the ESP32S


To upload a program to the ESP-32, manually, ie, without the DTR/RTS connections,

  • open the Arduino IDE Serial Monitor
  • Hold-down the “BOOT” button
  • Press the “ENABLE” button once
  • Release the finger from the “BOOT” button

Do you see the following message in your Arduino IDE Serial Monitor?

“rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download”

enter image description here

After seeing that message, press the “Upload” button in your Arduino IDE to upload a new sketch.

In those boards/with that setup, after uploading a new sketch, press the “Enable” button to restart the ESP32 and run the new sketch uploaded.

the original answer can be found here: https://rntlab.com/question/a-fatal-error-occurred-failed-to-connect-to-esp32-timed-out/

EDIT:

... in the meantime i got time to design in KiCad a fully working MCU firmware downloader that is suitable for ESP32. This one uses the CH340K IC for USB to UART TTL data sync. One can find drivers for that IC here: http://www.wch-ic.com/downloads/CH341SER_ZIP.html

enter image description here

here's my GitHub repo with the KiCad project files available to download: https://github.com/aeonSolutions/AeonLabs-MCU-Burner-USB-to-UART-TTL

\$\endgroup\$
3
  • 2
    \$\begingroup\$ If you look at the comment to the accepted answer, the problem was providing enough power to the ESP32. \$\endgroup\$ Commented Dec 26, 2021 at 12:12
  • \$\begingroup\$ @ElliotAlderson, questions need to be read as well. \$\endgroup\$ Commented Dec 26, 2021 at 12:15
  • \$\begingroup\$ @ElliotAlderson i've included now, a github repository with KiCad project files for a fully working firmware downloader for ESP32 xxxxxx or any other such as atmel \$\endgroup\$ Commented Mar 30, 2022 at 8:32
0
\$\begingroup\$

I see your connections and there is a problem.

Uploading code to the ESP32 is not the same as uploading code to an Arduino or ESP8266 where we used only RX and TX pins. To upload code to the ESP32 there are some other pins that are used:

  1. RXD0
  2. TXD0
  3. GPIO 13
  4. GPIO 15
  5. GPIO IO0
  6. EN
  7. VCC
  8. GND
  • FTDI PIN ---------------> ESP32 PIN
  1. CTS -----------------> GPIO 15
  2. RTS -----------------> GPIO 13 AND GPIO IO0
  3. RX -----------------> TXD0
  4. TX -----------------> RXD0
  5. DTR -----------------> EN
  6. VCC -----------------> Vin
  7. GND -----------------> GND

After making these connections you can upload code successfully. Don't forget to press the boot button for a while, when starting to upload code.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You only need TX and RX. At least according to ESP32 schematics, the ESP32 datasheet, and my own personal experience. Also, when connected this way, you do not need to press any button to upload (with exceptions; you may be doing things in your code that disables uploading) \$\endgroup\$ Commented Jan 2, 2021 at 19:35
  • 1
    \$\begingroup\$ that is not correct. see my answer above for more details. \$\endgroup\$ Commented Dec 26, 2021 at 12:12
0
\$\begingroup\$

Assuming that you are using a standalone ESP32, no boot or reset button, what I would suggest is pull down GPIO 2 and GPIO 0 to ground, and the standard connection as described above (Tx to FTDI Rx and Rx to FTDI Tx)

Power OFF and ON the supply, you should read over serial (Coolterm or Serialmonitor, etc.) at 115200 baud.,

ets Jun  8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))

ie. you are in boot mode, if you don't power off and on again until you do!

Now, connect

EN to RTS.

GPIO0 to DTR.

GPIO 2 is still ground or floating.

and Tx and Rx as said above.

Try flashing now......

\$\endgroup\$
0
\$\begingroup\$

I connected the GPIO0 directly to the GND and used the 5v power. It worked OK.

\$\endgroup\$
3
  • \$\begingroup\$ Do you mean you used the 5 V option of the FTDI board? This might work a while, but may damage the RX pin of the ESP. \$\endgroup\$ Commented Sep 12, 2022 at 18:33
  • \$\begingroup\$ Yes. How would that damage the Rx pin? The FTDI module uses the USB power and regulates it to 5V. It also has a 3.3 V pin available. I used it to upload a FW to my ESP32 module. \$\endgroup\$ Commented Sep 13, 2022 at 22:25
  • \$\begingroup\$ OK, it sounds as if you used the 5 V pin option to upload the firmware \$\endgroup\$ Commented Sep 14, 2022 at 13:08
-1
\$\begingroup\$

Yes, you can program the ESP32 DevKit v1 using an FTDI (Future Technology Devices International) USB-to-Serial converter. The ESP32 DevKit v1 typically comes with a built-in USB-to-UART bridge, so you don't necessarily need an external FTDI module. However, if you have an FTDI module and want to use it for programming, you can do so by connecting it to the appropriate pins on the ESP32 DevKit v1.

Here are the general steps to program the ESP32 DevKit v1 using an FTDI module:

Identify the Pins:

Locate the following pins on the ESP32 DevKit v1: TXD (Transmit Data) RXD (Receive Data) EN (Enable) GND (Ground) 3V3 (3.3V) Connect the FTDI Module:

Connect the TXD pin of the FTDI module to the RXD pin of the ESP32. Connect the RXD pin of the FTDI module to the TXD pin of the ESP32. Connect the EN pin of the ESP32 to the 3.3V output of the FTDI module. Connect the GND pins of both the FTDI module and the ESP32 together. Connect the 3V3 pin of the ESP32 to the 3.3V output of the FTDI module. Select the Appropriate COM Port:

Connect the FTDI module to your computer via USB. Open the Arduino IDE or your preferred programming environment. Select the COM port corresponding to the FTDI module in the IDE. Select the Board:

In the Arduino IDE, go to "Tools" > "Board" and select "ESP32 Dev Module" or the specific variant that matches your ESP32 DevKit v1. Upload Your Code:

Write or open your Arduino sketch. Click the "Upload" button to compile and upload your code to the ESP32. Monitor Serial Output:

If your code includes serial output (e.g., Serial.begin()), you can open the serial monitor to view the output. Remember that the specific pin mappings might vary based on the ESP32 variant or board version. Always refer to the documentation provided by the manufacturer for the correct pin connections. Additionally, make sure that the FTDI module you are using operates at 3.3V to avoid damaging the ESP32, as it typically works with 3.3V logic levels.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Himanshu Rana - Hi, (a) As you're new here, please see the tour & help center as the site rules differ from those on a typical forum. (b) Our systems indicate that this answer was mostly or completely copied from elsewhere. However, you did not include any reference link/citation, as required by this site rule. Where did that answer come from? Please edit the answer and add the appropriate name & reference link of the source (if the source was online) or a normal, full citation (if it was an offline source e.g. book). Thanks. \$\endgroup\$ Commented Nov 29, 2023 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.