Clion Extensions

Plugin for CLION allowing developing a ESP32 firmware, downloading it and debugging it using the integrated debugger by jtag. After installed this plugin, you will be able to create a new c project:. After create this type of project, you will see a set of predefined configurations to compile. Apr 14, 2021 CLion supports the Microsoft Visual C compiler that ships with Visual Studio 2013, 2015, 2017, and 2019. Note that msbuild is not supported: CLion runs CMake with the NMAKE generator instead. For the case when your code includes MSVC extensions, CLion provides the support for: uuidof, forceinline, unaligned, and alignof keywords. Clion打开ClangFormat之后,选中代码段调用'Reformat Code'(快捷键⌥⌘L on macOS),使用.clang-format定义风格格式选中代码。 保存文件自动格式化. 在CLion中安装File Watchers插件 在CLion-Preferences-Tools-File Watchers新建一个自定义模板,按照下面的配置参数。. CLion is ranked 3rd while Visual Studio Code is ranked 8th. The most important reason people chose CLion is: CLion has an intelligent autocompletion engine that tries to predict the symbol you are typing based on your previous history and the context in which it's being typed.

CLion is a cross-platform C/C++ IDE forLinux, OS X, and Windows. CLion includes such features as a smart editor, codegeneration, code quality assurance, automated refactorings, on-the-fly code analysis,project manager, integrated version control systems and debugger.

Refer to the CLion Documentationpage for more detailed information.

Contents

  1. Install PlatformIO Core (CLI). See Installation guide

    Warning

    This a temporary step and depends on CLion #CPP-19412: Automatically install PlatformIO Core

  2. Download and install CLion IDE

  3. Install official PlatformIO for CLion plugin.Open “Configure > Plugins” window and go to the “Marketplace” tab. Search forPlatformIO and press the “Install” button.

  4. Restart CLion IDE.

Note

We also recommend to install Iniplugin that provides syntax highlighting, formatting, code folding, and viewingstructure for “platformio.ini” (Project Configuration File).

PlatformIO does not depend on “CMake” and uses own multi-platform build system.Project configuration, such as build flags, library dependencies, etc., should bedeclared in “platformio.ini” (Project Configuration File).

Clion Extensions

Warning

Please note that “PlatformIO for CLion” plugin does not update automatically CLionconfiguration. There is a feature request CLion #CPP-18367: Follow platformio.ini changes and update the project.

Update CLion configuration: “Tools > PlatformIO > Re-Init”

This is a known issue CLion CPP-19478: CLion does not handle “CMAKE_CONFIGURATION_TYPES” from CMakeLists.txt.A temporary solution is to manually configure project profiles in CLion.

Please open CLion Settings and navigate to “Build, Execution, Deployment > CMake”.Press “+” button and PlatformIO-based project profiles:

CLion uses “CMake” tool for code completion and code linting. As a result, itdoesn’t support the Arduino files (*.ino and .pde) because they arenot valid C/C++ based source files:

  1. Missing includes such as #include<Arduino.h>

  2. Function declarations are omitted.

See how to Convert Arduino file to C++ manually.

This tutorial introduces you to the basics of PlatformIO for CLion workflow and showsyou a creation process of a simple “Blink” example. After finishing you willhave a general understanding of how to work with projects in the CLion IDE.

  1. Please open “New Project” wizard, select board and framework, and create a newPlatformIO project. Please USE ONLY Latin characters (a-z) in a project name toavoid further issues with project compilation. Numbers and some symbols areallowed depending on a file system:

  1. Rename main.c file in src folder to main.cpp (right click on a filemain.c, Refactor > Rename…) . Paste the next contents:

Warning

The code below works only in pair with Arduino-based boards. Pleasefollow to PlatformIO Project Examplesrepository for other pre-configured projects.

  1. Open project configuration wizard and add PlatformIOUpload andPlatformIODebug configurations (you can add the rest configurations if you need them):

  1. Remove pre-task (“Build”) from PlatformIOUpload and PlatformIODebugconfigurations to avoid double project building. You should see “There are no tasksto run before launch”.

  1. Select PlatformIOUpload configuration and use the “Build” button for projectcompilation or the “Run” for a firmware uploading:

Please open CLion terminal and use Device Manager CLI. You can also configuredevice monitor per project using Monitor options.

Please note that you need to manually close/stop device monitor before firmware uploading.

“PlatformIO for CLion” supports Debugging which allows you to debug yourapplication with 1-Click without extra steps. Please select PlatformIODebugconfiguration and press the “Debug” button:

Please navigate to the “Peripheral” tab in a “Debug” view, press the “Configure” iconand select registers to monitor. Close configuration window.

Clion Extensions For Chrome

Warning

Currently, CLion does not load automatically Peripheral Register Definitions (SVD file)provided by PlatformIO. There is a feature request CLion #CPP-18369: Support CLION_SVD_FILE_PATH CMake variable to auto-find svd file.

A temporary solution is to open CMakeListsPrivate.txt file from a root ofPlatformIO project and remember SVD file declared in CLION_SVD_FILE_PATH“CMake” variable. Now press the “+” button in Peripherals Wizard and select SVD filementioned in CLION_SVD_FILE_PATH.

Currently, PlatformIO Home is not integrated into “PlatformIO for CLion”. See relatedfeature request CLion: CPP-19493 Integrate PlatformIO Home.

Nevertheless, you can start it manually and open in your browser. Please note that somefeatures do not work, such as project opening. Please open CLion terminaland run pio home command:

Clion Extensions Reviews

Further for reading:

Clion Extensions Facebook

  • Tutorials and Examples (step-by-step tutorials with debugging and unit testing)

  • CLion documentation.

Clion Extensions For Sale

Happy coding with PlatformIO!