RenegadeAndy
RenegadeAndy

Reputation: 5690

ESP32 Flashing upload starts and fails with timeout

I have an ESP32-WROOM, as seen here.

In the Arduino IDE, I compile and verify my sketch, and then attempt an upload.

I get the following error:

esptool.py v2.1
Connecting........___
Chip is ESP32D0WDQ6 (revision (unknown 0xa))
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB
Compressed 8192 bytes to 47...

A fatal error occurred: Timed out waiting for packet content
A fatal error occurred: Timed out waiting for packet content

Invalid library found in /Users/me/Documents/Arduino/hardware/espressif/esp32/libraries/BLE: no headers files (.h) found in /Users/me/Documents/Arduino/hardware/espressif/esp32/libraries/BLE
Invalid library found in /Users/me/Documents/Arduino/hardware/espressif/esp32/libraries/BLE: no headers files (.h) found in /Users/me/Documents/Arduino/hardware/espressif/esp32/libraries/BLE

I am using these settings in the IDE for the upload:

enter image description here

I changed the baud rate to 115200, and then also watched the serial monitor, where i saw the following messages appear:

ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0371 
⸮ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x23 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
ts Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 37⸮ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x23 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
ts Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x23 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
ts Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 37ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x23 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
ts Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
(SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
⸮ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x23 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
ts Jun  8 2016 00:22:57

This is followed by:

esptool.py v2.1 Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch _

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header on the Arduino IDE.

Please help me to understand what I need to do to make this sketch upload work direct to the ESP chip.

Upvotes: 0

Views: 17010

Answers (6)

Terry Neckar
Terry Neckar

Reputation: 137

Put a 10uf capacitor on the EN line, with the + side on EN and the - side to ground.

Upvotes: 0

Marcos Ventura
Marcos Ventura

Reputation: 1

Try to load without any connection. I did it and load well. I was connection one by one and the got error when I connect D12. I find a reference that tell load error if D12 was high. Then I put a resistor of 2K2 connecting D2 to ground end ESP32 load well.

Upvotes: 0

vic
vic

Reputation: 1

i had the same problem on custom board. According to datasheet to put ESP32 in download mode you need to have IO2(n24) and IO0(25) to 0, in my case i had some sensors connected to IO2 . Also from datasheet:" * Pins SCK/CLK, SDO/SD0, SDI/SD1, SHD/SD2, SWP/SD3 and SCS/CMD, namely, GPIO6 to GPIO11 are connected to the integrated SPI flash integrated on the module and are not recommended for other uses."

Upvotes: 0

nickD
nickD

Reputation: 141

You can make the ESP32 automatically go into flash mode by connecting a 10uF electrolytic capacitor between EN and GND. Make sure you observer the capacitor's polarity. You can solder the capacitor onto the ESP32 board, as shown in the attached image. How to add an auto-enter-flash-mode capacitor on an ESP32

Credit should go to Make ESP32 auto-enter flash mode

Upvotes: 1

Asim Ali Khan
Asim Ali Khan

Reputation: 19

One should need to disconnect the Vin pin until the code is successfully uploaded and keep pressing the BOOT button while uploading the sketch until the Connecting.. line disappears.

Upvotes: 1

Alex
Alex

Reputation: 21

You want the 115200 baud setting.

I believe you are getting this error because the ESP32 is not in flash mode. Your computer is timing out waiting for the ESP32.

Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch _

Hold both the BOOT and EN, then release EN. If you have two button on your device, hold one and press the other. If that doesn't work then try the other hold/press button combination :)

Upvotes: 0

Related Questions