CLion Debugging

Hello,

I just tried to install the CLion integration according to CLion — PlatformIO latest documentation.

I’d like to use it for an ESP32 project. I tried to debug my project with the esp-wrover-kit board. Unfortunately I am unable to find the SVD file mentioned in the documentation linked above anywhere. It’s not in the .platformio/platforms/espressif32 folder nor linked in any CMAKE variable.

I think without the file debugging is quite useless, isn’t it?

Can you lead me to the right direction please?

Thanks and regards
Jens

No, why? Without an SVD files you don’t get the pretty list of the peripheral register values. Debugging still works perfectly normal with variable inspection, line-by-line stepping etc. This is a purely an addition to normal debugging.

This is an issue on Espressif’s side since they don’t provide one. See Provide *.SVD for use with editors (IDFGH-299) · Issue #2214 · espressif/esp-idf · GitHub and Fix detection of some registers · Issue #6 · MabezDev/idf2svd · GitHub.

There are currently community-made converter tools written in Rust to convert Espressif’s header files into SVD files. See GitHub - MabezDev/idf2svd. There also seems to be a more corrected version with a base file + patches at GitHub - esp-rs/esp32: Peripheral access crate for the ESP32.

2 Likes

Thanks for your reply.

I will try debugging without the SVD file. Obviously I misunderstood its importance.

Out of interest I just tried to create a SVD file with the tools you linked. But idf2svd didn’t work. Lot’s of regex errors. Did you get it to work? Unfortunately I am not really into Rust, so I don’t know what’s happening there. :smiley:

Edit: Just had a closer look at GitHub - esp-rs/esp32: Peripheral access crate for the ESP32. That one seems to work and looks good. I will report back, when I tried it from Clion.

If you will have working SVD, please make a PR to GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO

We would be thankful! See example platform-atmelsam/misc/svd at develop · platformio/platform-atmelsam · GitHub

It seems to work with CLion. I created a PR Add SVD for ESP32 (wrover kit) by jenswet · Pull Request #325 · platformio/platform-espressif32 · GitHub

I’ve put the latest svd generated from the GitHub - esp-rs/esp32: Peripheral access crate for the ESP32 repo.

If I need to change anything please tell me. The svd gets added to CMakeListsPrivate.txt of CLion as expected when I copy the changed boards information and svd to my local installation.

I think the same SVD should work with other boards too, because they are all ESP32. Should we add it to other debug configurations too?

1 Like