PlatformIO Community

CLion - Nothing to run on / Finding device - Arduino Newbie needs help

Hello there, I’m new to C++, embedded and toolchains (in practical use).

Using CLion I tried to follow the steps detailed here:


which led to the Configuration Selection appending “Nothing to run on”.

I could build via Tools>PlattformIO>Build

The Device (ESP-32 Devboard) is listed in the online interface as
COM3 Silicon Labs CP210x USB to UART Bridge (COM3) USB VID:PID=10C4:EA60 SER=0001 LOCATION=1-1.1.2

After manually setting up a (MinGW) Toolchain (Couldn’t create a CMake Profile without)
CLions IntelliSense does not find Arduino.h or a file on the same level.

The only issue that sounds anything similar is this, but I do not see a solution there.

Would be thankful for help?

  1. Full platformio.ini?
  2. Screenshot of Settings -> Build -> CMake?
  3. Have you tried doing a Tools -> PlatformIO -> Re-Init?
  4. Output of right-click on project -> Reload CMake project?
  1. platformio.ini
    [env:esp32dev]
    platform = espressif32
    board = esp32dev
    framework = arduino
    upload_port = COM3

  2. CMake
    Unbenannt

  3. Re-init
    Yes multiple times: (most recent)
    C:\Users\User.platformio\penv\Scripts\platformio.exe -c clion init --ide clion

The current working directory C:\Users\User\CLionProjects\FixtureProject will be used for the project.

The next files/directories have been created in C:\Users\User\CLionProjects\FixtureProject
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File

Project has been successfully updated including configuration files for clion IDE.

Process finished with exit code 0

  1. CMake Debug Output:
    C:\Users\User\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\203.6682.181\bin\cmake\win\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G “CodeBlocks - MinGW Makefiles” C:\Users\User\CLionProjects\FixtureProject
    – Configuring done
    – Generating done
    – Build files have been written to: C:/Users/User/CLionProjects/FixtureProject/cmake-build-debug

[Finished]

Those CMake settings are wrong since it should have a profile called esp32dev since that’s your platformio.ini. This is also mentioned in the docs.

Please remove that profile by clicking the - button and then the + should auto-add the correct environment.

1 Like

Thank you for your help, but this did not fix the “Nothing to run on” issue.

Hello @modellking,

Do you have at least one .c/.cpp file on your “src/” folder in your project ?

Clion will not like working or init the project without at least one source file, and “nothing to run on” will appear, instead of your environment.

As the guide said, I renamed the src/main.* file to src/main.cpp

Can you please show a screenshot of the CLion IDE with the error message?

In the top right corner, what target configurations are available in the dropdown?

There is no error message (where should one be?). It just doesn’t offer me to upload (or use any configuration) to the device.

configurations:
Debug
Production
Z_DUMMY_TARGET
PlattformIO Debug | Nothing to run on
PlattformIO Test | Nothing to run on
PlattformIO Upload | Nothing to run on
Unbenannt

Can you change the configuration to “PlatformIO Upload”?

Also it’s kinda wrong that “Debug” and “Production” are still there as targets, they should have been esp32dev. What does your CMake Profile menu look like now?

What does your Settings -> Build --> Toolchains menu look like?

Unbenannt
I suspect this is the right place to search for the problem (since its just the MinGW default) but I do certainly not know how to get this right. (Already tried the “delete and add” thingy)

Thanks for your help

CMake Profile is some posts above, upload doesn’t change a thing

Sorry to ask again, but can you confirm there is only the esp32dev Cmake profile in your settings?

18494_multiple_cmake_profile

yes there is
Unbenannt

Is there a manual step to link the project to the device aside from specifying the port and the kind of device in the ini or something?

For good measurement here is the device info the web interface gives me:
COM3
Silicon Labs CP210x USB to UART Bridge (COM3)
USB VID:PID=10C4:EA60 SER=0001 LOCATION=1-1.1.2

Having the microcontroller / USB device connected or not should not influence CLion showing “Nothing to run on” in any way whatsoever.

Well except for the fact that there’s an icon before the profile name I don’t see anything wrong with it. If the toolchain is alright (MinGW at the top and all compilers etc detected), it should just work.

Have you tried right-clicking on the project folder in CLion and doing “Reload CMake project”? What does that output?

Okay, this is weird, because for a moment I had exactly the same issue with an espressif32 based project. I can’t understand how (“nothing to run” appeared when I re-open the project), because “esp32dev” was on my Cmake profile too.

This is a long shot (because I don’t understand how I resolve the issue on my side, and I can’t reproduce it for some mysterious reasons), but could you try to clean the configurations, and add again the PIO ones again?

test6

1 Like

CMake Rebuild Output:
C:\Users\User\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\203.6682.181\bin\cmake\win\bin\cmake.exe -DCMAKE_BUILD_TYPE=esp32dev -G “CodeBlocks - MinGW Makefiles” C:\Users\User\CLionProjects\FixtureProject
– Configuring done
– Generating done
– Build files have been written to: C:/Users/User/CLionProjects/FixtureProject/cmake-build-esp32dev

[Finished]


@Copperbot How Why What??? Why does this do anything? I had changed the templetes, so I didn’t need to remove the Build again, but how why what? why does this work? Thank you!

Thank you all very much for your efforts!

I marked @Copperbot s Message as Solution because I believe this will be more useful to others. Thank you, @maxgerhardt, for the info about the re-adding of the CMake Profile though.

1 Like

Well, glad it was this haha

I suspect it comes from Clion, maybe he didn’t detect a change in certain files (.idea/workspace.xml ?), but I don’t understand why I can’t reproduce this bug anymore… and especially why an espressif32 based project, I never (ever) bump into this kind of issue with other frameworks… weird bug :laughing: