Errors on CLion - ESP32 devkit - sdkconfig.json

Hello all

I have just acquired an ESP32 devkit and am trying to program it through Clion with the new platform io plugin.

While I have successfully uploaded examples to the board with the use of espressif’s toolchain, I cannot make it work inside Clion.

My flow:

Create new project → select my board - espdif → copy paste an example inside src/main.c, build

When trying to build it, I get two errors:

Error: Couldn’t find the main target of the project!
Warning: Could not find “sdkconfig.json” file

Espressif’s website states that the sdkconfig.json should be automatically generated and put inside the build directory. in case it is not there, rerun CMake or idf.py in order to create it.
No matter how many different approaches I have tried, the file does not seem to be generated ever, the same with sdkconfig.h (another prerequisite for main.c)

Anyone has encountered this error before?

ESP-IDF framework + CLion PlatformIO is an internal conflict – the ESP-IDF framework needs a CMakeList.txt and related config files of a specific form are needed by the ESP-IDF framework, however PlatformIO generates its own CMakeLists.txt to tell CLion to build with pio. See Newly generated espidf project doesn't build in CLion - #15 by valeros.

@valeros Is there any update on this situation?

1 Like

Aha, I changed the platform version and it compiled with no problems. Thank you very much for the input!

Be aware that this thereby rolls you back to ESP-IDF v3.3 LTS – a proper fix for this conflict should be worked on regardless.

If you need ESP-IDF v4.0.1 (from the latest platform), either temporarily use other IDEs like VSCode etc directly which have no such conflict, or use the CLI (pio run).