I have a project with platformio + clion working great on my laptop. I moved the project over to another computer (via VCS - really I just checked it out at a second location) and I am back to a familiar place: “Nothing to run on”
I think I did everything in the guide. I created a profile in “Build Execution & Deployment” / “Cmake”, re-initialized the pio project, everything I could find in that guide.
Neither the working nor non-working ones have a “Custom Build Target” defined.
I think “Nothing to run on” is really telling me it’s missing a “target” but I’m not sure where to set that.
I don’t have a [platformio] section where I define a default. I tried that, and it didn’t seem to make a difference - and on my other instance of clion I don’t have that and it works anyway. I’m not entirely sure what’s up with that.
I did make a tiny bit of progress, though. I created a ‘Production’ run configuration, which is a cmake target. That actually did what it was supposed to, and it recognizes that there are two possible targets - feather32u4 and adafruit_feather_m0.
note that it found the two targets I defined in platformio.ini (which makes sense, because those are the two targets that got generated and put into the generated CMakeLists.txt)
That’s great … but there’s still something missing. When I select PlatformIO Upload it still says “Nothing to run on.” So there’s still something missing here, something to signal to PlatformIO which target (m0 or 32u4) it should use. I don’t know how to give the PlatformIO targets “something to run on.”
Can you show a screenshow of how the Preferences → Build, Execution, Deployment → CMake configuration looks like? Especially looking at CLion — PlatformIO latest documentation, it says that sometimes manual creation of these profiles is needed. I only see a configuration “Production” in your screenshot if I interpret it correctly.
I think I figured out two things are required here:
You really do need he Z_DUMMY_TARGET target
After you create that target, and set it to “Production”, you need to DELETE the PlatformIO debug and upload run/debug configuration, then create a new one. For some reason you seem to have to do that step manually.
For a while I had a target named “Production” but I looked at the CMakeLists.txt that got generated by pio init and it includes this at the end:
add_executable(Z_DUMMY_TARGET ${SRC_LIST})
I had come across that dummy target once before but I didn’t dive into figuring out what it was / why you needed it. When you generate a brand new project with clion file / new project / platformio, it seems to generate Z_DUMMY_TARGET but if you fool around adding/deleting/moving stuff and you lose that target then everything works fine until you try to generate PlatformIO Upload.
I don’t understand PlatformIO enough to know what’s going on here, but since this is the internet let me recklessly speculate: when you add that PlatformIO Upload run configuration, it seems to look for the available targets specifically named Z_DUMMY_TARGET … why I couldn’t tell you.
What I’m trying to figure out is whether this is a platformio problem, a clion problem, or is it neither and it’s just my confusion?
I created a dummy project there, It exhibits this same problem:
“Nothing to run on”
I was fairly convinced the problem was in the CMake profile configuration, but I have two projects, both have profiles set up the same way. In the one that works, the above menu looks different - it has checkmarks showing the targets.
That item with the checkbox is not a ‘configuration’ at all. What is it? I think that’s the real issue here.
If anybody has experience with clion and platformio, maybe you can git clone the above and let me know. I’m using clion 2020.1.3 and the latest jetbrains platformio plugin (201.8743.17) and PlatformIO 5.0.4b1
Works all fine here. I re-initialized the project on the commandlne (pio init --ide=clion), opened the project in CLion and then added the CMake targets for the the adafruit board.
Fixed that by manually removing build configurations (platformio upload & debug). Then ensured I already have targets coming from platformio.ini. Then added build configurations. In my case problem was that I added build configurations before adding correct targets. Hope this helps someone