Closed Ardelean-Calin closed 2 years ago
I tried with the latest OpenOCD master and your idf branch. Also with your binary file. There is no issue on my side. Tested ESp32c3-MINI-1 from the usb jtag port.
Your commands also look correct.
I could ask to disable memory protection, but during the programming , OpenOCD first resets the chip and protection will be disabled.
If you need to debug the target without programming it, you can disable flash support by setting ESP_FLASH_SIZE to 0.
I will turn back if I have something new in my mind to try.
Thank you for trying on your end, as well! If you say that on your end everything works as expected, then the problem might be with the ESP32C3 Mini Module I got from my parts supplier (JLCPCB) or worst case with my hardware design (even though I have just a simple two wire connection to the Data+ and Data- USB lines as seen in the picture below). I am assuming the hardware connection is ok, since I can upload the image via UART & openocd doesn't work even if I set adapter speed 40
in esp_usb_jtag.cfg
.
I can try and offer more information regarding the module found on my board, for example, this is the output of
esptool.py get_security_info
:
Sorry for the spam, I just wanted to attach the output of espefuse.py summary
, as well. Maybe it helps...
fuses.txt
@Ardelean-Calin did you add 1K5 resistor between D+ and 3V3. I couldn't see from the picture.
Closing due to inactivity. if you have still an issue feel free to re-open.
Development Kit
No development kit - custom board
Module or chip used
ESP32C3-Mini-1 (Rev 3) with 4MB Flash
Debug Adapter
Integrated USB-JTAG
OpenOCD version
v0.11.0-esp32-20220411
Operating System
Linux
Using an IDE ?
No
OpenOCD command line
openocd -f board/esp32c3-builtin.cfg -c "program_esp build/blink.bin 0x10000 verify exit"
JTAG Clock Speed
default
ESP-IDF version
ESP-IDF v5.0-dev-3485-g20f5e180ee
Problem Description
Using the ESP32-C3-MINI-1 module on a custom board. The integrated JTAG + UART interface (via USB) is detected by my operating system, however I cannot debug any application via openocd, not even the blinky example attached here.
I can successfully flash the device using esptool.py, but when I try to flash via OpenOCD I get:
The same error happens if I run
openocd -f board/esp32c3-builtin.cfg
and then try to connect via gdb in another terminal
riscv32-esp-elf-gdb -ex "target extended-remote :3333"
There seems to be some problem with openocd getting the flash maps for the ESP32-C3-MINI-1 module.
I have tried compiling openocd from sources and running it via a debugger, but I can't seem to be able to debug the
stub_flasher.c
file and the culprit seems to be there in thestub_flash_get_map()
function. Any help on how to debug that function so that I can get more details would be highly appreciated!I have attached the log from the following command:
openocd -d3 -l openocd.log -f board/esp32c3-builtin.cfg -c "program_esp build/blink.bin 0x10000 verify exit"
Log: openocd.log Binary files: blink.zip
Debug Logs
Expected behavior
I would expect to get a list of flash mappings and a successful connection via gdb.
Screenshots
No response