espressif / esptool

Espressif SoC serial bootloader utility
https://docs.espressif.com/projects/esptool
GNU General Public License v2.0
5.6k stars 1.39k forks source link

ESP32-C3 misdetected as ESP32-PICO-D4? (IDFGH-10860) (ESPTOOL-724) #907

Closed cyberhuman closed 1 year ago

cyberhuman commented 1 year ago

Answers checklist.

IDF version.

v5.1

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

What is the expected behavior?

It must be possible to flash ESP32-C3 chip if the target is set to esp32c3.

What is the actual behavior?

esptool outputs:

A fatal error occurred: This chip is ESP32 not ESP32-C3. Wrong --chip argument?

Steps to reproduce.

The board is Wemos C3 Pico. You can see the chip is ESP32-C3: PXL_20230812_035901988~2

  1. idf.py create-project newproject
  2. idf.py set-target esp32c3
  3. idf.py -p /dev/ttyUSB0 --baud 115200 flash

sdkconfig

Build or installation Logs.

idf.py -p /dev/ttyUSB0 --baud 115200 flash
/home/foss/esp-idf/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Executing action: flash
Running ninja in directory /home/foss/newproject/build
Executing "ninja flash"...
[1/5] cd /home/foss/newproject/build/esp-idf/esptool_py && /home/foss/.espressif/python_env/idf5.1_py3.11_env/bin/python /home/foss/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/foss/newproject/build/partition_table/partition-table.bin /home/foss/newproject/build/remote_switch.bin
remote_switch.bin binary size 0x2f7c0 bytes. Smallest app partition is 0x100000 bytes. 0xd0840 bytes (81%) free.
[2/5] Performing build step for 'bootloader'
[1/1] cd /home/foss/newproject/build/bootloader/esp-idf/esptool_py && /home/foss/.espressif/python_env/idf5.1_py3.11_env/bin/python /home/foss/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 /home/foss/newproject/build/bootloader/bootloader.bin
Bootloader binary size 0x5030 bytes. 0x2fd0 bytes (37%) free.
[3/5] No install step for 'bootloader'
[4/5] Completed 'bootloader'
[4/5] cd /home/foss/esp-idf/components/esptool_py && /usr/bin/cmake -D IDF_PATH=/home/foss/esp-idf -D "SERIAL_TOOL=/home/foss/.espressif/python_env/idf5.1_py3.11_env/bin/python;;/home/foss/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32c3" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/home/foss/newproject/build -P /home/foss/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool.py --chip esp32c3 -p /dev/ttyUSB0 -b 115200 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 2MB 0x0 bootloader/bootloader.bin 0x10000 remote_switch.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.7.dev1
Serial port /dev/ttyUSB0
Connecting......

A fatal error occurred: This chip is ESP32 not ESP32-C3. Wrong --chip argument?
CMake Error at run_serial_tool.cmake:66 (message):

  /home/foss/.espressif/python_env/idf5.1_py3.11_env/bin/python;;/home/foss/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32c3
  failed.

FAILED: CMakeFiles/flash /home/foss/newproject/build/CMakeFiles/flash 
cd /home/foss/esp-idf/components/esptool_py && /usr/bin/cmake -D IDF_PATH=/home/foss/esp-idf -D "SERIAL_TOOL=/home/foss/.espressif/python_env/idf5.1_py3.11_env/bin/python;;/home/foss/esp-idf/components/esptool_py/esptool/esptool.py;--chip;esp32c3" -D "SERIAL_TOOL_ARGS=--before=default_reset;--after=hard_reset;write_flash;@flash_args" -D WORKING_DIRECTORY=/home/foss/newproject/build -P /home/foss/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 /home/foss/newproject/build/log/idf_py_stderr_output_2621918 and /home/foss/newproject/build/log/idf_py_stdout_output_2621918

More Information.

I tried esptool chip_id and it says the chip is ESP32-PICO-D4. See auto.txt.

When running with --chip esp32c3: A fatal error occurred: This chip is ESP32 not ESP32-C3. Wrong --chip argument? See esp32c3.txt.

cyberhuman commented 1 year ago

I have realized I also had another ESP device plugged in the USB hub, so the message is correct 😬 I'm sorry for the hassle.