CLion Arduino support

已回答

So I tried 2 plug-ins for Arduino support on CLion: PlatFormIO and Arduino Support + Serial Monitor.

When I use PlatFormIO, I get an empty list when I try to make a project.

I can't even make a project, I tried going into the settings redirect, but I don't know what to fill here:

 

When I use the second plug-in, I get the project all right, but in the video, you need an 'Application' run configuration, which doesn't exist in the list at all. I assume it's called 'CMake Application' now, but I still don't know what to fill, in the video he shows that target is upload, but I don't have such an option:

I also put the name of the Arduino file in the executable:

I clicked OK, but all the options are greyed out:

So I can't get a run configuration. How do I fix this?
PS: A full screenshot with all values in run configuration shown will really help.

0

Hello!

It seems the PlatformIO utility is not installed on your machine. Please follow this guide https://docs.platformio.org/en/latest/integration/ide/clion.html#installation. And see this video fragment - https://www.youtube.com/watch?v=Kz5NQiji9YU&t=5025s.

1

Thanks!

I had many issues, like CLion wouldn't recognize Arduino.h, it would give avr-gcc errors etc.

For anyone else facing this issue, try this:

CLion -> Settings -> Plugins -> Install: 'PlatFormIO for CLion'
Command Prompt: 'python get-platformio.py'
Windows -> 'Edit the systems environment variables' -> Environment Variables -> New: 'Variable Value' = 'Path',
'Variable Value' = 'C:\Users\...\.platformio\Scripts' -> OK
CLion -> Settings -> Build, Execution, Deployment -> Toolchains -> New/Plus: 'Environment' = 'MinGW\mingw64',
'C Compiler' = 'C:\Users\...\.platformio\packages\toolchain-atmelavr\bin\avr-gcc.exe',
'C++ Compiler' = 'C:\Users\...\.platformio\packages\toolchain-atmelavr\bin\avr-g++.exe',
'Debugger' = 'C:\Users\...\.platformio\packages\toolchain-atmelavr\bin\avr-gdb.exe' -> Make it default (Up arrow)
New Project -> PlatFormIO -> Select Board -> Create
Run configurations -> Edit Configuration -> New/Plus -> PlatFormIO Upload -> Remove 'Build' from 'Before Launch' -> OK
Play button to upload
0

请先登录再写评论。