PlatformIO
PlatformIO is an open-source ecosystem for embedded development. It allows working with various MCUs (such as ARM Cortex, AVR, MSP430), development boards, frameworks, and environments (Arduino, ESP-IDF, and many others).
CLion's integration with PlatformIO is provided by the PlatformIO for CLion plugin, created in collaboration with the PlatformIO team.
Installation
Install PlatformIO
For more information about the installation procedure, refer to official guide.
As you will be using PlatformIO in CLion, make sure to install Shell commands.
Install the PlatformIO plugin
Go to Marketplace.
and switch toSearch for PlatformIO for CLion and click Install.
Click Install.
After the installation is finished, click Restart IDE.
Create/open a PlatformIO project
Create a new project
Call PlatformIO in the left-hand pane.
from the main menu and selectSet the project name, choose a board or framework, and click Create.
CLion will generate a PlatformIO project:
For Arduino-based boards, CLion generates main.cpp instead of main.c and fills it with Arduino-specific stub code:
Open a project
Click Open on the Welcome screen or select from the main menu.
Navigate to the project folder and select the platformio.ini file.
Click Open as Project.
PlatformIO actions
Several PlatformIO commands are available as IDE actions. Use on the main menu or right-click platformio.ini in the Project tree and select the PlatformIO node:
Reload PlatformIO Project - calls pio project init. Use this action to update your project following the changes in platformio.ini.
Static Code Analysis - calls pio check for static code analysis.
PlatformIO Serial Monitor - calls pio device monitor.
Update Platforms, Toolchains, etc - calls pio pkg update.
PlatformIO Home - calls
pio home
and opens PlatformIO Home in your browser.
PlatformIO tool window
PlatformIO tool window gives quick access to the most used commands and project actions.
Hover over an action to see the corresponding command:
At the bottom, you can find the COM port switcher. Use it to configure the COM port number for upload if you don’t want to rely on automatic port detection.
Debug features
The Debug action starts a debug session with PIO Unified Debugger by calling pio debug
.
All the CLion debug features are available, including peripheral registers view, memory view, and disassembly.
If there is an .svd file for the given platform, CLion will load it automatically. You can also specify it manually:
Coding assistance in platformio.ini
The Ini plugin, which comes in pair with the PlatformIO plugin, provides syntax highlighting, code formatting, and structure view for .ini files.
To open the structure view for platformio.ini, open it in the editor and then select from the main menu or press Control+F12.
You can navigate to a property via Go to Symbol (Control+Alt+Shift+N or on the main menu).
Also, the Ini plugin provides inspections for detecting duplicate properties and sections. You can change the severity of these inspections and turn them on/off in .