Clion configuration and make flash

nesicarh
Posts: 5
Joined: Wed Feb 13, 2019 3:16 pm

Clion configuration and make flash

Postby nesicarh » 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?

ESP_cermak
Posts: 69
Joined: Thu Nov 01, 2018 8:32 am

Re: Clion configuration and make flash

Postby ESP_cermak » Sat Feb 16, 2019 9:16 am

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.

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: Clion configuration and make flash

Postby Deouss » Sat Feb 16, 2019 5:51 pm

I actually was wondering if it is possible to debug CMake files with some nice GUI tool or at least convenient way.

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: Clion configuration and make flash

Postby permal » Sun Feb 17, 2019 12:17 pm

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.

ESP_cermak
Posts: 69
Joined: Thu Nov 01, 2018 8:32 am

Re: Clion configuration and make flash

Postby ESP_cermak » Sun Feb 17, 2019 2:24 pm

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.

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: Clion configuration and make flash

Postby permal » Sun Feb 17, 2019 2:32 pm

Hm, that's not my experience (I'm on Linux too). Perhaps they have done something recently that has fixed this.

nesicarh
Posts: 5
Joined: Wed Feb 13, 2019 3:16 pm

Re: Clion configuration and make flash

Postby nesicarh » Sat Mar 02, 2019 12:00 pm

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.

permal
Posts: 384
Joined: Sun May 14, 2017 5:36 pm

Re: Clion configuration and make flash

Postby permal » Sun Mar 03, 2019 11:27 am

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.

Who is online

Users browsing this forum: No registered users and 92 guests