[ESP32C3]Can not use "download stub" for flashing

yekai1030
Posts: 2
Joined: Tue Aug 01, 2023 7:38 am

[ESP32C3]Can not use "download stub" for flashing

Postby yekai1030 » Tue Aug 01, 2023 8:28 am

Hello everyone,
I'm using a self-designed ESP32C3 core board, I can download and run the code correctly with the "no stub" option like the image below:
no_stub.png
no_stub.png (27.75 KiB) Viewed 1147 times
but without the "stub" the download speed is extremely slow, when I enable the download stub option and then run the flasher, it seems like the chip stop responding during the flashing. The information in the terminal shows below. My question is : How can I download the code correctly with the stub option? Hope someone can help and thanks in advance.

G:\Espressif\python_env\idf5.0_py3.11_env\Scripts\python.exe G:\Espressif\frameworks\esp-idf-v5.0.2\components\esptool_py\esptool\esptool.py -p COM12 -b 460800 --before default_reset --after hard_reset --chip esp32c3 write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x0 build\bootloader\bootloader.bin 0x8000 build\partition_table\partition-table.bin 0xd000 build\ota_data_initial.bin 0x10000 build\gattc_gatts_coex.bin
esptool.py v4.5.1
Serial port COM12
Connecting...
Chip is ESP32-C3 (revision v0.3)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 7c:df:a1:d6:17:d4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000d000 to 0x0000efff...
Flash will be erased from 0x00010000 to 0x0016dfff...
Compressed 20192 bytes to 12386...
Wrote 20192 bytes (12386 compressed) at 0x00000000 in 1.3 seconds (effective 122.0 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.2 seconds (effective 118.1 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 31...
Wrote 8192 bytes (31 compressed) at 0x0000d000 in 0.5 seconds (effective 123.2 kbit/s)...
Hash of data verified.
Compressed 1430960 bytes to 783525...
Writing at 0x0002aa9b... (6 %)Traceback (most recent call last):
File "G:\Espressif\python_env\idf5.0_py3.11_env\Lib\site-packages\esptool\__init__.py", line 1032, in _main
main()
File "G:\Espressif\python_env\idf5.0_py3.11_env\Lib\site-packages\esptool\__init__.py", line 832, in main
operation_func(esp, args)
File "G:\Espressif\python_env\idf5.0_py3.11_env\Lib\site-packages\esptool\cmds.py", line 586, in write_flash
esp.flash_defl_block(block, seq, timeout=timeout)
File "G:\Espressif\python_env\idf5.0_py3.11_env\Lib\site-packages\esptool\loader.py", line 131, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "G:\Espressif\python_env\idf5.0_py3.11_env\Lib\site-packages\esptool\loader.py", line 1030, in flash_defl_block
self.check_command(
File "G:\Espressif\python_env\idf5.0_py3.11_env\Lib\site-packages\esptool\loader.py", line 435, in check_command
val, data = self.command(op, data, chk, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\Espressif\python_env\idf5.0_py3.11_env\Lib\site-packages\esptool\loader.py", line 404, in command
p = self.read()
^^^^^^^^^^^
File "G:\Espressif\python_env\idf5.0_py3.11_env\Lib\site-packages\esptool\loader.py", line 337, in read
return next(self._slip_reader)
^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

A fatal error occurred: The chip stopped responding.

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

Re: [ESP32C3]Can not use "download stub" for flashing

Postby ESP_Sprite » Wed Aug 02, 2023 3:14 am

How are you programming the ESP32C3; over USB via the USB-serial-JTAG device or via UART? If the former, can you try forcing the chip into download mode by making GPIO9 low on bootup?

User avatar
ESP_Roland
Posts: 257
Joined: Tue Oct 09, 2018 10:28 am

Re: [ESP32C3]Can not use "download stub" for flashing

Postby ESP_Roland » Wed Aug 02, 2023 6:53 am

Hi. I can recommend to update esptool to get the latest fixes:

Code: Select all

G:\Espressif\python_env\idf5.0_py3.11_env\Scripts\python.exe -m pip install --upgrade esptool
The same can be achieved by running "install.bat" but that will update all tools (ESP-IDF won't be updated).

Are you still experiencing the issue? If yes then please run the following command and open an issue at https://github.com/espressif/esptool/issues with the received LONG output.

Code: Select all

G:\Espressif\python_env\idf5.0_py3.11_env\Scripts\python.exe -m esptool --trace  -p COM12 -b 460800 --before default_reset --after hard_reset --chip esp32c3 write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x0 build\bootloader\bootloader.bin 0x8000 build\partition_table\partition-table.bin 0xd000 build\ota_data_initial.bin 0x10000 build\gattc_gatts_coex.bin

yekai1030
Posts: 2
Joined: Tue Aug 01, 2023 7:38 am

Re: [ESP32C3]Can not use "download stub" for flashing

Postby yekai1030 » Mon Aug 28, 2023 9:20 am

Hey, thanks for you guys responses, I have already worked out this problem. It seems like the PUYA P25Q32H-SSH-IT is not working very good with the stub mode, I change it with a GD25Q32CTIG an it works smoothly.

Who is online

Users browsing this forum: danergo and 91 guests