PlatformIO Community

CLion Debugging

Hello,

I just tried to install the CLion integration according to https://docs.platformio.org/en/latest/integration/ide/clion.html.

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 https://github.com/espressif/esp-idf/issues/2214 and https://github.com/MabezDev/idf2svd/issues/6#issuecomment-576632885.

There are currently community-made converter tools written in Rust to convert Espressif’s header files into SVD files. See https://github.com/MabezDev/idf2svd. There also seems to be a more corrected version with a base file + patches at https://github.com/esp-rs/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 https://github.com/esp-rs/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 https://github.com/platformio/platform-espressif32

We would be thankful! See example https://github.com/platformio/platform-atmelsam/tree/develop/misc/svd

It seems to work with CLion. I created a PR https://github.com/platformio/platform-espressif32/pull/325

I’ve put the latest svd generated from the https://github.com/esp-rs/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