Xinyuan-LilyGO / T-Display-S3

MIT License
733 stars 174 forks source link

Random ERROR: A fatal error occurred: Unable to verify flash chip connection (No serial data received.) #138

Closed igoralves1 closed 1 year ago

igoralves1 commented 1 year ago

I am using a LilyGO/T-Display-S3 no touch screen in a MAC Monterey 12.6.3 M1. The board was working good since I bought (2-3 weeks ago).

I am using ARDUINO 2.0.5 and ESP-IDF ESP-IDF v5.1-dev-4264-g81e1e65995-dirty.

This is my ls /dev/* ESP-32 PORT: /dev/cu.usbmodem2101 and /dev/tty.usbmodem2101

Screen Shot 2023-04-08 at 7 51 46 PM

ARDUINO is recognizing /dev/cu.usbmodem2101:

Screen Shot 2023-04-08 at 7 54 01 PM

Today suddenly, when I try to upload the code to the ESP32 (using ARDUINO or ESP-IDF) I am getting the following error:

ARDUINO

Sketch uses 255229 bytes (8%) of program storage space. Maximum is 3145728 bytes.
Global variables use 19748 bytes (6%) of dynamic memory, leaving 307932 bytes for local variables. Maximum is 327680 bytes.
"/Users/igoralves/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool" --chip esp32s3 --port "/dev/cu.usbmodem2101" --baud 115200  --before default_reset --after hard_reset write_flash -e -z --flash_mode dio --flash_freq 80m --flash_size 16MB 0x0 "/private/var/folders/s7/n7q5z_t15zq5q0xxgvf0kmth0000gn/T/arduino/sketches/FD60E3BBC6BA87A896714DB177A1FF9B/moisture_sensor.ino.bootloader.bin" 0x8000 "/private/var/folders/s7/n7q5z_t15zq5q0xxgvf0kmth0000gn/T/arduino/sketches/FD60E3BBC6BA87A896714DB177A1FF9B/moisture_sensor.ino.partitions.bin" 0xe000 "/Users/igoralves/Library/Arduino15/packages/esp32/hardware/esp32/2.0.7/tools/partitions/boot_app0.bin" 0x10000 "/private/var/folders/s7/n7q5z_t15zq5q0xxgvf0kmth0000gn/T/arduino/sketches/FD60E3BBC6BA87A896714DB177A1FF9B/moisture_sensor.ino.bin" 
esptool.py v4.5.1
Serial port /dev/cu.usbmodem2101
Connecting...............
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 34:85:18:71:50:88
Uploading stub...
Running stub...
Stub running...

A fatal error occurred: Unable to verify flash chip connection (No serial data received.).
Failed uploading: uploading error: exit status 2

ESP-IDF

Project build complete. To flash, run this command:
/Users/igoralves/.espressif/python_env/idf5.1_py3.9_env/bin/python ../../../esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32s3  write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x20000 build/tls_mutual_auth.bin
or run 'idf.py -p (PORT) flash'
Executing action: flash
Running ninja in directory /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build
Executing "ninja flash"...
[1/5] cd /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build/esp-idf/esptool_py && /Users/igoralves/.espressif/python_env/idf5.1_py3.9_env/bin/python /Users/igoralves/esp/esp-aws-iot/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build/partition_table/partition-table.bin /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build/tls_mutual_auth.bin
tls_mutual_auth.bin binary size 0xd7910 bytes. Smallest app partition is 0x100000 bytes. 0x286f0 bytes (16%) free.
[2/5] Performing build step for 'bootloader'
[1/1] cd /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build/bootloader/esp-idf/esptool_py && /Users/igoralves/.espressif/python_env/idf5.1_py3.9_env/bin/python /Users/igoralves/esp/esp-aws-iot/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build/bootloader/bootloader.bin
Bootloader binary size 0x51c0 bytes. 0x2e40 bytes (36%) free.
[2/3] cd /Users/igoralves/esp/esp-aws-iot/esp-idf/components/esptool_py && /opt/local/bin/cmake -D IDF_PATH=/Users/igoralves/esp/esp-aws-iot/esp-idf -D "SERIAL_TOOL=/Users/igoralves/.espressif/python_env/idf5.1_py3.9_env/bin/python;;/Users/igoralves/esp/esp-aws-iot/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s3" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build -P /Users/igoralves/esp/esp-aws-iot/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool esp32s3 -p /dev/cu.usbmodem2101 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 2MB 0x0 bootloader/bootloader.bin 0x20000 tls_mutual_auth.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.5.1
Serial port /dev/cu.usbmodem2101

A fatal error occurred: Could not open /dev/cu.usbmodem2101, the port doesn't exist
CMake Error at run_serial_tool.cmake:63 (message):

  /Users/igoralves/.espressif/python_env/idf5.1_py3.9_env/bin/python;;/Users/igoralves/esp/esp-aws-iot/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s3
  failed.

FAILED: CMakeFiles/flash /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build/CMakeFiles/flash 
cd /Users/igoralves/esp/esp-aws-iot/esp-idf/components/esptool_py && /opt/local/bin/cmake -D IDF_PATH=/Users/igoralves/esp/esp-aws-iot/esp-idf -D "SERIAL_TOOL=/Users/igoralves/.espressif/python_env/idf5.1_py3.9_env/bin/python;;/Users/igoralves/esp/esp-aws-iot/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32s3" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build -P /Users/igoralves/esp/esp-aws-iot/esp-idf/components/esptool_py/run_serial_tool.cmake
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build/log/idf_py_stderr_output_49290 and /Users/igoralves/esp/esp-aws-iot/examples/mqtt/tls_mutual_auth/build/log/idf_py_stdout_output_49290

This is a random error. Sometimes the upload works well sometimes I get the error. See the Clock in my computer. At 7:26 it worked well. I could upload without error.

Screen Shot 2023-04-08 at 7 26 28 PM

At 7:27 when I try to upload again it stops in the Connecting step. It is taking more time than usual in this step.

Screen Shot 2023-04-08 at 7 27 26 PM

At 7:28 I get the error. Note that the Serial port /dev/cu.usbmodem2101 is correct !

Screen Shot 2023-04-08 at 7 28 43 PM

What is wired is that the data is flowing into the Serial Monitor:

Screen Shot 2023-04-08 at 7 28 11 PM

And that is the OUTPUT tab:

Screen Shot 2023-04-08 at 7 29 31 PM

At 7:30 I repeat again and I get the same error:

Screen Shot 2023-04-08 at 7 30 49 PM

But this time I get no Serial Monitor data:

Screen Shot 2023-04-08 at 7 30 59 PM

At 7:32 I repat again and get the same issue

Screen Shot 2023-04-08 at 7 32 09 PM

I tried to repeat this process many times today and in 10% I get success. I have changed nothing in the ARDUINO TOOLS configuration.

Do you guys have an idea what could probably be that? Is it something related to a HARDWARE issue?

I am about to buy another ESP32S3 to test but I would like to hear from the community to move forward.

lewisxhe commented 1 year ago

Try holding down the BOOT button (do not release it), insert it into USB, and then release the BOOT button , Try again to see if it works However, in my experience, this should be a flash damage. If possible, you can try replacing a flash, which can be repaired most of the time, but not as a percentage

igoralves1 commented 1 year ago

@lewisxhe thanks again. It is working after I press the boot btn. But the Connecting ..... step takes more time than usual. And finally after some time the Serial monitor stops to work after some minutes.

When I try to upload again, I get the same error. See below:

Screen Shot 2023-04-10 at 9 42 32 AM

I think seems to be a hardware issue.

lewisxhe commented 1 year ago

Yes, I also think it is a hardware problem, as I said above, you can try to replace the flash, if you can.