-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0x08) (IDFGH-8077) #9580
Comments
Hello @pooja079, the most probable cause of this is that your devkit is not automatically switching into the download mode. This can be verified by using a newer version of esptool - wrong boot mode detection has been implemented in v3.2. You can download the latest esptool from the repository or from PyPI, or you can update ESP-IDF. If your board has boot and reset buttons, you can try entering the download mode manually. (Press the reset button while holding the boot button before flashing, or just hold the boot button while attempting to flash) Please let me know if this helps. If not, we can try some more troubleshooting. |
Thank You @radimkarnis , Let me try and get back to you |
Hi, |
@pooja079, sorry for not explaining. ESP-IDF uses a utility called esptool.py under the hood to flash the compiled app binaries to the chip. You can see esptool runs and its output in your log, it is this part:
Esptool connects to the chip and if successful, sends the binary over. In order for it to connect, the ESP chip has to be switched into a download mode. This switch usually happens automatically, but if that for whatever reason fails, you can also switch it manually.
My advice to you here is to try switching into download mode manually. If this doesn't help, you can try updating ESP-IDF to a newer version, which will also update esptool.py to a newer version. Updated esptool would either solve the problem or give us more information about the problem. |
I can see you are using |
@pooja079 did you manage to flash your device? |
Don't boot the ESP32 too many times. |
Yes, by using jumpers |
Hi
Please help someone I'm new to this, not able to flash the project:
C:\Users\WIN10\esp\hello_world>idf.py -p COM7 flash
Executing action: flash
Running ninja in directory c:\users\win10\esp\hello_world\build
Executing "ninja flash"...
[1/5] cmd.exe /C "cd /D C:\Users\WIN10\esp\hello_world\bui....bin C:/Users/WIN10/esp/hello_world/build/hello_world.bin"
hello_world.bin binary size 0x29730 bytes. Smallest app partition is 0x100000 bytes. 0xd68d0 bytes (84%) free.
[2/5] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\Users\WIN10\esp\hello_world\build\bootloader\esp-idf\esptool_py && C:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe C:/Espressif/frameworks/esp-idf-v4.4/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 C:/Users/WIN10/esp/hello_world/build/bootloader/bootloader.bin"
Bootloader binary size 0x62b0 bytes. 0xd50 bytes (12%) free.
[2/3] cmd.exe /C "cd /D C:\Espressif\frameworks\esp-idf-v4.../esp-idf-v4.4/components/esptool_py/run_serial_tool.cmake"
esptool.py esp32 -p COM7 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x1000 bootloader/bootloader.bin 0x10000 hello_world.bin 0x8000 partition_table/partition-table.bin
esptool.py v3.2-dev
Serial port COM7
Connecting......................................
A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0x08): Possible serial noise or corruption.
For troubleshooting steps visit: https://github.com/espressif/esptool#troubleshooting
CMake Error at run_serial_tool.cmake:56 (message):
C:/Espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe
C:/Espressif/frameworks/esp-idf-v4.4/components/esptool_py/esptool/esptool.py
--chip esp32 failed
FAILED: CMakeFiles/flash
cmd.exe /C "cd /D C:\Espressif\frameworks\esp-idf-v4.4\components\esptool_py && C:\Espressif\tools\cmake\3.20.3\bin\cmake.exe -D IDF_PATH="C:/Espressif/frameworks/esp-idf-v4.4" -D SERIAL_TOOL="C:/Espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe C:/Espressif/frameworks/esp-idf-v4.4/components/esptool_py/esptool/esptool.py --chip esp32" -D SERIAL_TOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/WIN10/esp/hello_world/build" -P C:/Espressif/frameworks/esp-idf-v4.4/components/esptool_py/run_serial_tool.cmake"
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
C:\Users\WIN10\esp\hello_world>
The text was updated successfully, but these errors were encountered: