Unable to access custom ESP32 over Serial/USB

rbshah7388
Posts: 13
Joined: Thu May 12, 2016 1:32 pm

Unable to access custom ESP32 over Serial/USB

Postby rbshah7388 » Sat Dec 25, 2021 1:34 pm

Hi,
I have designed a custom ESP32 board based on Wroom-32 module for one medical application. However, I am not able to erase it's flash and getting following error.

C:\02-Rahul\01-Consultancy Projects\Process\Software\Test Files - 25-12-2021>esptool --port com4 erase_flash
esptool.py v3.1
Serial port com4
Connecting...
Device PID identification is only supported on COM and /dev/ serial ports.
....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Invalid head of packet (0x1B)
I am using a boot switch to connect RTS <-> EN and DTR <-> GPIO0 as there in https://dl.espressif.com/dl/schematics/ ... 80607a.pdf

I also tried connecting RTS and EN directly and DTR and GPIO0 directly, still facing the same error.

Attached my schematics for reference.

Can anyone kindly check and help me here?

Regards,
Rahul
Attachments
Schematics-Power-USB_Part2.PNG
Schematics-Power-USB_Part2.PNG (84.13 KiB) Viewed 20664 times
Schematics-MCU-Part1.PNG
Schematics-MCU-Part1.PNG (42.74 KiB) Viewed 20664 times

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

Re: Unable to access custom ESP32 over Serial/USB

Postby ESP_Sprite » Sun Dec 26, 2021 2:52 am

Unless I'm overlooking it in your schematic, I think you're missing the powerup reset EN R/C network. Add a resistor of 10K from EN to Vcc and add a capacitor of 1 to 10uF from EN to Gnd, and you should be good.

rbshah7388
Posts: 13
Joined: Thu May 12, 2016 1:32 pm

Re: Unable to access custom ESP32 over Serial/USB

Postby rbshah7388 » Sun Dec 26, 2021 9:10 am

Yes, I missed putting 10k EN RC ckt but even after trying that out, it is still showing the same error. Is it that I need to put this RC near to ESP32 module?
Currently I am putting it at close to CP2102 chip. Check these images.
Attachments
PCB layout top.PNG
Top Layer - PCB Layout
PCB layout top.PNG (231.91 KiB) Viewed 20590 times
RC-circuit-add.PNG
RC ckt for EN
RC-circuit-add.PNG (211.98 KiB) Viewed 20590 times

rbshah7388
Posts: 13
Joined: Thu May 12, 2016 1:32 pm

Re: Unable to access custom ESP32 over Serial/USB

Postby rbshah7388 » Sun Dec 26, 2021 9:56 am

tried connecting 10k resistor and 10uF cap close to esp32 module, still getting the same error.

Code: Select all

Serial port COM5
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Invalid head of packet (0x1B)

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

Re: Unable to access custom ESP32 over Serial/USB

Postby ESP_Sprite » Mon Dec 27, 2021 1:23 am

It shouldn't matter, there's no high current or fast switching going on on that line.

A few more things to check:
* Just to be sure that your Tx/Rx path does work, what happens if you connect a terminal (e.g. Putty) to the COM-port? Use 115200 baud, n81. You may need to force EN momentarily low by shorting it to ground after you start the terminal program. What does it say?
* If you hard-wire IO0 to be low, can you flash the device?

EDIT: Ah, I think I see another issue... It looks like you wired the TxD of the CP2102 to the TxD of the ESP32 and same with the RxD. It should be switched: TxD of the ESP32 should go to the RxD of the CP2102 and vice versa.

rbshah7388
Posts: 13
Joined: Thu May 12, 2016 1:32 pm

Re: Unable to access custom ESP32 over Serial/USB

Postby rbshah7388 » Mon Dec 27, 2021 10:52 am

I think TXD of CP2102 is rightly connected to RXD of ESP32. May I know where have you noticed that thing?

Let me try the other things you have mentioned.

rbshah7388
Posts: 13
Joined: Thu May 12, 2016 1:32 pm

Re: Unable to access custom ESP32 over Serial/USB

Postby rbshah7388 » Mon Dec 27, 2021 11:15 am

Update: Putty isn't showing anything, any prints.

rbshah7388
Posts: 13
Joined: Thu May 12, 2016 1:32 pm

Re: Unable to access custom ESP32 over Serial/USB

Postby rbshah7388 » Mon Dec 27, 2021 1:33 pm

Hi,
This is little urgent. is there anyway I can send the schematics file and PCB layout privately? Can you suggest me other ways to debug the issue?

rbshah7388
Posts: 13
Joined: Thu May 12, 2016 1:32 pm

Re: Unable to access custom ESP32 over Serial/USB

Postby rbshah7388 » Mon Dec 27, 2021 1:50 pm

1. Loopback test is working alright for CP2102N IC - disconnected R19, R20 on my schematics and then shorted RXD, TXD of CP2102N and it is working well. Image attached.

2. The module I am using is ESP32-WROOM-32U, so looks like something is wrong on that side.
Attachments
loop-back test working alright.PNG
loop-back test working alright.PNG (120.29 KiB) Viewed 20390 times

rbshah7388
Posts: 13
Joined: Thu May 12, 2016 1:32 pm

Re: Unable to access custom ESP32 over Serial/USB

Postby rbshah7388 » Mon Dec 27, 2021 2:15 pm

Finally managed to get these prints on putty - after properly having 4.7k pull up and 4.7uF to gnd on EN pin. Still firmware erase is not being done.

Code: Select all

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6932
load:0x40078000,len:13712
load:0x40080400,len:4260
entry 0x400806e4
I (70) boot: Chip Revision: 1
I (70) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (39) boot: ESP-IDF v4.0.1-193-ge7ac221 2nd stage bootloader
I (39) boot: compile time 02:47:00
I (39) boot: Enabling RNG early entropy source...
I (44) boot: SPI Speed      : 40MHz
I (49) boot: SPI Mode       : DIO
I (53) boot: SPI Flash Size : 4MB
I (57) boot: Partition Table:
I (60) boot: ## Label            Usage          Type ST Offset   Length
I (68) boot:  0 phy_init         RF data          01 01 0000f000 00001000
I (75) boot:  1 otadata          OTA data         01 00 00010000 00002000
I (82) boot:  2 nvs              WiFi data        01 02 00012000 0000e000
I (90) boot:  3 at_customize     unknown          40 00 00020000 000e0000
I (97) boot:  4 ota_0            OTA app          00 10 00100000 00180000
I (105) boot:  5 ota_1            OTA app          00 11 00280000 00180000
I (112) boot: End of partition table
I (117) boot_comm: chip revision: 1, min. application chip revision: 0
I (124) esp_image: segment 0: paddr=0x00100020 vaddr=0x3f400020 size=0x29230 (16                                                                             8496) map
I (193) esp_image: segment 1: paddr=0x00129258 vaddr=0x3ffbdb60 size=0x03974 ( 1                                                                             4708) load
I (199) esp_image: segment 2: paddr=0x0012cbd4 vaddr=0x40080000 size=0x00400 (                                                                               1024) load
I (200) esp_image: segment 3: paddr=0x0012cfdc vaddr=0x40080400 size=0x03034 ( 1                                                                             2340) load
I (214) esp_image: segment 4: paddr=0x00130018 vaddr=0x400d0018 size=0x1068cc (1                                                                             075404) map
I (602) esp_image: segment 5: paddr=0x002368ec vaddr=0x40083434 size=0x195c8 (10                                                                             3880) load
I (646) esp_image: segment 6: paddr=0x0024febc vaddr=0x400c0000 size=0x00064 (                                                                                100) load
I (664) boot: Loaded app from partition at offset 0x100000
I (664) boot: Disabling RNG early entropy source...
BLUFI BLE is not connected yet
2.1.0
max tx power=78,ret=0

Who is online

Users browsing this forum: No registered users and 201 guests