Page 1 of 1

Clion configuration and make flash

Posted: Wed Feb 13, 2019 3:20 pm
by nesicarh
Hi,

So I have managed to add xtensa compiler/debugger to CLion, and code completion and all the basic stuff works fine. I can run the build configuration and it will compile all the code for me. But when i run 'make flash' my sdkconfig resets to blank values so each time i want to run it i need to edit it with 'make menuconfig' first?

Anyone had similar issues?

Re: Clion configuration and make flash

Posted: Sat Feb 16, 2019 9:16 am
by ESP_cermak
Hi,

As CLion uses CMake as build system, you should stick to it when running flash/monitor targets.
I think your issue is that you build your project with CMake and then run `make flash` which would try to build again entire project with GNU make build system.

You can use `idf.py flash` and/or `idf.py monitor` which work fine in CLion terminal.

Re: Clion configuration and make flash

Posted: Sat Feb 16, 2019 5:51 pm
by Deouss
I actually was wondering if it is possible to debug CMake files with some nice GUI tool or at least convenient way.

Re: Clion configuration and make flash

Posted: Sun Feb 17, 2019 12:17 pm
by permal
nesicarh wrote:
Wed Feb 13, 2019 3:20 pm
Hi,

So I have managed to add xtensa compiler/debugger to CLion, and code completion and all the basic stuff works fine. I can run the build configuration and it will compile all the code for me. But when i run 'make flash' my sdkconfig resets to blank values so each time i want to run it i need to edit it with 'make menuconfig' first?

Anyone had similar issues?
I'm interested to hear how - or if - you got passed the problems where CMake complains that the compiler can't compile a simple test program - that's where I got stuck when trying to use CLion. This happens on clean builds with no pre-existing CMake cache.

Re: Clion configuration and make flash

Posted: Sun Feb 17, 2019 2:24 pm
by ESP_cermak
CLion works fine on linux, no tweaking required. Actually the IDE detects the default (system gcc) compiler/make/gdb under Settings->Toolchains and is happy to launch the cmake from IDF, which then finds xtensa (and runs compiler check like when executed from idf.py build).
Assuming it may work the same way on windows, IDE would detect system visual studio, then when on the actual cmake run it would set esp32 toolchain.

Re: Clion configuration and make flash

Posted: Sun Feb 17, 2019 2:32 pm
by permal
Hm, that's not my experience (I'm on Linux too). Perhaps they have done something recently that has fixed this.

Re: Clion configuration and make flash

Posted: Sat Mar 02, 2019 12:00 pm
by nesicarh
Hi,

As CLion uses CMake as build system, you should stick to it when running flash/monitor targets.
I think your issue is that you build your project with CMake and then run `make flash` which would try to build again entire project with GNU make build system.

You can use `idf.py flash` and/or `idf.py monitor` which work fine in CLion terminal.
Yeah, that was the problem. Thank you very much! As for the cmake project complaining, i just set the variables in Build settings and added idf path and path to environment variables. It worked just fine.

Re: Clion configuration and make flash

Posted: Sun Mar 03, 2019 11:27 am
by permal
nesicarh wrote:
Sat Mar 02, 2019 12:00 pm
As for the cmake project complaining, i just set the variables in Build settings and added idf path and path to environment variables. It worked just fine.
I can confirm this - something has changed recently either in CLion or IDF, making it work fine.