ESP32/esptool.py: what can be the reason for esptool.py reporting connection problems, while connection works fine in general?

73 views Asked by At

Maybe not a StackOverflow question, but I didn't find a better candidate in the StackExchange ecosystem..

I'm struggling with bringing new firmware to a ESP32-S3 based device using esptool.py (v4.7.0). The error I get is No serial data received:

$ esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 9600 erase_flash
esptool.py v4.7.0
Serial port /dev/ttyACM0
Connecting......................................

A fatal error occurred: Failed to connect to ESP32-S3: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

While flashing this device worked once, I now get the above error in 100% cases, no exceptions.

Here is what I tried:

  • ☑️ access to /dev/ttyACM0 (name, permissions)
  • ☑️ check different USB-C cables / turn around cable
  • ☑️ check/lower/experiment with baud rate
  • ☑️ check different commands (chip_id, baud-rates)
  • ☑️ no other processes access /dev/ttyACM0
  • ☑️ (rshell which also connects to /dev/ttyACM0 works well)
  • ☑️ tried different host system
  • ☑️ checked esptool version
  • ☑️ tried pressing the boot / reset buttons before and while the the "connection" phase with different timings
  • ☑️ attach / remove a battery (it's a Adafruit ESP32-S3 Feather with battery support)
  • ☑️ remove anything attached to the GPIOs (nothing connected at all)
  • ☑️ checked output of dmesg (nothing strange)
  • ☑️ "inspected" output of --trace

.. but all without any visible effect or insights..

Strangely connecting to the very same device on the very same machine using the very same cable and connection options using rshell works well and a REPL can be spawned:

$ rshell --port /dev/ttyACM0 --baud 9600 repl                                                                                                                                                         Using buffer-size of 32
Connecting to /dev/ttyACM0 (buffer-size 32)...
Trying to connect to REPL  connected
Retrieving sysname ... esp32
Testing if ubinascii.unhexlify exists ... Y
Retrieving root directories ... 
Setting time ... Feb 06, 2024 13:15:23
Evaluating board_name ... pyboard
Retrieving time epoch ... Jan 01, 2000
Entering REPL. Use Control-X to exit.
>
MicroPython v1.22.1 on 2024-01-05; Generic ESP32S3 module with ESP32S3
Type "help()" for more information.
>>> 

Before I give up and throw away the little device, is there something else I could try?


Output of --trace

$ esptool.py --trace --chip esp32 --port /dev/ttyACM0 --baud 9600 erase_flash
esptool.py v4.7.0
Serial port /dev/ttyACM0
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.101 No serial data received.
.TRACE +0.051 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.101 No serial data received.
.TRACE +0.051 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=

...
... (repeated output)
... 

TRACE +0.101 No serial data received.
.

A fatal error occurred: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
0

There are 0 answers