PlatformIO Core Documentation
repository·develop·Indexed 27 days ago
https://github.com/platformio/platformio-coreA professional ecosystem for embedded software development featuring a unified build system, debugging, and testing framework. This documentation covers the PlatformIO Core CLI and the AccountClient API for managing user accounts, authentication, profiles, organizations, and teams.
What's inside PlatformIO Core
- PlatformIO Core is an open-source, cross-platform ecosystem for embedded software development. It provides a multi-platform and multi-architecture build system, a unified debugger, static code analysis, and remote unit testing capabilities. It is licensed under the Apache 2.0 license.
Explore PlatformIO Core features and solutions
developPlatformIO Core offers several key capabilities for embedded development:
Core Capabilities
- Build System: Multi-platform and multi-architecture support.
- Debugging: Unified Debugger and advanced debugging tools.
- Testing: Remote unit testing and test-driven methodologies.
- Analysis: Static Code Analyzer (via
pio-check). - File Management: Firmware File Explorer and Memory Inspection.
Key Solutions
- Library Management: Automated management of embedded libraries.
- IDE Integration: Integration with various desktop IDEs.
- Continuous Integration: Support for CI/CD workflows.
- Remote Development: Capabilities for remote development environments.
Configure PlatformIO Telemetry settings
developPlatformIO enables minimal diagnostics and usage information sharing by default to help improve the platform. You can manage these settings via the command line or configuration files. Refer to theTelemetry Settingdocumentation for specific instructions on how to enable or disable telemetry.Manage libraries with `pio lib`
developThe
pio libcommand group is used for managing PlatformIO libraries.Note: Most
pio libcommands are deprecated and will be removed in future releases. It is highly recommended to use thepio pkgcommand suite instead (e.g.,pio pkg installinstead ofpio lib install).Generate sample code during initialization
developUsing the
--sample-codeflag duringplatformio initwill attempt to create a boilerplate source file in thesrcdirectory.Note: This feature is primarily implemented for the Arduino framework. If the board's default framework is not Arduino, sample code generation will be skipped.
Add new board environments to an existing project
developYou can use
platformio initwith the--boardflag to add new environment sections to an existingplatformio.inifile. PlatformIO will automatically determine the correct platform and framework for the specified board.If you provide
--project-option, these options will be applied to the newly created environment section. You can also use--env-prefixto customize the name of the generated environment section (e.g.,env:my_prefixboard_id).Update an existing environment in platformio.ini
developTo update the configuration of a specific environment already defined in yourplatformio.ini, use the--environmentflag combined with--project-option.Configure library storage scope
developWhen using
pio libcommands, you can control which library storage is being managed using the following flags:-d, --storage-dir <DIR>: Manage custom library storage in the specified directory(s).-g, --global: Manage the global PlatformIO library storage.-e, --environment <ENV>: Manage libraries for specific project build environments declared inplatformio.ini.
Configure parallel job execution
developYou can control the number of parallel jobs used during the run process to optimize build performance.
- CLI Flag: Use the
-jor--jobsflag. - Environment Variable: Set
PLATFORMIO_RUN_JOBSto a specific integer to set a global default for your session.
- CLI Flag: Use the
Configure `check` tools in `platformio.ini`
developYou can configure static analysis tools directly within your
platformio.inifile under specific environments.Supported configuration keys per environment:
check_tool: A list of tools to run (e.g.,check_tool = cppcheck).check_src_filters: Filters for source files to be checked.check_patterns: Alternative tocheck_src_filters.check_flags: Additional flags to pass to the tool.check_severity: The minimum severity level to report.check_skip_packages: Whether to skip platform packages.platform_packages: List of platform packages to include/exclude.
Access the PlatformIO Registry
developThe PlatformIO Registry is a central repository where you can discover and use various components for your embedded projects:
- Libraries: Search for and integrate third-party libraries.
- Development Platforms: Find support for specific hardware platforms and architectures.
- Development Tools: Access specialized tools for the embedded ecosystem.
Validate board IDs
developWhen using the--boardflag, the provided ID must be a valid PlatformIO board ID. If an invalid ID is provided, the command will fail with an error message suggesting the use ofplatformio boardsto search for valid IDs.