-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32-C3 JTAG -- incorrect documentation -- unable to debug (IDFGH-4760) (OCD-307) #144
Comments
@pjsg The C3 documention is still a work in progress, so lots of pages are still not properly updated. As for the JTAG pins you can find them in the C3 datasheet |
Thanks for that. I have managed to make some progress. When trying to start debugging from eclipse, I got this:
For anybody else with this problem, you need to add However, while this gets you further, openocd then throws this error:
and eclipse said
and the terminal showed:
If I start the board not under the debugger then it gets into my app:
I'm not sure what my next step should be..... |
@pjsg What is the output of |
Open On-Chip Debugger v0.10.0-esp32-20201202-14-gde9e630c (2021-02-14-18:40) This is a version that I built based off the current master in your repo. I need to do this as I need the ftdi driver to be able to drive an altera usb-blaster (which was before I found my jlink!). |
Okay, I'll move the issue to OpenOCD project for further troubleshooting. |
Could you please try running a debugging session from the command line to narrow down the cause of the issue?
If that still doesn't work, please add Thanks. |
This works much better thank you. I now get:
when stepping through the code. It doesn't seem to interfere with normal use, so I'm happy to ignore it..... Thank you. |
I tried to reproduce with debugging turned on, and it didn't reproduce. It doesn't happen in every debugging session. So far I've made it happen twice (with maybe 5 attempts) when not running openocd -d, and never (with maybe 10 attempts) with openocd -d! I'm driving from eclipse if that makes a difference. |
Hi @pjsg, I will try to reproduce the error from the eclipse. In the meantime could you please try again from command line without -d option. Once you see the error you can change openocd debug level from gdb screen with Thanks |
I attach the log from the openocd instance -- it actually reproduced on the first attempt. |
And this was the gdb log:
|
Hi @pjsg, Good news, I have re-produced the issue. Looks like ESP32-C3 rtos integration missing one necessary function call after reset the target. In each reset FreeRTOS Luckily, this is not blocker for debugging. Fix will be ready in the next release. Thanks for your support. |
I have a similar issue getting JTAG to work with ESP32C3 using a flyswatter2. The setup works as expected with an ESP32-DevKit-V4. My "board" is an ESP32C3 Wroom with the following connections: My eclipse output is...
If I run the following on the command line to bypass Eclipse I get something similar...
|
@dau42 You seem to have another issue. Sorry. Your connection seem to be ok for esp32c3-Wroom. But the issue have different symptoms. What app did you flash to the chip? Can you check with hello_world example? |
@dau42 Note that before espressif/esp-idf@cccdb3e blink example used GPIO5 to control LED. GPIO5 is TDI on ESP32C3 |
I have switched to ESP32-C3 Dev Kit V2. Connections for JTAG are the same.
I have set aside Eclipse for now to concentrate on getting command line flash via JTAG working. Also, do you know where I can get the example code that comes on a virgin ESP32-C3 Dev Kit? It looks like it simple lights up the SK68XX RGB LED with cyan color. |
The "Hart 0 unexpectedly reset" messages are caused by a mismatch of the ESP32c3 revision. In config there is a "Component config\ESP32c3 Specific\Minimum Supported ESP32C3 Revision" setting that defaults to Rev 3. My ESP32c3's are Revision 2 parts. This causes the boot loader to continually reset the part. If you monitor the TX line the boot loader sends out a message to warn about this condition.
|
I have ESP32c3 Debug up and running on the Command Line and in Eclipse... For the command line I use:
to start up OpenOCD. I then open a second terminal session and use:
to start the correct version of gdb. Within gdb I use these commands:
to make the connection and start debugging. At this point everything works. For Eclipse I setup a Debug Configuration with the OpenOCD config options as:
and the correct risk version of gdb with the commands:
At this point debugging on the ESP32C3 works fine on Eclipse. |
I still cannot program the part via JTAG. When I use
I get...
Something is still amiss with programming my ESP32c3 via JTAG. This command line works perfectly for an ESP32 if I compile for the esp32 and change the esp32c3.cfg to esp32.cfg. Everything works as expected using program_esp on the ESP32 but not the ESP32c3. |
@dau42 Flash programming over JTAG and flash breakpoints aren't yet implemented for ESP32-C3. We are working on it and this will come in the next release. |
I believe i have the latest openocd installed but i am having the same issue as OP when i am trying to use buildin JTAG:
GDB logs:
EDIT with
|
Hi @chegewara,
Or you can explicitly force gdb to 32-bit using |
@erhankur Thanks, adding elf file in command line helped. |
@igrr, is there an update on when programming over JTAG may be available? Thanks |
@giacomo-zanichelli It was released. But recommended openocd version is not updated in IDF yet |
I'm trying to port my app to the early esp32-c3 devkit that you mailed me (thanks!). I realize that the JTAG is not available from the USB, but hopefully is available from the pins using an external JTAG device. However, the only documentation that I can find on which pins are which -- https://docs.espressif.com/projects/esp-idf/en/v4.3-beta1/esp32c3/api-guides/jtag-debugging/configure-other-jtag.html -- unfortunately has a table copied from the esp32-s2 page and talks about GPIOs that are way out of range for the ESP32-C3-DevKitM-1 V1.0
Is there a better table somewhere of the pin mapping?
I'm a bit stuck not being able to do any debugging to see what is going wrong...
Thanks.
The text was updated successfully, but these errors were encountered: