Failed to connect to ESP32-C2: Invalid head of packet (0x12): Possible serial noise or corruption.

vrambo8
Posts: 1
Joined: Mon Dec 02, 2024 11:17 pm

Failed to connect to ESP32-C2: Invalid head of packet (0x12): Possible serial noise or corruption.

Postby vrambo8 » Mon Dec 02, 2024 11:29 pm

I have a custom chip with an ESP8684-WROOM-02UC, I have been following this https://docs.espressif.com/projects/esp ... setup.html for flashing a sample application onto the chip. But when I try to flash the firmware onto it, I always receive the data corruption error in the title: Invalid head of packet (0x12): Possible serial noise or corruption.

I have tried multiple baud rates, and I have also tried establishing a serial connection through screen or PuTTY, I always get gibberish as an output. I have tried using a CH340G usb-uart adapter, then I changed to a CP210x adapter. No luck.

I am starting to think the chip has hardware issues, though I don't know much about it, I'm a software person but no hardware experience. Does anybody know what I could do?

Thank you in advance
  1. hello_world idf.py -p /dev/cu.usbserial-0001 -b 115200 flash
  2. Executing action: flash
  3. Running ninja in directory /Users/vitto/Desktop/esp/hello_world/build
  4. Executing "ninja flash"...
  5. [4/901] Generating ../../partition_table/partition-table.bin
  6. Partition table binary generated. Contents:
  7. *******************************************************************************
  8. # ESP-IDF Partition Table
  9. # Name, Type, SubType, Offset, Size, Flags
  10. nvs,data,nvs,0x9000,24K,
  11. phy_init,data,phy,0xf000,4K,
  12. factory,app,factory,0x10000,1M,
  13. *******************************************************************************
  14. [892/901] Performing configure step for 'bootloader'
  15. -- Found Git: /usr/bin/git (found version "2.39.5 (Apple Git-154)")
  16. -- The C compiler identification is GNU 14.2.0
  17. -- The CXX compiler identification is GNU 14.2.0
  18. -- The ASM compiler identification is GNU
  19. -- Found assembler: /Users/vitto/.espressif/tools/riscv32-esp-elf/esp-14.2.0_20240906/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
  20. -- Detecting C compiler ABI info
  21. -- Detecting C compiler ABI info - done
  22. -- Check for working C compiler: /Users/vitto/.espressif/tools/riscv32-esp-elf/esp-14.2.0_20240906/riscv32-esp-elf/bin/riscv32-esp-elf-gcc - skipped
  23. -- Detecting C compile features
  24. -- Detecting C compile features - done
  25. -- Detecting CXX compiler ABI info
  26. -- Detecting CXX compiler ABI info - done
  27. -- Check for working CXX compiler: /Users/vitto/.espressif/tools/riscv32-esp-elf/esp-14.2.0_20240906/riscv32-esp-elf/bin/riscv32-esp-elf-g++ - skipped
  28. -- Detecting CXX compile features
  29. -- Detecting CXX compile features - done
  30. -- Building ESP-IDF components for target esp32c2
  31. -- Project sdkconfig file /Users/vitto/Desktop/esp/hello_world/sdkconfig
  32. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/riscv/ld/rom.api.ld
  33. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/soc/esp32c2/ld/esp32c2.peripherals.ld
  34. -- Bootloader project name: "bootloader" version: 1
  35. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/esp_rom/esp32c2/ld/esp32c2.rom.ld
  36. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/esp_rom/esp32c2/ld/esp32c2.rom.api.ld
  37. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/esp_rom/esp32c2/ld/esp32c2.rom.rvfp.ld
  38. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/esp_rom/esp32c2/ld/esp32c2.rom.wdt.ld
  39. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/esp_rom/esp32c2/ld/esp32c2.rom.systimer.ld
  40. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/esp_rom/esp32c2/ld/esp32c2.rom.version.ld
  41. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/esp_rom/esp32c2/ld/esp32c2.rom.newlib.ld
  42. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/bootloader/subproject/main/ld/esp32c2/bootloader.ld
  43. -- Adding linker script /Users/vitto/Desktop/esp/esp-idf/components/bootloader/subproject/main/ld/esp32c2/bootloader.rom.ld
  44. -- Components: bootloader bootloader_support efuse esp_app_format esp_bootloader_format esp_common esp_hw_support esp_rom esp_security esp_system esptool_py freertos hal log main micro-ecc newlib partition_table riscv soc spi_flash
  45. -- Component paths: /Users/vitto/Desktop/esp/esp-idf/components/bootloader /Users/vitto/Desktop/esp/esp-idf/components/bootloader_support /Users/vitto/Desktop/esp/esp-idf/components/efuse /Users/vitto/Desktop/esp/esp-idf/components/esp_app_format /Users/vitto/Desktop/esp/esp-idf/components/esp_bootloader_format /Users/vitto/Desktop/esp/esp-idf/components/esp_common /Users/vitto/Desktop/esp/esp-idf/components/esp_hw_support /Users/vitto/Desktop/esp/esp-idf/components/esp_rom /Users/vitto/Desktop/esp/esp-idf/components/esp_security /Users/vitto/Desktop/esp/esp-idf/components/esp_system /Users/vitto/Desktop/esp/esp-idf/components/esptool_py /Users/vitto/Desktop/esp/esp-idf/components/freertos /Users/vitto/Desktop/esp/esp-idf/components/hal /Users/vitto/Desktop/esp/esp-idf/components/log /Users/vitto/Desktop/esp/esp-idf/components/bootloader/subproject/main /Users/vitto/Desktop/esp/esp-idf/components/bootloader/subproject/components/micro-ecc /Users/vitto/Desktop/esp/esp-idf/components/newlib /Users/vitto/Desktop/esp/esp-idf/components/partition_table /Users/vitto/Desktop/esp/esp-idf/components/riscv /Users/vitto/Desktop/esp/esp-idf/components/soc /Users/vitto/Desktop/esp/esp-idf/components/spi_flash
  46. -- Configuring done (13.7s)
  47. -- Generating done (0.2s)
  48. -- Build files have been written to: /Users/vitto/Desktop/esp/hello_world/build/bootloader
  49. [95/96] Generating binary image from built executable
  50. esptool.py v4.8.1
  51. Creating esp32c2 image...
  52. Merged 2 ELF sections
  53. Successfully created esp32c2 image.
  54. Generated /Users/vitto/Desktop/esp/hello_world/build/bootloader/bootloader.bin
  55. [96/96] cd /Users/vitto/Desktop/esp/hello_world/build/bootloader/esp-idf/esptool_py && /Users/vitt...-offset 0x8000 bootloader 0x0 /Users/vitto/Desktop/esp/hello_world/build/bootloader/bootloader.bin
  56. Bootloader binary size 0x4c10 bytes. 0x33f0 bytes (41%) free.
  57. [899/901] Generating binary image from built executable
  58. esptool.py v4.8.1
  59. Creating esp32c2 image...
  60. Merged 1 ELF section
  61. Successfully created esp32c2 image.
  62. Generated /Users/vitto/Desktop/esp/hello_world/build/hello_world.bin
  63. [900/901] cd /Users/vitto/Desktop/esp/hello_world/build/esp-idf/esptool_py && /Users/vitto/.espres...ild/partition_table/partition-table.bin /Users/vitto/Desktop/esp/hello_world/build/hello_world.bin
  64. hello_world.bin binary size 0x1e340 bytes. Smallest app partition is 0x100000 bytes. 0xe1cc0 bytes (88%) free.
  65. [900/901] cd /Users/vitto/Desktop/esp/esp-idf/components/esptool_py && /usr/local/bin/cmake -D IDF.../hello_world/build -P /Users/vitto/Desktop/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
  66. esptool.py --chip esp32c2 -p /dev/cu.usbserial-0001 -b 115200 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 60m --flash_size 2MB 0x0 bootloader/bootloader.bin 0x10000 hello_world.bin 0x8000 partition_table/partition-table.bin
  67. esptool.py v4.8.1
  68. Serial port /dev/cu.usbserial-0001
  69. Connecting......................................
  70.  
  71. A fatal error occurred: Failed to connect to ESP32-C2: Invalid head of packet (0x12): Possible serial noise or corruption.
  72. For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
  73. CMake Error at run_serial_tool.cmake:67 (message):
  74.  
  75.   /Users/vitto/.espressif/python_env/idf5.5_py3.10_env/bin/python;;/Users/vitto/Desktop/esp/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32c2
  76.   failed.
  77.  
  78.  
  79.  
  80. FAILED: CMakeFiles/flash /Users/vitto/Desktop/esp/hello_world/build/CMakeFiles/flash
  81. cd /Users/vitto/Desktop/esp/esp-idf/components/esptool_py && /usr/local/bin/cmake -D IDF_PATH=/Users/vitto/Desktop/esp/esp-idf -D "SERIAL_TOOL=/Users/vitto/.espressif/python_env/idf5.5_py3.10_env/bin/python;;/Users/vitto/Desktop/esp/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32c2" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/Users/vitto/Desktop/esp/hello_world/build -P /Users/vitto/Desktop/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
  82. ninja: build stopped: subcommand failed.
  83. ninja failed with exit code 1, output of the command is in the /Users/vitto/Desktop/esp/hello_world/build/log/idf_py_stderr_output_4624 and /Users/vitto/Desktop/esp/hello_world/build/log/idf_py_stdout_output_4624

Who is online

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