How to program DevKitC using TXD and RXD instead of USB

fovea1959
Posts: 4
Joined: Tue May 21, 2019 2:52 pm

How to program DevKitC using TXD and RXD instead of USB

Postby fovea1959 » Tue May 21, 2019 3:09 pm

I am trying to demonstrate to my management that we will be able to reprogram installed ESP32-WROOM-32D using the serial lines.

Right now, we are using DevKitC for prototypes, but production will have a bare ESP32-WROOM-32D soldered onto a board of our design.

I have a DevKitC which works fine from the USB port.

I have disconnected the USB cable from the USB port, connected an FTDI cable to the DevKitC. I am powering the DevKitC on the 3v3 pin from the FTDI friend, connecting ground to ground, and have the TX on the FTDI connected to RXD pin on the DevKitC, and RX on the FTDI connected to the TXD on the DevKitC.

With this setup, I can connect to the ESP32 over the FTDI cable just fine at 115200; I can see the output from my program using miniterm.

If I ground IO0 and cycle EN, I get this on the terminal:

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
If I then close miniterm and execute

Code: Select all

esptool.py  --port /dev/ttyUSB0 --baud 115200 read_mac
it doesn't find the ESP32:

Code: Select all

esptool.py v2.5.0
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header
How can I load code to a DevKitC without using the onboard USB chip?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: How to program DevKitC using TXD and RXD instead of USB

Postby ESP_Sprite » Wed May 22, 2019 3:11 am

Not without modifying the DevkitC: the DevkitC has an onboard CP2102 usb-to-serial converter, and even if you disconnect USB, that will still try to control the TxD line. According to the schematics, you can disconnect these by removing R17 and R18; you may want to desolder these and see if it works.

Agrume
Posts: 5
Joined: Tue May 21, 2019 1:38 pm

Re: How to program DevKitC using TXD and RXD instead of USB

Postby Agrume » Wed May 22, 2019 8:39 am

I did it just yesterday and it worked. I did exactly as you did but I'm using Arduino IDE.

I'm using HiLetgo CP2102 TTL/USB.

Next, I'm trying to use an ESP32-WROOM-32D soldered on a PCB (I made it with a standard welder so it's not a great work but it's just for try) with the 2 buttons but it doesn't work :(

I started a topic in this forum yesterday

Wibovn
Posts: 1
Joined: Mon Dec 07, 2020 6:33 pm

Re: How to program DevKitC using TXD and RXD instead of USB

Postby Wibovn » Mon Dec 07, 2020 6:51 pm

Don't know if the standard driver can do this but if you set the TX/RX pins on CP2102N to GPIO.0 and GPIO.1 as input by sofware, you do not need the soldering iron (see CP2102N datasheet). Perhaps the suspend state can do this also (I suspect not).
Perhaps only possible with a custom unsigned driver that may not be worth the hassle.

Who is online

Users browsing this forum: acsoprana and 45 guests