Updated "How to" Set Up Eclipse for ESP32-C3 Built in JTAG Debugging

BrianP
Posts: 53
Joined: Mon Apr 13, 2020 1:48 pm

Updated "How to" Set Up Eclipse for ESP32-C3 Built in JTAG Debugging

Postby BrianP » Fri Jul 23, 2021 3:33 pm

The various devs have fixed many of the issues I created workarounds for in an earlier topic.

Great work!

The fixes are not yet part of esp-idf or the Eclipse plugin so I thought I would provide an updated how to.

1) Download and install esp-idf MASTER branch.
Run install and export.
Build a project for ESP32-C3 to make sure everything works

2) Install eclipse-cdt. I used the most recent 2020-06 version
In Eclipse
Help -> Install New Software
Add… ->
Name Espressif IDF Plugin for Eclipse
URL https://dl.espressif.com/dl/idf-eclipse ... ates/beta/ note this is the beta
Add
Select Espressif IDF from the list and install. Make sure to set up the tools if necessary (see https://github.com/espressif/idf-eclipse-plugin)


3) Locate the existing esp32-ocd directory associated with esp-idf, in my case that is
C:\Users\bjpic\.espressif\tools\openocd-esp32\v0.10.0-esp32-20210401\openocd-esp32

Go to https://github.com/espressif/openocd-esp32/releases/ and download the most recent release of
openocd-esp32. Unzip the file and copy the openocd-esp32 directory to the existing "bad" openocd-esp32
directory in .espressif\tools i.e. in my case

C:\Users\bjpic\.espressif\tools\openocd-esp32\v0.10.0-esp32-20210401\openocd-esp32

4) Open eclipse and create a project (i.e. blink).
Set up a debug configuration.
Run -> Debug Configuration. Tab Debugger
Target esp32c3
Board ESP32-C3 chip (via built-in USB-JTAG)

Actual executable is wrong! Browse to a path to
riscv32-esp-elf-gdb.exe

in my case that was
C:\Users\bjpic\.espressif\tools\riscv32-esp-elf\esp-2021r1-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-gdb.exe

Apply.

5) I use the USB serial port as com so I edit the sdkconfig file
Component Settings -> ESP System Settings -> Channel for Console Output to USB Serial/JTAG Controller.

This directs printfs, etc., to the USB serial port.

Check the "on:" ESP-target setup/gear and make sure the right com port is selected. Note that only one com port is used by serial I/O and JTAG.

Note that if you do this debugging will appear to hang and crash if you do not have a serial terminal open!


6) Build the project. It should build, flash the device, and debug. Note that you do not have to disconnect the USB serial port terminal emulator in order to flash the device.

blipton
Posts: 1
Joined: Sat Nov 16, 2024 5:12 pm

Re: Updated "How to" Set Up Eclipse for ESP32-C3 Built in JTAG Debugging

Postby blipton » Mon Nov 18, 2024 2:43 am

It's been a few years, can anyone confirm that these instruction still work with the current versions
(Eclipse 4.33, OpenOcd 0.11, espressif 5.4 )

I can't get it to debug using the esp32-c3 built in jtag debugger. It's possible its something with the generated elf/bin (tool chain/options) or something with OpenOcd/eclipse setup.

Who is online

Users browsing this forum: No registered users and 21 guests