Cannot flash ESP32S3 - RTS & DTR - Page 1
Forum section: electronics / general

author: ppTRN
author_rank: Regular Contributor
timestamp: February 03, 2025, 08:41:35 pm
content: 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 outputsCode:invalid heade�ESP-ROM:esp32s3-20210327Build:Mar 27 2021rst:0x7 (TG0WDT_SYS_RST),boot:0x28 (SPI_FAST_FLASH_BOOT)Saved PC:0x40049b21invalid header: 0xfffffffflike 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!!

author: PlainName
author_rank: Super Contributor
timestamp: February 03, 2025, 09:11:21 pm
content: Any chance of a proper schematic so we can see how it's meant to be connected?

author: ppTRN
author_rank: Regular Contributor
timestamp: February 03, 2025, 09:24:53 pm
content: 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.

author: PlainName
author_rank: Super Contributor
timestamp: February 03, 2025, 10:43:01 pm
content: QuoteIt's essentially a netlist. I looked at it and saw ESPen on U2.3 and R15/SW1. Didn't spot that it isalsoQ1.3. Spent some time checking the entire thing to make sure TX goes to only one pin (easy mistake - there is also a TX1which 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.

author: peter-h
author_rank: Super Contributor
timestamp: February 03, 2025, 11:12:13 pm
content: Very rare for RS232 toactuallyuse RTS & DTR these days.I do serial comms for a living - since c. 1975.

author: Peabody
author_rank: Super Contributor
timestamp: February 03, 2025, 11:49:57 pm
content: 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?

author: tooki
author_rank: Super Contributor
timestamp: February 04, 2025, 12:29:43 am
content: Quote from: peter-h on February 03, 2025, 11:12:13 pmMost 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 onhttps://dl.espressif.com/dl/schematics/esp32_devkitc_v4_sch.pdffor example.

author: bookaboo
author_rank: Frequent Contributor
timestamp: February 04, 2025, 02:02:39 pm
content: 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.pdfSo 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-7223bbfc9fa1Using an ESP-PROG with direct connection (no converter chip on your PCB) is probably the easiest fix.

author: ppTRN
author_rank: Regular Contributor
timestamp: February 04, 2025, 05:24:59 pm
content: 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