Problem encountered when flashing esp32-c3
Posted: Sun May 30, 2021 1:38 pm
I was trying to test an example project hello_world and building is fine. But when trying to flash it on my esp32-c3 by using command idf.py -p COMX flash, an Invalid head of packet (0x47) problem was raised. I tied many times and some solutions but it still not solved.
Flashing environment:windows cmd & eclipse & clion
idf verison: 4.2.1
chip type: Esp32-C3-DevKitM-1
some attempts:
changing the baud rate, not working.
using anther kind of chip esp-32_devkitC(esp-wroom-32D), flashing project is ok.
using different environments, not working .
The full error information is listed below:
[1/4] Performing build step for 'bootloader'
ninja: no work to do.
[1/2] cmd.exe /C "cd /D D:\workandlearn\MISSU\MISSU_socket\esp-env\components\esptool_py && D:\workandlearn\MISSU\MISSU_socket\esp-IDF\.espressif\tools\cmake\3.16.4\bin\cmake.exe -D IDF_PATH="D:/workandlearn/MISSU/MISSU_socket/esp-env" -D ESPTOOLPY="python D:/workandlearn/MISSU/MISSU_socket/esp-env/components/esptool_py/esptool/esptool.py --chip esp32" -D ESPTOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/51680/eclipse-workspace/flash_test1/build" -P D:/workandlearn/MISSU/MISSU_socket/esp-env/components/esptool_py/run_esptool.cmake"
esptool.py --chip esp32 -p COM5 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
esptool.py v3.0
Serial port COM5
Connecting....
WARNING: This chip doesn't appear to be a ESP32 (chip magic value 0x1b31506f). Probably it is unsupported by this version of esptool.
Chip is ESP32-D0WDQ6 (revision 0)
Features: WiFi, BT, Dual Core, Coding Scheme None
WARNING: Detected crystal freq 0.00MHz is quite different to normalized freq 26MHz. Unsupported crystal in use?
Crystal is 26MHz
MAC: 00:00:00:00:00:00
Uploading stub...
Running stub...
A fatal error occurred: Invalid head of packet (0x47)
CMake Error at run_cmd.cmake:14 (message):
esptool.py failed
Call Stack (most recent call first):
run_esptool.cmake:21 (include)
FAILED: CMakeFiles/flash
cmd.exe /C "cd /D D:\workandlearn\MISSU\MISSU_socket\esp-env\components\esptool_py && D:\workandlearn\MISSU\MISSU_socket\esp-IDF\.espressif\tools\cmake\3.16.4\bin\cmake.exe -D IDF_PATH="D:/workandlearn/MISSU/MISSU_socket/esp-env" -D ESPTOOLPY="python D:/workandlearn/MISSU/MISSU_socket/esp-env/components/esptool_py/esptool/esptool.py --chip esp32" -D ESPTOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/51680/eclipse-workspace/flash_test1/build" -P D:/workandlearn/MISSU/MISSU_socket/esp-env/components/esptool_py/run_esptool.cmake"
ninja: build stopped: subcommand failed.
Executing action: flash
Running ninja in directory c:\users\51680\eclipse-workspace\flash_test1\build
Executing "ninja flash"...
ninja failed with exit code 1
Flashing environment:windows cmd & eclipse & clion
idf verison: 4.2.1
chip type: Esp32-C3-DevKitM-1
some attempts:
changing the baud rate, not working.
using anther kind of chip esp-32_devkitC(esp-wroom-32D), flashing project is ok.
using different environments, not working .
The full error information is listed below:
[1/4] Performing build step for 'bootloader'
ninja: no work to do.
[1/2] cmd.exe /C "cd /D D:\workandlearn\MISSU\MISSU_socket\esp-env\components\esptool_py && D:\workandlearn\MISSU\MISSU_socket\esp-IDF\.espressif\tools\cmake\3.16.4\bin\cmake.exe -D IDF_PATH="D:/workandlearn/MISSU/MISSU_socket/esp-env" -D ESPTOOLPY="python D:/workandlearn/MISSU/MISSU_socket/esp-env/components/esptool_py/esptool/esptool.py --chip esp32" -D ESPTOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/51680/eclipse-workspace/flash_test1/build" -P D:/workandlearn/MISSU/MISSU_socket/esp-env/components/esptool_py/run_esptool.cmake"
esptool.py --chip esp32 -p COM5 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
esptool.py v3.0
Serial port COM5
Connecting....
WARNING: This chip doesn't appear to be a ESP32 (chip magic value 0x1b31506f). Probably it is unsupported by this version of esptool.
Chip is ESP32-D0WDQ6 (revision 0)
Features: WiFi, BT, Dual Core, Coding Scheme None
WARNING: Detected crystal freq 0.00MHz is quite different to normalized freq 26MHz. Unsupported crystal in use?
Crystal is 26MHz
MAC: 00:00:00:00:00:00
Uploading stub...
Running stub...
A fatal error occurred: Invalid head of packet (0x47)
CMake Error at run_cmd.cmake:14 (message):
esptool.py failed
Call Stack (most recent call first):
run_esptool.cmake:21 (include)
FAILED: CMakeFiles/flash
cmd.exe /C "cd /D D:\workandlearn\MISSU\MISSU_socket\esp-env\components\esptool_py && D:\workandlearn\MISSU\MISSU_socket\esp-IDF\.espressif\tools\cmake\3.16.4\bin\cmake.exe -D IDF_PATH="D:/workandlearn/MISSU/MISSU_socket/esp-env" -D ESPTOOLPY="python D:/workandlearn/MISSU/MISSU_socket/esp-env/components/esptool_py/esptool/esptool.py --chip esp32" -D ESPTOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/51680/eclipse-workspace/flash_test1/build" -P D:/workandlearn/MISSU/MISSU_socket/esp-env/components/esptool_py/run_esptool.cmake"
ninja: build stopped: subcommand failed.
Executing action: flash
Running ninja in directory c:\users\51680\eclipse-workspace\flash_test1\build
Executing "ninja flash"...
ninja failed with exit code 1