Author Topic: Cannot flash ESP32S3 - RTS & DTR  (Read 1004 times)

0 Members and 1 Guest are viewing this topic.

Offline ppTRNTopic starter

  • Regular Contributor
  • *
  • Posts: 151
  • Country: it
Cannot flash ESP32S3 - RTS & DTR
« on: February 03, 2025, 08:41:35 pm »
Good evening,
I made a custom esp32s3 board that does not want to be flashed.
Schematic is attached and I really cannot understand what is going on.

The serial output is constantly outputing "invalid header: 0xffffffff" and sometimes it also outputs

Code: [Select]
invalid heade�ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x28 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40049b21
invalid header: 0xffffffff

like it resets or something.
I have used ESP32S2 before and flashed it using two buttons, but this time with the S3 i wanted to try the automatic flashing using RTS and DTR, that I tought that was working correctly. But now I am looking at the oscilloscope, and i find 3.3V fixed on both IO0 and EN pin of the ESP32.

I am using a SH-U06A uart bridge.

When I try to load a program it says "A fatal error occurred: Failed to connect to ESP32-S3: No serial data received." But i do not think it is true since I can see both TX and RX leds turning on on the bridge.

Any suggestions?  Thanks!!
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7622
  • Country: va
Re: Cannot flash ESP32S3 - RTS & DTR
« Reply #1 on: February 03, 2025, 09:11:21 pm »
Any chance of a proper schematic so we can see how it's meant to be connected?
 

Offline ppTRNTopic starter

  • Regular Contributor
  • *
  • Posts: 151
  • Country: it
Re: Cannot flash ESP32S3 - RTS & DTR
« Reply #2 on: February 03, 2025, 09:24:53 pm »
Well, that is taken from the whole schematic. I think there is all regarding the flashing of the esp, Tx and Rx directly connected to the microcontroller (yes, I swapped them in the UART bridge) RTS and DTR going throught that circuit, identical to the one shown in many esp dev board.

What other parts of the schematic do you think are relevant? I only posted these ones in order to make the reading easier and because nothing else is connected to the pins used to program the esp.
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7622
  • Country: va
Re: Cannot flash ESP32S3 - RTS & DTR
« Reply #3 on: February 03, 2025, 10:43:01 pm »
Quote
What other parts of the schematic do you think are relevant?

It's essentially a netlist. I looked at it and saw ESPen on U2.3 and R15/SW1. Didn't spot that it is also Q1.3. Spent some time checking the entire thing to make sure TX goes to only one pin (easy mistake - there is also a TX1 which can be confused with it).


Why not just draw the wires so it is obvious what is connected to where, and easy to digest with no chance of mistake? I gave up - life's too short for even this trivial thing.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 4501
  • Country: gb
  • Doing electronics since the 1960s...
Re: Cannot flash ESP32S3 - RTS & DTR
« Reply #4 on: February 03, 2025, 11:12:13 pm »
Very rare for RS232 to actually use RTS & DTR these days.

I do serial comms for a living - since c. 1975.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2317
  • Country: us
Re: Cannot flash ESP32S3 - RTS & DTR
« Reply #5 on: February 03, 2025, 11:49:57 pm »
That's the same circuit I see on an ESP8266 board, except they pull down GPIO0 and Reset on that chip, and there are no 10K resistors.  Could it have anything to do with your misspelling of DTR as "DRT".  Is it correct elsewhere, so it's just not connected?
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13348
  • Country: ch
Re: Cannot flash ESP32S3 - RTS & DTR
« Reply #6 on: February 04, 2025, 12:29:43 am »
Very rare for RS232 to actually use RTS & DTR these days.

I do serial comms for a living - since c. 1975.
Most ESP32 boards use RTS and DTS, through some transistors, to sequence the bootstrap pins so that the MCU can be flashed without the user needing to sequence the bootstrap pins manually. See the schematic and truth table at the lower left on https://dl.espressif.com/dl/schematics/esp32_devkitc_v4_sch.pdf for example.
 

Offline bookaboo

  • Frequent Contributor
  • **
  • Posts: 766
  • Country: ie
Re: Cannot flash ESP32S3 - RTS & DTR
« Reply #7 on: February 04, 2025, 02:02:39 pm »
Everything you are seeing is normal for a blank ESP32-S3, the problem is that your RTS and DTS are not working correctly to put the chip into bootloader mode. If you do the sequence manually with jumper wires then your device will enter bootloader mode and accept your *.bin.

Espressif do implement this on their devkits , see the truth table : https://dl.espressif.com/dl/schematics/SCH_ESP32-S3-DevKitC-1_V1.1_20220413.pdf

So either your SH-U06A is not compatible with the truth table, or there is some mistake on the PCB, you should be able to see activity on these pins when you flash.

Other possibilities is that its a driver configuration :
https://www.hackster.io/news/brian-lough-s-esp32-trinity-aims-to-simplify-wiring-up-large-format-rgb-led-matrix-panels-7223bbfc9fa1


Using an ESP-PROG with direct connection (no converter chip on your PCB) is probably the easiest fix.
 

Offline ppTRNTopic starter

  • Regular Contributor
  • *
  • Posts: 151
  • Country: it
Re: Cannot flash ESP32S3 - RTS & DTR
« Reply #8 on: February 04, 2025, 05:24:59 pm »
Thank you, I tought that the behaviour of both signal was a standard and it did not had any connection with the hardware used. Anyway, as a solution i just put another button for the IO0 pin and it works. Next rev will have this solution
 
The following users thanked this post: bookaboo


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf