title: ESP32 Flashing upload starts and fails with timeout
body: <p>I have an ESP32-WROOM, <a href="https://www.mouser.co.uk/ProductDetail/356-ESP-WROOM-32" rel="nofollow noreferrer">as seen here</a>.</p>
  
  <p>In the Arduino IDE, I compile and verify my sketch, and then attempt an upload.</p>
  
  <p>I get the following error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I am using these settings in the IDE for the upload:</p>
  
  <p><a href="https://i.stack.imgur.com/aUukm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aUukm.png" alt="enter image description here"></a></p>
  
  <p>I changed the baud rate to 115200, and then also watched the serial monitor, where i saw the following messages appear:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>This is followed by:</p>
  
  <p>esptool.py v2.1
  Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch
  _</p>
  
  <p>A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header on the Arduino IDE.</p>
  
  <p>Please help me to understand what I need to do to make this sketch upload work direct to the ESP chip.</p>