Learn how to configure GDB OpenOCD Debugging in Eclipse
There are two ways you can debug esp32 applications using Eclipse.
- GDB Hardware Debugging — By default, Eclipse supports OpenOCD via the GDB Hardware Debugging plug-in. Recent versions of Eclipse CDT has this plugin pre-installed. Here you need to run the GDB server from the command line and start the GDB client from the eclipse on the same port so that both will communicate.
Here is the documentation https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/jtag-debugging/using-debugger.html
2. GDB OpenOCD Debugging — Here GDB server and GDB client both will be initiated by Eclipse, so no need to run anything from the command line.
For this, you need an additional Eclipse plugin https://gnu-mcu-eclipse.github.io/debug/openocd/
Here is the update site to get the plugin http://gnu-mcu-eclipse.netlify.com/v4-neon-updates
Follow these steps to quickly get started.
Step #1: Update your eclipse with the GNU MCU Eclipse Plugin
Step #2: Download the esp32 OpenOCD launch figuration file for esp32 from here
Step #3: Import the OpenOCD launch configuration file to Eclipse using the Launch Configuration import option
Step #4: Verify if you’re able to see the imported OpenOCD Debugging launch configuration
Step #5: Click on the “OpenOCD Debugging” launch configuration to configure your project-specific settings and toolchains
No changes required to Startup, Source, Common, and SVD Path tabs if you’re imported the esp32 launch configuration file as we mentioned above.
All done. You’re good to go! Click on the Debug button to get started.