1
\$\begingroup\$

I want my layout will include female headers to connect CP2102 MICRO USB to UART TTL Module 6Pin so I could just 'stick' it to my PCB while uploading the code. The 5V for the ESP will be supply from external source during operation.

The thing is the CP2102 has the following pins: 5V, 3.3V, GND, TX, RX, DTR:

top photo of PCB

I looked in the schematic of ESP32, micro USB 5V&USB-UART section and I saw that for upload the code properly I need RTS pin from CP2102, which is not accessible:

serial wiring

So it's seems that there is a missing pin out (RTS) for uploading the code. I didn't find any module for micro USB&UART that contain all the desired pins.

Is there any solution for it? Or should I implement the micro USB 5V&USB-UART section on my layout?

Thanks.


Update:

So I got the board and the USB to UART section looks like:

schematic diagram

I tried to upload a sketch to the board and got the following message:

Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

I pushed the BOOT push-button as always do with ESP32 and nothing happen! I also measured voltages across IO0: 3.3v and 0V when I push the button.

Finally I got the message:

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

My design looks the same as the reference suggest, but still I failed in uploading a sketch.

\$\endgroup\$
2
  • \$\begingroup\$ You need to sutdy the programming process to understand what these are used for versus the possible alternatives and make your own decision. \$\endgroup\$ Commented Mar 30, 2019 at 14:52
  • \$\begingroup\$ Did you get it working? Thanks \$\endgroup\$
    – VAAA
    Commented May 12, 2022 at 5:55

2 Answers 2

2
\$\begingroup\$

Do you need RTS? Yes and no. Per the reference schematics for the ESP-WROOM-32, the RTS pin is needed (along with DTR) if you want the programming process to be able to automatically restart and put the ESP device into the correct "Boot" mode for programming and then automatically restart it and run in the regular boot mode after it's done programming. If you don't have the RTS pin, then you'll have to use a separate mechanism (like a pushbutton) connected directly to the ESP-WROOM-32 pin IO0 so that you can power it up in the correct boot mode for programming.

I am somewhat familiar with this process, as I have split off the ESP programmer / power circuit into my own custom PCB, following the same reference schematics that you're looking at.

\$\endgroup\$
2
  • \$\begingroup\$ According to the reference schematics, it's seems that i need both the RTS pin and push-button for IO0. I have the complete board (nudemcu-32s) and when I want to upload a code I must press the push-button of IO0 (BOOT) for a while otherwise i get fatal error: "timed out waiting for packet header". So from my experience the push-button is necessary anyway. \$\endgroup\$ Commented Mar 31, 2019 at 15:48
  • \$\begingroup\$ @Electrician it is very likely that design is incorrect, then. I initially ran into the same problem when I first made my custom ESP32 programmer PCB, but if it is done correctly then the pushbutton isn't necessary (as I found out when I fixed my circuit). If you are already relying on the pushbutton, then you probably won't need RTS coming out of the programmer circuit. \$\endgroup\$
    – mith
    Commented Apr 1, 2019 at 16:20
1
\$\begingroup\$

For a more automated flash and reset binary file upload you need to connect DTR and RTS pins. Below is a circuit schematic on how to achieve proper data transmission on a ESP32 MCU boards.

schematic for ESP32 writer by from kohacraft's blog

Image source: kohacraft's blog - Make a circuit using CH340C for ESP32 writing (success)

and anyone can download a PCB design in KiCad on my GitHub repo: https://github.com/aeonSolutions/AeonLabs-MCU-Burner-USB-to-UART-TTL

enter image description here

See the answers in this question ESP32 with FTDI programmer

\$\endgroup\$
3
  • 1
    \$\begingroup\$ does it matter particularly what transistor is used for the IO0 and RST conections? I'm thinking something like a S8050? \$\endgroup\$
    – robbrown92
    Commented Feb 16, 2022 at 19:21
  • 1
    \$\begingroup\$ no really no. You just need to select one that is able to fast switch for the corresponding data transfer bps \$\endgroup\$ Commented Feb 17, 2022 at 10:34
  • \$\begingroup\$ @robbrown92 the S8050 also fits the schematics as a direct replacement for the BSS138 \$\endgroup\$ Commented May 29, 2022 at 19:42

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.