Timeout on upload using JTAG on ESP32-S3 rev 2

frankcohen
Posts: 25
Joined: Mon Apr 05, 2021 4:03 am

Timeout on upload using JTAG on ESP32-S3 rev 2

Postby frankcohen » Fri Jun 14, 2024 4:18 pm

This used to work correctly. Now with the ESP32-S3 rev 2 I get a timeout error on compile-and-upload in Arduino IDE 2.3.2. Any ideas?

Code: Select all

Sketch uses 286037 bytes (8%) of program storage space. Maximum is 3342336 bytes.
Global variables use 19056 bytes (5%) of dynamic memory, leaving 308624 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port /dev/cu.usbmodem141101
Connecting...
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 64:e8:33:60:42:c4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600

A fatal error occurred: No serial data received.
Failed uploading: uploading error: exit status 2
Here are my settings:

Code: Select all

Using Arduino IDE 2.x, use Tools menu options:
Board: ESP32S3 Dev Module
USB CDC On Boot: Enabled
Core Debug Level: Error
USB DFU On Boot: Disabled
Erase All Flash Before Sketch Upload: Disabled
Events Run On: Core 1
Flash Mode: QIO 80 Mhz
Flash Size: 8 MB (64MB)
JTAG Adapter: Integrated USB JTAG
Arduino Runs On: Core 1
USB Firmware MSC On Boot: Disabled
Partition Scheme: 8MB with Spiffs
PSRAM: Disabled
Upload Mode: UART0/Hardware CDC
Upload Speed 921600
USB Mode: Hardware CDC and JTAG
I am able to upload once I use the Boot and Reset buttons to get the ESP32 into bootloader mode. I press and hold Boot, then press and release Reset. I didn't need bootloader mode in the past.

Any help, much appreciated.

-Frank

PeterZ
Posts: 1
Joined: Tue Jun 18, 2024 9:01 pm

Re: Timeout on upload using JTAG on ESP32-S3 rev 2

Postby PeterZ » Tue Jun 18, 2024 9:21 pm

Found your post while looking for the same issue.
After more digging i solved the problem by updating the esptool_py to the latest (4.7). Version 4.5.1 which, looking at the log, your Arduino uses is causing these problems (stub goes into ram and then fails).
Just checked - Arduino 2.3.2 installs esptool_py 4.6, maybe update will do the job?
I'm using plarformio and it could really use an update (still on 4.5.1).
I fixed it by creating a post-buld type python script which checks if the esptool is installed in the Platformio venv, if not installs it and replaces the "UPLOADER" variable to use it instead of the default one.
Here is the script:
  1. '''
  2. 06.2024 - Issues with uploading firmware to the ESP32-S3
  3. via USB UART/JTAG interface. After uploading the stub into RAM
  4. the process fails with message
  5.  
  6. A fatal error occurred: No serial data received.
  7. Failed uploading: uploading error: exit status 2
  8.  
  9. Temporary solution until the esptool gets updated in the ESP32
  10. core for PlatformIO:
  11. This script installs the newest esptool into the platformio
  12. environment and uses it as upload tool, fixing the problem.
  13.  
  14. Usage: save this scripts as
  15.  
  16. esptool_replace.py
  17.  
  18. in the root dir of the project (where the platformio.ini is)
  19. In the platformio.ini file add:
  20.  
  21. extra_scripts = esptool_replace.py
  22.  
  23. P.Z. 2024
  24.  
  25. '''
  26. Import("env")
  27. import os
  28. import inspect
  29.  
  30. try:
  31.     import esptool
  32. except ImportError:
  33.     env.Execute("$PYTHONEXE -m pip install esptool")
  34. # get the path to the installed esptool
  35. dir = inspect.getfile(esptool)
  36. # replace the uploader variable with the installed esptool
  37. env.Replace(UPLOADER=dir)

Who is online

Users browsing this forum: Bing [Bot] and 77 guests