I can't program or open the console on my ESP32-C3-MINI-1

troymitchell
Posts: 2
Joined: Sun Dec 01, 2024 8:42 am

I can't program or open the console on my ESP32-C3-MINI-1

Postby troymitchell » Sun Dec 01, 2024 8:52 am

As the title says, I designed a circuit board, soldered the necessary components (ESP32, LDO, USB), and found that /dev/ttyACM0 can be recognized but cannot perform any operations. Can anyone help me?


Image

Image

Code: Select all

❯ idf.py flash -p /dev/ttyACM0
Executing action: flash
Running ninja in directory /home/troy/mcu/esp/hello_world/build
Executing "ninja flash"...
[1/5] cd /home/troy/mcu/esp/hello_world/build/esp-idf/esptool_py && /home/troy/....n_table/partition-table.bin /home/troy/mcu/esp/hello_world/build/hello_world.bin
hello_world.bin binary size 0x2ab30 bytes. Smallest app partition is 0x100000 bytes. 0xd54d0 bytes (83%) free.
[1/1] cd /home/troy/mcu/esp/hello_world/build/bootloader/esp-idf/esptool_py && /...00 bootloader 0x0 /home/troy/mcu/esp/hello_world/build/bootloader/bootloader.bin
Bootloader binary size 0x5180 bytes. 0x2e80 bytes (36%) free.
[2/3] cd /home/troy/repo/esp-idf-v5.3/components/esptool_py && /usr/bin/cmake -D...uild -P /home/troy/repo/esp-idf-v5.3/components/esptool_py/run_serial_tool.cmake
esptool.py --chip esp32c3 -p /dev/ttyACM0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 2MB 0x0 bootloader/bootloader.bin 0x10000 hello_world.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.8.dev4
Serial port /dev/ttyACM0
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/__main__.py", line 9, in <module>
    esptool._main()
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/__init__.py", line 1170, in _main
    main()
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/__init__.py", line 721, in main
    esp = esp or get_default_connected_device(
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/__init__.py", line 1055, in get_default_connected_device
    _esp.connect(before, connect_attempts)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/loader.py", line 703, in connect
    last_error = self._connect_attempt(reset_strategy, mode)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/loader.py", line 588, in _connect_attempt
    reset_strategy()  # Reset the chip to bootloader (download mode)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/reset.py", line 38, in __call__
    self.reset()
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/reset.py", line 118, in reset
    self._setRTS(False)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esptool/reset.py", line 58, in _setRTS
    self.port.setRTS(state)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/serial/serialutil.py", line 600, in setRTS
    self.rts = value
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/serial/serialutil.py", line 463, in rts
    self._update_rts_state()
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/serial/serialposix.py", line 708, in _update_rts_state
Connecting...
    fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_RTS_str)
OSError: [Errno 71] Protocol error
CMake Error at run_serial_tool.cmake:66 (message):

  /home/troy/.espressif/python_env/idf5.3_py3.10_env/bin/python;;/home/troy/repo/esp-idf-v5.3/components/esptool_py/esptool/esptool.py;--chip;esp32c3
  failed.



FAILED: CMakeFiles/flash /home/troy/mcu/esp/hello_world/build/CMakeFiles/flash
cd /home/troy/repo/esp-idf-v5.3/components/esptool_py && /usr/bin/cmake -D IDF_PATH=/home/troy/repo/esp-idf-v5.3 -D "SERIAL_TOOL=/home/troy/.espressif/python_env/idf5.3_py3.10_env/bin/python;;/home/troy/repo/esp-idf-v5.3/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/troy/mcu/esp/hello_world/build -P /home/troy/repo/esp-idf-v5.3/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/troy/mcu/esp/hello_world/build/log/idf_py_stderr_output_850827 and /home/troy/mcu/esp/hello_world/build/log/idf_py_stdout_output_850827
❯ idf.py monitor -p /dev/ttyACM0
Executing action: monitor
Running idf_monitor in directory /home/troy/mcu/esp/hello_world
Executing "/home/troy/.espressif/python_env/idf5.3_py3.10_env/bin/python /home/troy/repo/esp-idf-v5.3/tools/idf_monitor.py -p /dev/ttyACM0 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c3 --revision 3 --decode-panic backtrace /home/troy/mcu/esp/hello_world/build/hello_world.elf -m '/home/troy/.espressif/python_env/idf5.3_py3.10_env/bin/python' '/home/troy/repo/esp-idf-v5.3/tools/idf.py'"...
--- esp-idf-monitor 1.4.0 on /dev/ttyACM0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
Exception in thread Thread-2 (_run_outer):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esp_idf_monitor/base/stoppable_thread.py", line 47, in _run_outer
    self.run()
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esp_idf_monitor/base/serial_reader.py", line 49, in run
    self.open_serial(reset=not self.gdb_exit and self.reset)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esp_idf_monitor/base/serial_reader.py", line 91, in open_serial
    self.reset_strategy._setRTS(HIGH)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/esp_idf_monitor/base/reset.py", line 80, in _setRTS
    self.serial_instance.setRTS(value)
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/serial/serialutil.py", line 600, in setRTS
    self.rts = value
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/serial/serialutil.py", line 463, in rts
    self._update_rts_state()
  File "/home/troy/.espressif/python_env/idf5.3_py3.10_env/lib/python3.10/site-packages/serial/serialposix.py", line 708, in _update_rts_state
    fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_RTS_str)
OSError: [Errno 71] Protocol error

ESP_Sprite
Posts: 9835
Joined: Thu Nov 26, 2015 4:08 am

Re: I can't program or open the console on my ESP32-C3-MINI-1

Postby ESP_Sprite » Mon Dec 02, 2024 4:48 am

For the first flash, you may need to either have luck with timing or lower GPIO0 while resetting the module. Without valid flash, the ESP32C3 will enter a bootloop which can make it hard to get the flash timing right; booting with GPIO0 forces download mode which bypasses this.

troymitchell
Posts: 2
Joined: Sun Dec 01, 2024 8:42 am

Re: I can't program or open the console on my ESP32-C3-MINI-1

Postby troymitchell » Mon Dec 02, 2024 6:11 am

ESP_Sprite wrote:
Mon Dec 02, 2024 4:48 am
For the first flash, you may need to either have luck with timing or lower GPIO0 while resetting the module. Without valid flash, the ESP32C3 will enter a bootloop which can make it hard to get the flash timing right; booting with GPIO0 forces download mode which bypasses this.
This is so weird. When I used the ESP32-C3-FN4 chip, everything was fine for the first flash.
This time, due to the problem of the workplace, there is no good welding equipment, so I chose the module, but I was disappointed that I had to take my chances for the first download.

finally,
I held down the reset button, and then let go of it at the moment of downloading, and everything was fine. Thank you very much for giving me ideas.

Who is online

Users browsing this forum: No registered users and 50 guests