neulab/tldr huggingface dataset:
• Apr 02, 2016 - Diego Pinto - Você tem coragem de abandonar a IDE do Arduino? PlatformIO + Atom (Do you dare to leave the Arduino IDE? PlatformIO + Atom, Portuguese)
• Mar 30, 2016 - Brandon Cannaday - Getting Started with PlatformIO and ESP8266 NodeMcu
• Mar 12, 2016 - Peter Marks - PlatformIO, the Arduino IDE for programmers
• Mar 05, 2016 - brichacek.net - PlatformIO – otevřený ekosystém pro vývoj IoT (PlatformIO – an open source ecosystem for IoT development, Czech)
• Mar 04, 2016 - Ricardo Vega - Programa tu Arduino desde Atom (Program your Arduino from Atom, Spanish)
• Feb 28, 2016 - Alex Bloggt - PlatformIO vorgestellt (Introduction to PlatformIO IDE, German)
• Feb 25, 2016 - NutDIY - PlatformIO Blink On Nodemcu Dev Kit V1.0 (Thai)
See a full list with articles.
Changelog Please visit releases page.
CLion The CLion is a cross-platform C/C++ IDE for Linux, OS X, and Windows. CLion includes such features as a smart editor, code generation, code quality assurance, automated refactorings, on-the-fly code analysis, project manager, integrated version control systems and debugger.
Refer to the CLion Documentation page for more detailed information. [image]
• Project configuration and CMake
• CLion does not load project build environments from "platformio.ini"
• Arduino .ino files are not supported
• Build & Upload
• Configuration options
• Device/Serial Monitor
• PlatformIO Home
Installation 1. Install PlatformIO Core (CLI). See core_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 for PlatformIO and press the "Install" button.  [image]
4. Restart CLion IDE.
NOTE: We also recommend to install Ini plugin that provides syntax highlighting, formatting, code folding, and viewing structure for projectconf.
Known issues Project configuration and CMake PlatformIO does not depend on "CMake" and uses own multi-platform build system.  Project configuration, such as build flags, library dependencies, etc., should be declared in projectconf.
WARNING: Please note that "PlatformIO for CLion" plugin does not update automatically CLion configuration. There is a feature request CLion #CPP-18367:  Follow platformio.ini changes and update the project.
Update CLion configuration: "Tools > PlatformIO > Re-Init"
CLion does not load project build environments from platformio.ini 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: [image]
Arduino .ino files are not supported CLion uses "CMake" tool for code completion and code linting. As a result, it doesn't support the Arduino files (*.ino and .pde) because they are not valid C/C++ based source files:
See how to faq_convert_ino_to_cpp.
Quick Start This tutorial introduces you to the basics of PlatformIO for CLion workflow and shows you a creation process of a simple "Blink" example. After finishing you will have a general understanding of how to work with projects in the CLion IDE.
Setting Up the Project 1. Please open "New Project" wizard, select board and framework, and create a new PlatformIO project. Please USE ONLY Latin characters (a-z) in a project name to avoid further issues with project compilation. Numbers and some symbols are allowed depending on a file system: [image]
2. Rename main.c file in src folder to main.cpp  (right click on a file main.c, Refactor > Rename...) . Paste the next contents:
WARNING: The code below works only in pair with Arduino-based boards. Please follow to PlatformIO Project Examples repository for other pre-configured projects.
Build & Upload 1. Open project configuration wizard and add PlatformIO Upload and PlatformIO Debug configurations (you can add the rest configurations if you need them): [image]
2. Remove pre-task ("Build") from PlatformIO Upload and PlatformIO Debug configurations to avoid double project building. You should see "There are no tasks to run before launch". [image]
3. Select PlatformIO Upload configuration and use the "Build" button for project compilation or the "Run" for a firmware uploading: [image]
Configuration options • projectconf_section_env_build
Device/Serial Monitor Please open CLion terminal and use cmd_device. You can also configure device monitor per project using projectconf_section_env_monitor.
Please note that you need to manually close/stop device monitor before firmware uploading.
Debugging "PlatformIO for CLion" supports piodebug which allows you to debug your application with 1-Click without extra steps. Please select PlatformIO Debug configuration and press the "Debug" button: [image]
Peripheral Registers Please navigate to the "Peripheral" tab in a "Debug" view, press the "Configure" icon and select registers to monitor. Close configuration window.
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 of PlatformIO project and remember SVD file declared in CLION_SVD_FILE_PATH "CMake" variable. Now press the "+" button in Peripherals Wizard and select SVD file mentioned in CLION_SVD_FILE_PATH. [image]
PlatformIO Home Currently, piohome is not integrated into "PlatformIO for CLion". See related feature request CLion: CPP-19493 Integrate PlatformIO Home.
Nevertheless, you can start it manually and open in your browser. Please note that some features do not work, such as project opening. Please open CLion terminal and run cmd_home command:
platformio -c clion home [image]
Further for reading:
• tutorials (step-by-step tutorials with debugging and unit testing)
• CLion documentation.
Happy coding with PlatformIO!
CodeBlocks Code::Blocks is a free, open-source cross-platform IDE that supports multiple compilers including GCC, Clang and Visual C++. It is developed in C++ using wxWidgets as the GUI toolkit. Using a plugin architecture, its capabilities and features are defined by the provided plugins. Currently, Code::Blocks is oriented towards C, C++, and Fortran.
CodeBlocks IDE can be downloaded from here.  .SS Contents
• CodeBlocks
Integration Integration process consists of these steps:
1. Open system Terminal and install piocore
2. Create new folder for your project and change directory (cd) to it
3. Generate a project using PIO Core Project Generator (platformio project init --ide)
4. Import project in IDE.
Choose board ID using cmd_boards or Embedded Boards Explorer command and generate project via platformio project init --ide command:
platformio project init --ide codeblocks --board <ID>
# For example, generate project for Arduino UNO platformio project init --ide codeblocks --board uno
1. Open this project via Menu: File > Open...
2. Add new files to src directory (*.c, *.cpp, *.ino, etc.) via Menu: File > New > File...
3. Build project using Menu: Build > Build
4. Upload firmware using Menu: Build > Run
WARNING: The libraries which are added, installed or used in the project after generating process won't be reflected in IDE. To fix it you need to reinitialize project using cmd_project_init (repeat it).
Eclipse The Eclipse CDT (C/C++ Development Tooling) Project provides a fully functional C and C++ Integrated Development Environment based on the Eclipse platform. Features include: support for project creation and managed build for various toolchains, standard make build, source navigation, various source knowledge tools, such as type hierarchy, call graph, include browser, macro definition browser, code editor with syntax highlighting, folding and hyperlink navigation, source code refactoring and code generation, visual debugging tools, including memory, registers, and disassembly viewers.
Refer to the CDT Documentation page for more detailed information.  .SS Contents
• Live Integration
platformio project init --ide eclipse --board <ID>
# For example, generate project for Arduino UNO platformio project init --ide eclipse --board uno
1. Import this project via Menu: File > Import... > General > Existing Projects into Workspace > Next and specify root directory where is located projectconf
2. Open source file from src directory (*.c, *.cpp, *.ino, etc.)
3. Build project using Menu: Project > Build Project or pre-configured Make Targets (see screenshot below):
• PlatformIO: Build - Build project without auto-uploading
• PlatformIO: Clean - Clean compiled objects.
• PlatformIO: Test - unit_testing
• PlatformIO: Upload - Build and upload (if no errors)
• PlatformIO: Upload using Programmer see atmelavr_upload_via_programmer
• PlatformIO: Upload SPIFFS image see platform_espressif_uploadfs
• PlatformIO: Update platforms and libraries - Update installed platforms and libraries via cmd_update
• PlatformIO: Rebuild C/C++ Project Index - Rebuild C/C++ Index for the Project.  Allows one to fix code completion and code linting issues.
If you have some problems with unresolved includes, defines, etc., then
1. Rebuild PlatformIO Project Index: PlatformIO: Rebuild C/C++ Project Index target
2. Rebuild Eclipse Project Index: Menu: Project > C/C++ Index > Rebuild
3. Refresh Project, right click on the project Project > Refresh (F5) or restart Eclipse IDE.
WARNING: The libraries which are added, installed or used in the project after generating process won't be reflected in IDE. To fix it please run PlatformIO: Rebuild C/C++ Project Index target and right click on the project and Project > Refresh (F5).
WARNING: The C/C++ GCC Cross Compiler Support package must be installed in Eclipse, otherwise the CDT Cross GCC Built-in Compiler Settings provider will not be available (check the Providers tab in Project > Properties > C/C++ General > Preprocessor Include Paths, Macros etc. for a marked entry named CDT Cross GCC Built-in Compiler Settings).
If this provider is not available, toolchain related includes cannot be resolved.
Live Integration Eclipse Virtual IoT Meetup: PlatformIO: a cross-platform IoT solution to build them all!  .SS Debugging
A debugging feature is provided by piodebug and new debug configuration named "PlatformIO Debugger" is created. No need to do extra configuration steps!
1. Build a project first time or after "Clean" operation using PlatformIO: Build target
2. Launch debugger via "Menu: Debug" or "Bug Icon" button on Tool Bar.
3. Wait for a while, PlatformIO will prepare project for debugging and session will be started soon.
Articles / Manuals • May 05, 2016 - Ivan Kravets, Ph.D. / Eclipse Virtual IoT Meetup - PlatformIO: a cross-platform IoT solution to build them all!
• Sep 01, 2015 - Thomas P. Weldon, Ph.D. - Improvised MBED FRDM-K64F Eclipse/PlatformIO Setup and Software Installation
• Jul 11, 2015 - TrojanC - Learning Arduino GitHub Repository
• June 20, 2014 - Ivan Kravets, Ph.D. - Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO
Emacs GNU Emacs is an extensible, customizable text editor - and more. At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing.
Refer to the Emacs Documentation page for more detailed information.  .SS Contents
• Emacs
• PlatformIO-Mode
• Project Generator
PlatformIO-Mode An Emacs minor mode has been written to facilitate building and uploading from within Emacs.  It can be installed from the MELPA repository using M-x package-install.  See the MELPA Getting Started page for more information.
Setup instructions and an example config can be found at the Github page.
Code completion can optionally be provided by installing irony-mode
Project Generator Choose board ID using cmd_boards or Embedded Boards Explorer command and generate project via platformio project init --ide command:
platformio project init --ide emacs --board <ID>
There are 6 predefined targets for building.
• platformio_build  - Build project without auto-uploading.        (C-c i b)
• platformio_clean  - Clean compiled objects.                      (C-c i c)
• platformio_upload - Build and upload (if no errors).             (C-c i u)
• platformio_programmer_upload - Build and upload using external programmer (if no errors, see atmelavr_upload_via_programmer). (C-c i p)
• platformio_spiffs_upload  - Upload files to file system SPIFFS (see platform_espressif_uploadfs). (C-c i s)
• platformio_update - Update installed platforms and libraries.    (C-c i d)
NetBeans NetBeans is a Java-based integrated development environment (IDE). It provides out-of-the-box code analyzers and editors for working with the latest Java 8 technologies--Java SE 8, Java SE Embedded 8, and Java ME Embedded 8. The IDE also has a range of new tools for HTML5/JavaScript, in particular for Node.js, KnockoutJS, and AngularJS; enhancements that further improve its support for Maven and Java EE with PrimeFaces; and improvements to PHP and C/C++ support.
NetBeans IDE can be downloaded from here.  Just make sure you download the C/C++ version (or if you already use NetBeans, install the C/C++ development plugins).
WARNING: Note that the version of NetBeans IDE provided by some Linux package repositories may be a Flatpak version, which are known to have issues with accessing the PlatformIO CLI installed due to the container nature of this technology. It is recommended that you use the native version of the NetBeans IDE via the above link. .SS Contents
• NetBeans
platformio project init --ide netbeans --board <ID>
# For example, generate project for Arduino UNO platformio project init --ide netbeans --board uno
1. Open this project via Menu: File > Open Project...
2. Add new files to src directory (*.c, *.cpp, *.ino, etc.) via right-click on src folder in the "Projects" pane
3. Build project using Menu: Run > Build Project
4. Upload firmware using Menu: Run > Run Project
Articles / Manuals • Feb 22, 2016 - Grzegorz Hołdys - How to Integrate PlatformIO with Netbeans
See the full list with articles.
Qt Creator The Qt Creator is an open source cross-platform integrated development environment. The editor includes such features as syntax highlighting for various languages, project manager, integrated version control systems, rapid code navigation tools and code autocompletion.
Refer to the Qt-creator Manual page for more detailed information.  .SS Contents
• Qt Creator
• Manual Integration
• Setup New Project
• First program in Qt Creator
platformio project init --ide qtcreator --board <ID>
# For example, generate project for Arduino UNO platformio project init --ide qtcreator --board uno
1. Import project via File > Open File or Project and select platformio.pro from the folder where is located projectconf
2. Select default desktop kit and click on Configure Project (Projects mode, left panel)
3. Set General > Build directory to the project directory where is located projectconf
4. Remove all items from Build Steps, click on Build Steps > Add Build Step > Custom Process Step and set:
• Command: platformio
• Arguments: -f -c qtcreator run
• Working directory: %{buildDir}
5. Remove all items from Clean Steps, click on Clean Steps > Add Clean Step > Custom Process Step and set:
• Arguments: -f -c qtcreator run --target clean
6. Update PATH in Build Environment > PATH > EDIT with the result of this command (paste in Terminal):
# Linux, Mac echo $PATH
# Windows echo %PATH%
7. Switch to Edit mode (left panel) and open source file from src directory (*.c, *.cpp, *.ino, etc.)
8. Build project: Menu: Build > Build All. .sp WARNING: The libraries which are added, installed or used in the project after generating process won't be reflected in IDE. To fix it you need to reinitialize project using cmd_project_init (repeat it).
Manual Integration Setup New Project First of all, let's create new project from Qt Creator Start Page: New Project or using Menu: File > New File or Project, then select project with Empty Qt Project type (Other Project > Empty Qt Project), fill Name, Create in.
On the next steps select any available kit and click Finish button. [image]
Secondly, we need to delete default build and clean steps and configure project with PlatformIO Build System (click on Projects label on left menu or Ctrl+5 shortcut):
Thirdly, change project file by adding path to directories with header files. Please edit project file to match the following contents:
win32 { HOMEDIR += $$(USERPROFILE) } else { HOMEDIR += $$(HOME) }
INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/framework-arduinoavr/cores/arduino" INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/toolchain-atmelavr/avr/include" .SS First program in Qt Creator
Simple "Blink" project will consist from two files: 1. In the console, navigate to the root of your project folder and initialize platformio project with cmd_project_init 2. The main "C" source file named main.c must be located in the src directory.  Let's create new text file named main.c using Menu: New File or Project > General > Text File:
Copy the source code which is described below to file main.c.
#include "Arduino.h" #define WLED    13  // Most Arduino boards already have an LED attached to pin 13 on the board itself
void setup() { pinMode(WLED, OUTPUT);  // set pin as output }
void loop() { digitalWrite(WLED, HIGH);  // set the LED on delay(1000);               // wait for a second digitalWrite(WLED, LOW);   // set the LED off delay(1000);               // wait for a second }
3. Locate the project configuration file named platformio.ini at the root of the project directory and open it.
Edit the content to match the code described below.
[env:arduino_uno] platform = atmelavr framework = arduino board = uno
Conclusion Taking everything into account, we can build project with shortcut Ctrl+Shift+B or using Menu: Build > Build All.
Sublime Text The Sublime Text is a cross-platform text and source code editor, with a Python application programming interface (API). Sublime Text is proprietary software. Its functionality is extendable with plugins. Most of the extending packages have free-software licenses and are community-built and maintained. Sublime Text lacks graphical setting dialogues and is entirely configured by editing text files.
Refer to the Sublime Text Documentation page for more detailed information.  .SS Contents
• Deviot Plugin
• Initial configuration
• Command Hotkeys
• First program in Sublime Text
Deviot Plugin We are glad to inform you about an awesome Sublime Text plugin for IoT development named Deviot. It is based on piocore and will automatically install it for you. Please visit official Deviot page for the further installation steps and documentation.  .SS Integration
Project Generator Integration process consists of these steps:
platformio project init --ide sublimetext --board <ID>
# For example, generate project for Arduino UNO platformio project init --ide sublimetext --board uno
1. Import project via Menu: Project > Open Project... and select platformio.sublime-project from the folder where is located projectconf
2. Select PlatformIO as build system: Menu: Tools > Build System > PlatformIO
3. Open source file from src directory (*.c, *.cpp, *.ino, etc.)
4. Build project: Menu: Tools > Build.
Also, you can access to all pre-configured targets via Menu: Tools > Builds With... (ST3)
• PlatformIO - Build - Build project without auto-uploading
• PlatformIO - Clean - Clean compiled objects.
• PlatformIO - Test - unit_testing
• PlatformIO - Upload - Build and upload (if no errors)
• PlatformIO - Upload using Programmer see atmelavr_upload_via_programmer
• PlatformIO - Upload SPIFFS image see platform_espressif_uploadfs
• PlatformIO - Update platforms and libraries - Update installed platforms and libraries via cmd_update.
Manual Integration NOTE: Please verify that folder where is located platformio program is added to PATH (wiki) environment variable.
Initial configuration First of all, we need to create "New Build System" with name "PlatformIO" from Menu: Tools > Build System > New Build System and fill it like described below:
{ "cmd": ["platformio", "-f", "-c", "sublimetext", "run"], "working_dir": "${project_path:${folder}}", "variants": [ { "name": "Clean", "cmd": ["platformio", "-f", "-c", "sublimetext", "run", "--target", "clean"] }, { "name": "Upload", "cmd": ["platformio", "-f", "-c", "sublimetext", "run", "--target", "upload"] } ] }
Secondly, we need to select "PlatformIO" Build System from a list: [image]
After that, we can use the necessary commands from Menu: Tools > Command Palette or with Ctrl+Shift+P (Windows/Linux) Cmd+Shift+P (Mac) shortcut. [image]
Command Hotkeys Sublime Text allows one to bind own hotkey per command. Let's setup them for PlatformIO commands using shortcut Menu: Preferences > Key-Bindings - User: [image]
We are going to use these shortcuts:
• F11 for clean project
• F12 for upload firmware to target device
In this case, the final code will look like:
[ { "keys": ["f11"], "command": "build", "args": {"variant": "Clean"} }, { "keys": ["f12"], "command": "build", "args": {"variant": "Upload"} } ]
First program in Sublime Text Simple "Blink" project will consist from two files:
1. Main "C" source file named main.c must be located in the src directory.  Let's create new file named main.c using Menu: File > New File or shortcut Ctrl+N (Windows/Linux) Cmd+N (Mac) with the next contents:
2. Project Configuration File named platformio.ini must be located in the project root directory.  Copy the source code which is described below to it.
Conclusion Taking everything into account, we can open project directory in Sublime Text using Menu: File > Open Folder and build it with shortcut Ctrl+B (Windows/Linux) or Cmd+B (Mac), clean project with shortcut F11 and upload firmware to target with shortcut F12.
Debugging A debugging feature is provided by piodebug and new debug configuration named "PlatformIO Debugger" is created. No need to do extra configuration steps!
1. Install SublimeGDB package
2. Launch debugger with F5
Vim Vim is an open-source, powerful and configurable text editor. Vim is designed for use both from a command-line interface and as a standalone application in a graphical user interface.  [image]
Contents • Vim
• "Neomake-PlatformIO" Plugin
Neomake-PlatformIO Plugin Please visit neomake-platformio for the further installation steps and documentation.
platformio project init --ide vim --board <ID>
Recommended bundles:
• C/C++/ language server supporting cross references, hierarchies, completion and semantic highlighting - CCLS: vim lsp
• Syntax highlight - Arduino-syntax-file
• Code Completion - YouCompleteMe (see configuration example by Anthony Ford PlatformIO/YouCompleteMe Integration)
• Syntax checking - Syntastic
Put to the project directory Makefile wrapper with contents:
# Uncomment lines below if you have problems with $PATH #SHELL := /bin/bash #PATH := /usr/local/bin:$(PATH)
all: platformio -f -c vim run
upload: platformio -f -c vim run --target upload
clean: platformio -f -c vim run --target clean
program: platformio -f -c vim run --target program
uploadfs: platformio -f -c vim run --target uploadfs
update: platformio -f -c vim update
Pre-defined targets:
• Build - Build project without auto-uploading
• Clean - Clean compiled objects.
• Upload - Build and upload (if no errors)
• Upload using Programmer see atmelavr_upload_via_programmer
• Upload SPIFFS image see platform_espressif_uploadfs
• Update platforms and libraries - Update installed platforms and libraries via cmd_update.
Now, in VIM cd /path/to/this/project and press Ctrl+B or Cmd+B (Mac). PlatformIO should compile your source code from the src directory, make firmware and upload it.
NOTE: If hotkey doesn't work for you, try to add this line nnoremap <C-b> :make<CR> to ~/.vimrc
Articles / Manuals • コマンドラインでArduino開発 : vim + platformio (Arduino development at the command line: VIM + PlatformIO, Japanese)
Visual Studio The Microsoft Visual Studio (Free) is an integrated development environment (IDE) from Microsoft. Visual Studio includes a code editor supporting IntelliSense (the code completion component) as well as code refactoring.
Refer to the Visual Studio Documentation page for more detailed information.  .SS Contents
• Visual Studio
• First program in Visual Studio
• IntelliSense Errors
platformio project init --ide visualstudio --board <ID>
# For example, generate project for Arduino UNO platformio project init --ide visualstudio --board uno
1. Import this project via Menu: File > Open > Project/Solution and specify root directory where is located projectconf
3. Build project: Menu: Build > Build Solution.
Manual Integration Setup New Project First of all, let's create new project from Visual Studio Start Page: Start > New Project or using Menu: File > New > Project, then select project with Makefile type (Visual C++ > General > Makefile Project), fill Project name, Solution name, Location fields and press OK button. [image]
Secondly, we need to configure project with PlatformIO Build System: [image]
If we want to use native AVR programming, we have to specify additional preprocessor symbol ("Preprocessor definitions" field) about your MCU. For example, an Arduino Uno is based on the ATmega328 MCU. In this case We will add new definition  __AVR_ATmega328__.  [image]
Release Configuration is the same as Debug, so on the next step we check "Same as Debug Configuration" and click "Finish" button.  [image]
Thirdly, we need to add directories with header files using project properties (right click on the project name or Alt-Enter shortcut) and add two directories to Configuration Properties > NMake > Include Search Path:
$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\avr\include $(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\framework-arduinoavr\cores\arduino [image]
First program in Visual Studio Simple "Blink" project will consist from two files:
1. Main "C++" source file named main.cpp must be located in the src directory.  Let's create new file named main.cpp using Menu: File > New File or shortcut Ctrl+N: [image]
Copy the source code which is described below to file main.cpp.
#include "Arduino.h"
void setup() { pinMode(LED_BUILTIN, OUTPUT);  // set pin as output }
void loop() { digitalWrite(LED_BUILTIN, HIGH);  // set the LED on delay(1000);               // wait for a second digitalWrite(LED_BUILTIN, LOW);   // set the LED off delay(1000);               // wait for a second }
2. Project Configuration File named platformio.ini must be located in the project root directory. [image]
Copy the source code which is described below to it.
Conclusion Taking everything into account, we can build project with shortcut Ctrl+Shift+B or using Menu: Build > Build Solution.
Known issues IntelliSense Errors VS Studio does not allow one to specify for project other toolchain which will be used by IntelliSense. In this case, IntelliSense does not understand GCC-specific definitions.
However, these errors does not have any influence on PlatformIO Build System. It means that you can ignore them and rely on PlatformIO Build System messages which will be shown in output console after build.
Nevertheless, you can provide an IntelliSense-friendly definition of problematic GCC constructs and make sure that the GCC will ignore such definitions or disable IntelliSense error reporting at all.  See details in issue #543 .SS VSCode
PlatformIO IDE is the next-generation integrated development environment for IoT.
Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Python, PHP, Go) and runtimes (such as .NET and Unity) .SS Contents
• Custom Build Task
• Key Bindings
• Project Tasks
• Task Explorer
• Task Runner
• Custom Tasks
• Multi-project Workspaces
• Variable Format
• Watchpoints
• Proxy Server Support
• platformio-ide.activateOnlyOnPlatformIOProject
• platformio-ide.autoCloseSerialMonitor
• platformio-ide.autoRebuildAutocompleteIndex
• platformio-ide.buildTask
• platformio-ide.customPATH
• platformio-ide.disableToolbar
• platformio-ide.forceUploadAndMonitor
• platformio-ide.reopenSerialMonitorDelay
• platformio-ide.updateTerminalPathConfiguration
• platformio-ide.useBuiltinPIOCore
• platformio-ide.useDevelopmentPIOCore
• platformio-ide.disablePIOHomeStartup
• platformio-ide.pioHomeServerHttpPort
• PackageManager is unable to install tool
Installation NOTE: Please note that you do not need to install piocore separately if you are going to use VSCode. piocore is built into PlatformIO IDE and you will be able to use it within PlatformIO IDE Terminal.
0.  Download and install official Microsoft Visual Studio Code. PlatformIO IDE is built on top of it
1.  Open VSCode Package Manager
2.  Search for the official platformio ide extension
3.  Install PlatformIO IDE. [image]
Quick Start This tutorial introduces you to the basics of PlatformIO IDE workflow and shows you a creation process of a simple "Blink" example. After finishing you will have a general understanding of how to work with projects in the IDE.
Setting Up the Project 1. Click on "PlatformIO Home" button on the bottom PlatformIO Toolbar [image]
2. Click on "New Project", select a board and create new PlatformIO Project [image]
3. Open main.cpp file form src folder and replace its contents with the next:
4. Build your project with ctrl+alt+b hotkey (see all Key Bindings in "User Guide" section below) or using "Build" button on the PlatformIO Toolbar [image]
• Learn more about PlatformIO Toolbar and other commands (Upload, Clean, Serial Monitor) below.
PlatformIO Toolbar PlatformIO IDE Toolbar is located in VSCode Status Bar (left corner) and contains quick access buttons for the popular commands.  Each button contains hint (delay mouse on it).  [image]
1. piohome
2. PlatformIO: Build
3. PlatformIO: Upload
4. pioremote
5. PlatformIO: Clean
6. unit_testing
7. Run a task... (See "Task Runner" below)
8. Serial Port Monitor
9. PIO Terminal
Custom Build Task You can override default "PlatformIO: Build" task for "Build" command which is used by "Build" button in PlatformIO Toolbar and Key Bindings. See platformio-ide.buildTask setting in Settings for more details.
Built-in PlatformIO tasks are available in "Menu > Terminal > Run Task..." list.
Key Bindings • ctrl+alt+b / cmd-shift-b / ctrl-shift-b Build Project
• cmd-shift-d / ctrl-shift-d Debug project
• ctrl+alt+u Upload Firmware
• ctrl+alt+s Open Serial Port Monitor
You can override existing key bindings  or add a new in VSCode. See official documentation Key Bindings for Visual Studio Code.
Project Tasks Task Explorer PlatformIO provides access to "Project Task Explorer" where you can control the build process of the environments declared in projectconf. Project Task Explorer is located in the VSCode Activity Bar under the branded PlatformIO icon. You can also access it via "VSCode Menu > Open View... > PlatformIO".  [image]
Task Runner PlatformIO IDE provides built-in tasks through the menu Terminal > Run Task... (Build, Upload, Clean, Monitor, etc) and custom tasks per projectconf environment ([env:***]). The default behavior is to use Terminal Panels for presentation, one panel dedicated to each unique task.
The PlatformIO IDE provides its own Problems Matcher named $platformio. You can use it later if you decide to change base task settings.
You can override existing tasks with your own presentation options. For example, let's configure PlatformIO Task Runner to use a NEW Terminal panel for each "Build" command:
1. The menu item Terminal > Run Task... opens up a list of VSCode tasks for PlatformIO. In the line PlatformIO: Build, press the gear icon on the far right side of the list. This creates or opens the file .vscode/tasks.json with some template code.
2. Replace the template in tasks.json with this code
{ "version": "2.0.0", "tasks": [ { "type": "PlatformIO", "task": "Monitor", "problemMatcher": [ "$platformio" ], "presentation": { "panel": "new" } } ] }
See more options in the official VSCode documentation.
Custom Tasks Custom tasks can be added to tasks.json file located in the .vscode folder in the root of project. Please read the official documentation Tasks in VSCode.
This simple example demonstrates a custom monitor task which echoes input locally.  There are a lot of other commands, please read more about piocore and its commands (piocore_userguide).
{ "version": "2.0.0", "tasks": [ { "type": "shell", "command": "platformio", "args": [ "device", "monitor", "--echo" ], "problemMatcher": [ "$platformio" ], "label": "PlatformIO: Monitor (local echo)" } ] }
If the platformio executable file is not in your system environment "PATH", you can provide the full path to the binary folder using the options field for the task. For example, if the platformio binary is located in the home folder "~/.platformio/penv/bin":
{ "version": "2.0.0", "tasks": [ { "type": "shell", "command": "platformio", "args": [ "device", "monitor", "--echo" ], "problemMatcher": [ "$platformio" ], "label": "PlatformIO: Monitor (local echo)", "options": { "env": {"PATH": "${env:HOME}/.platformio/penv/bin"} } } ] }
Multi-project Workspaces You can work with multiple project folders in Visual Studio Code with multi-root workspaces. This can be very helpful when you are working on several related projects at the same time. Read more in the documentation Multi-root Workspaces.
Serial Port Monitor You can customize Serial Port Monitor using projectconf_section_env_monitor in projectconf:
• projectconf_monitor_port
• projectconf_monitor_speed
• projectconf_monitor_rts
• projectconf_monitor_dtr
• projectconf_monitor_flags
[env:esp32dev] platform = espressif32 framework = arduino board = esp32dev
; Custom Serial Monitor port monitor_port = /dev/ttyUSB1
; Custom Serial Monitor speed (baud rate) monitor_speed = 115200
Debugging Debugging in VSCode works in combination with piodebug. You should have pioaccount to work with it.
VSCode has a separate activity view named "Debug" (accessed by the bug icon on the left toolbar).  piodebug extends it with more advanced debugging instruments and features:
• A hot restart of an active debugging session.
There are two pre-configured debugging configurations:
PIO Debug Default configuration. PlatformIO runs the Pre-Debug task and builds the project using Debug Configuration. Also, it checks for project changes.
PIO Debug (skip Pre-Debug) PlatformIO skips the Pre-Debug stage and DOES NOT build or check the project for changes.  If you do changes in project source files, they will not be reflected in debug sessions until you switch back to the "PIO Debug" configuration or manually run the "Pre-Debug" task.
This configuration is very useful for quick debug session. It is super fast by skipping several checks, letting you control project changes manually.
NOTE: Please note that piodebug will use the first declared build environment in projectconf if the projectconf_pio_default_envs option is not specified. [image]
Variable Format Currently, VSCode does not provide an UI or API to change the variable format. See the related VSCode Issue #28025.
A temporary solution is to set the default numerical base in which the debugger displays numeric output in the Debug Console. (The Debug Console is visible during active debugging sessions). For example, to show variables in hexadecimal format, copy the code below and paste it into "Debug Console":
set output-radix 16
Possible values, listed in decimal base, are: 8, 10, 16.
Watchpoints Please read GDB: Setting Watchpoints first.
Currently, VSCode does not provide an API to change the value format of watchpoints.  You can manually cast watchpoint expressions to display the value as specific pointer types:
• $pc, default decimal integer format
• *0x10012000, an address, default decimal integer format
• (void*)$pc, $pc register, hexadecimal format
• *(void**)0x10012000, an address, hexadecimal format
Install Shell Commands Please refer to PIO Core piocore_install_shell_commands.
Proxy Server Support There are two options how to configure a proxy server:
1. Declare the HTTP_PROXY and HTTPS_PROXY system environment variables (for example HTTP_PROXY=http://user:pass@10.10.1.10:3128/, etc.)
2. Open VSCode Settings and search for "Proxy". Please set "Http: Proxy" and disable "Http: Proxy Strict SSL".
Settings How to configure VSCode settings?
platformio-ide.activateOnlyOnPlatformIOProject If true, activate the platformio ide extension only when a PlatformIO-based project (that has a projectconf) is open in the workspace. The default value is false.
platformio-ide.autoCloseSerialMonitor If true, automatically close cmd_device_monitor before uploading/testing. The default value is true.
platformio-ide.autoRebuildAutocompleteIndex If true, automatically rebuild the C/C++ Project Index when projectconf is changed or when new libraries are installed. The default value is true.
platformio-ide.buildTask The build task (label) that is launched by the "Build" button in the PlatformIO Toolbar and Key Bindings. The default is PlatformIO: Build.
You can create custom Custom Tasks and assign one of them to platformio-ide.buildTask.
platformio-ide.customPATH Custom PATH for the platformio command. Paste here the result of echo $PATH (Unix) / echo %PATH% (Windows) command by typing into your system terminal if you prefer to use a custom version of piocore. The default value is null, meaning PlatformIO looks for the platformio command in the system path.
platformio-ide.disableToolbar Disable the PlatformIO toolbar. The default value is false.
platformio-ide.forceUploadAndMonitor If true, the Upload (platformio-ide.upload) command is changed to use the "Upload and Monitor" task. The default value is false.
platformio-ide.reopenSerialMonitorDelay Configure the time in milliseconds before reopening the Serial Port Monitor.  The default value is 0, which means to reopen instantly.
platformio-ide.updateTerminalPathConfiguration If true, use a patched PATH environment for the Terminal configuration. The default value is true.
platformio-ide.useBuiltinPIOCore If true, use the built-in piocore. The default value is true.
platformio-ide.useDevelopmentPIOCore If true, use the development version of piocore. The default value is false.
platformio-ide.disablePIOHomeStartup Disable showing PIO Home at startup. The default value is false.
platformio-ide.pioHomeServerHttpPort PIO Home server HTTP port. The default value 0 automatically assigns a free port in the range [8010..8100]).
Known issues PackageManager is unable to install tool This is a known bug in VSCode Terminal issue #61.
A temporary solution is to install packages using a system terminal (not VSCode Terminal).  Please use "Solution 3: Run from Terminal" in FAQ > Package Manager > faq_package_manager_error_5.  Afterwards, go back to using the VSCode Terminal.
Changelog Please visit the releases page.
Continuous Integration Continuous Integration (CI, wiki) is the practice, in software engineering, of merging all developer working copies with a shared mainline several times a day.
cmd_ci command is intended to be used in combination with the build servers and the popular Continuous Integration Software.
By integrating regularly, you can detect errors quickly, and locate them more easily.
AppVeyor AppVeyor is an open-source hosted, distributed continuous integration service used to build and test projects hosted at GitHub on Windows family systems.
AppVeyor is configured by adding a file named appveyor.yml, which is a YAML format text file, to the root directory of the GitHub repository.
AppVeyor automatically detects when a commit has been made and pushed to a repository that is using AppVeyor, and each time this happens, it will try to build the project using cmd_ci command. This includes commits to all branches, not just to the master branch. AppVeyor will also build and run pull requests. When that process has completed, it will notify a developer in the way it has been configured to do so — for example, by sending an email containing the build results (showing success or failure), or by posting a message on an IRC channel. It can be configured to build project on a range of different platforms.
Contents • AppVeyor
• Using cmd_run command
• Using cmd_ci command
Integration Put appveyor.yml to the root directory of the GitHub repository. The contents of this file depends on the project you want to add. There are two possible ways of running PlatformIO in CI services:
Using cmd_run command This variant is default choice for native PlatformIO projects:
build: off environment:
install: - cmd: git submodule update --init --recursive - cmd: SET PATH=%PATH%;C:\Python27\Scripts - cmd: pip install -U platformio
test_script: - cmd: platformio run /path/to/project/dir -e <ID_1> -e <ID_2> -e <ID_N>
Using cmd_ci command This variant is more convenient when project is written as a library (when there are examples or testing code) as it has additional options for specifying extra libraries and boards from command line interface:
matrix: - PLATFORMIO_CI_SRC: "path\\to\\source\\file.c" - PLATFORMIO_CI_SRC: "path\\to\\source\\file.ino" - PLATFORMIO_CI_SRC: "path\\to\\source\\directory"
test_script: - cmd: platformio ci --board=<ID_1> --board=<ID_2> --board=<ID_N>
Examples 1. Integration for USB_Host_Shield_2.0 project. The appveyor.yml configuration file:
matrix: - PLATFORMIO_CI_SRC: "examples\\Bluetooth\\PS3SPP\\PS3SPP.ino" - PLATFORMIO_CI_SRC: "examples\\pl2303\\pl2303_gps\\pl2303_gps.ino"
install: - cmd: git submodule update --init --recursive - cmd: SET PATH=%PATH%;C:\Python27\Scripts - cmd: pip install -U platformio - cmd: git clone https://github.com/xxxajk/spi4teensy3.git C:\spi4teensy
test_script: - cmd: platformio ci --lib="." --lib="C:\\spi4teensy" --board=uno --board=teensy31 --board=due
CircleCI CircleCI is a hosted cloud platform that provides hosted continuous integration, deployment, and testing to GitHub repositories.
CircleCI is configured by adding a file named circle.yml, which is a YAML format text file, to the root directory of the GitHub repository.
CircleCI automatically detects when a commit has been made and pushed to a repository that is using CircleCI, and each time this happens, it will try to build the project using cmd_ci command. This includes commits to all branches, not just to the master branch. CircleCI will also build and run pull requests. When that process has completed, it will notify a developer in the way it has been configured to do so — for example, by sending an email containing the build results (showing success or failure), or by posting a message on an IRC channel. It can be configured to build project on a range of different platforms.
Contents • CircleCI
• Library dependencies
• Install dependent library using librarymanager
• Manually download dependent library and include in build process via --lib option
• Custom Build Flags
• Advanced configuration
Integration NOTE: Please make sure to read CircleCI Getting Started guide first.
There are two possible ways of running PlatformIO in CI services:
dependencies: pre: # Install the latest stable PlatformIO - sudo pip install -U platformio
test: override: - platformio run /path/to/project/dir -e <ID_1> -e <ID_2> -e <ID_N>
test: override: - platformio ci path/to/test/file.c --board=<ID_1> --board=<ID_2> --board=<ID_N> - platformio ci examples/file.ino --board=<ID_1> --board=<ID_2> --board=<ID_N> - platformio ci path/to/test/directory --board=<ID_1> --board=<ID_2> --board=<ID_N>
Library dependencies There 2 options to test source code with dependent libraries:
Install dependent library using librarymanager dependencies: pre: # Install the latest stable PlatformIO - sudo pip install -U platformio
# OneWire Library with ID=1 https://platformio.org/lib/show/1/OneWire - platformio lib -g install 1
test: override: - platformio ci path/to/test/file.c --board=<ID_1> --board=<ID_2> --board=<ID_N>
Manually download dependent library and include in build process via --lib option dependencies: pre: # Install the latest stable PlatformIO - sudo pip install -U platformio
# download library to the temporary directory - wget https://github.com/PaulStoffregen/OneWire/archive/master.zip -O /tmp/onewire_source.zip - unzip /tmp/onewire_source.zip -d /tmp/
test: override: - platformio ci path/to/test/file.c --lib="/tmp/OneWire-master" --board=<ID_1> --board=<ID_2> --board=<ID_N>
Custom Build Flags PlatformIO allows one to specify own build flags using PLATFORMIO_BUILD_FLAGS environment
machine: environment: PLATFORMIO_BUILD_FLAGS: -D SPECIFIC_MACROS -I/extra/inc
For the more details, please follow to available build flags/options.
Advanced configuration PlatformIO allows one to configure multiple build environments for the single source code using projectconf.
Instead of --board option, please use platformio ci --project-conf
test: override: - platformio ci path/to/test/file.c --project-conf=/path/to/platoformio.ini
Examples 1. Custom build flags
dependencies: cache_directories: - "~/.platformio"
pre: - sudo pip install -U platformio
# pre-install PlatformIO development platforms, they will be cached - platformio platform install atmelavr atmelsam teensy
# # Libraries from PlatformIO Library Registry: # # https://platformio.org/lib/show/416/TinyGPS # https://platformio.org/lib/show/417/SPI4Teensy3 - platformio lib -g install 416 417
test: override: - platformio ci examples/acm/acm_terminal --board=uno --board=teensy31 --board=due --lib="." - platformio ci examples/adk/adk_barcode --board=uno --board=teensy31 --board=due --lib="." - platformio ci examples/adk/ArduinoBlinkLED --board=uno --board=teensy31 --board=due --lib="." - platformio ci examples/adk/demokit_20 --board=uno --board=teensy31 --board=due --lib="." # ... - platformio ci examples/Xbox/XBOXUSB --board=uno --board=teensy31 --board=due --lib="."
2. Dependency on external libraries
# download dependent libraries - wget https://github.com/jcw/jeelib/archive/master.zip -O /tmp/jeelib.zip - unzip /tmp/jeelib.zip -d /tmp
- wget https://github.com/Rodot/Gamebuino/archive/master.zip  -O /tmp/gamebuino.zip - unzip /tmp/gamebuino.zip -d /tmp
test: override: -  platformio ci examples/backSoon/backSoon.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560 -  platformio ci examples/etherNode/etherNode.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560 -  platformio ci examples/getDHCPandDNS/getDHCPandDNS.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560 -  platformio ci examples/getStaticIP/getStaticIP.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560 # ... -  platformio ci examples/twitter/twitter.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560 -  platformio ci examples/udpClientSendOnly/udpClientSendOnly.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560 -  platformio ci examples/udpListener/udpListener.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560 -  platformio ci examples/webClient/webClient.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
• Configuration file: hhttps://github.com/ivankravets/ethercard/blob/master/circle.yaml
• Build History: https://circleci.com/gh/ivankravets/ethercard/tree/master
Drone Drone  is a hosted continuous integration service.  It enables you to conveniently set up projects to automatically build, test, and deploy as you make changes to your code to GitHub and BitBucket repositories.
Drone is configured by modifying settings in your project control panel.