esptool cannot connect to my board: Wrong boot mode detected (0x13)

MarusGradinaru
Posts: 5
Joined: Mon Jun 09, 2025 7:05 pm

esptool cannot connect to my board: Wrong boot mode detected (0x13)

Postby MarusGradinaru » Tue Jun 10, 2025 8:45 pm

Hi,

If I use the esptool to access something on my ESP32 device (like "esptool flash_id"), it fail and says it cannot connect because the device cannot be switched to bootloader mode. A few times it worked, but most of the time it fails with this error:

Code: Select all

esptool.py v4.8.1
Serial port COM3
Connecting......................................
A fatal error occurred: Failed to connect to Espressif device: Wrong boot mode detected (0x13)! The chip needs to be in download mode.

This happens only for auto connect. If I manually press the BOOT button while connecting, it succeeds every time !

My setup is: a laptop with Windows 10, and a ESP32-DevKitC-VE with WROVER-E N8R8. The board was purchased from the official Espressif store on Aliexpress and it has auto-upload capabilities (using DTR/RTS). I installed the official CP210x_Universal_Windows_Driver and the board is successfully detected on COM3. Then I installed Arduino IDE and VSCode with the Platform IO extension. Nothing works...

Sprite
Espressif staff
Espressif staff
Posts: 10599
Joined: Thu Nov 26, 2015 4:08 am

Re: esptool cannot connect to my board: Wrong boot mode detected (0x13)

Postby Sprite » Wed Jun 11, 2025 9:04 am

Does it work when you switch into download mode manually? (Hold boot button, press and release reset button)

MarusGradinaru
Posts: 5
Joined: Mon Jun 09, 2025 7:05 pm

Re: esptool cannot connect to my board: Wrong boot mode detected (0x13)

Postby MarusGradinaru » Wed Jun 11, 2025 9:09 am

Yes ! It works every time, with any version, if I press and hold the BOOT button while esptool tries to connect.

Sprite
Espressif staff
Espressif staff
Posts: 10599
Joined: Thu Nov 26, 2015 4:08 am

Re: esptool cannot connect to my board: Wrong boot mode detected (0x13)

Postby Sprite » Wed Jun 11, 2025 9:29 am

Could be a timing issue. A hack that usually works is to add a capacitor (try 1 to 10uF) between EN and GND.

MarusGradinaru
Posts: 5
Joined: Mon Jun 09, 2025 7:05 pm

Re: esptool cannot connect to my board: Wrong boot mode detected (0x13)

Postby MarusGradinaru » Wed Jun 11, 2025 10:04 am

I've done some testing...

I usesd in esptool.cfg "custom_reset_sequence = D1|W3|D0|W3". Just to see if the signals are present and they have correct polarity.
When I executed "esptool flash_id", the level at IO0 (boot) pin indeed goes from HIGH to LOW and back, while the EN pin stays HIGH.

Then I checked the other line with "custom_reset_sequence = R1|W3|R0|W3".
When I executed "esptool flash_id", the voltage level at EN pin indeed goes from HIGH to LOW and back, but ! the IO0 (boot) pin goes too from HIGH (3.3V) to some LOW level of 0.2V ! Maybe because the chip is in reset state and the voltage is not present ?

Is this normal so far ?

I will try with the capacitor on EN pin too, but lets see if I can, because everyting on that board is so small...

Edit:
It seems that when esptool toggle the RTS line the DTR output pin of CP2102N drops to 0.65V. I don't understand why DTR is changed if I only toggled the RTS from software...
Last edited by MarusGradinaru on Wed Jun 11, 2025 10:44 am, edited 3 times in total.

MarusGradinaru
Posts: 5
Joined: Mon Jun 09, 2025 7:05 pm

Re: esptool cannot connect to my board: Wrong boot mode detected (0x13)

Postby MarusGradinaru » Fri Jun 13, 2025 8:01 pm

I added 1uF capacitor between the EN pin and ground and now it works perfectly ! Thanks ! :D
Why do yo not include it on the board ?

Who is online

Users browsing this forum: PetalBot, YisouSpider and 2 guests