.pioc file

Introduction

The platformio.pioc file is the central configurationhere file used to define build environments, dependencies, compiler flags, and project structure. It uses a format with sections and key-value pairs. It is similar to platformio.ini, which is actually used by platformio, but has some changes to use it easily with our project. For more information, read Simple PIOC.

File Structure

The configuration is divided into sections such as [platformio], [env], and environment-specific sections like [env:network_board].

Core Sections

[platformio]

Defines global project settings.

[extra]

Custom user-defined variables for reuse.

[env]

Base configuration shared across all environments.

Environment Sections

Each [env:<name>] defines a specific build target. These inherit from [env].

Custom Enhancements

1. Glob Patterns in build_flags

Unlike standard PlatformIO, this configuration allows glob-style include/exclude patterns directly in build_flags using +<...> and -<...> syntax.


build_flags=
    +<components/network_board/**>
    -<components/network_board/firmware/Drivers/**>


This enables fine-grained control over which directories are included in compilation.

2. Absolute Path Variable

The variable ${{project_absolute_path}}$ expands to the absolute path of the project root.


custom_nanopb_project_dir = ${{project_absolute_path}}$/ERC-Protobufs


Source Filtering

build_src_filter defines which source files are compiled. It supports inclusion (+) and exclusion (-) rules.


+<src/${this.__env__}/**/*.c>
-<components/${this.__env__}/firmware/Drivers/*>


Variable Substitution

Library Dependencies

External libraries can be defined using Git URLs or registry references.


lib_deps = https://github.com/nanopb/nanopb.git#commit


Compiler and Linker Flags

Standard compiler flags are also supported alongside glob patterns.


-mthumb
-mfpu=fpv4-sp-d16
-D CONFIG_LOG_LEVEL=LOG_INFO


Example Configuration


[env:network_board]
board = nucleo_h753zi
build_flags=
    +<components/network_board/**>
    -<components/network_board/firmware/Drivers/**>
    -mthumb
    -D CONFIG_LOG_LEVEL=LOG_INFO



Compilation

To use the file, you have to convert it to a platformio.ini file. You can do that by running

python3 simple_pioc.py

Extra information

If more information is needed, look at the documentation specifically for platformio.ini files. You can find it here.


Revision #3
Created 2026-04-16 13:07:08 UTC by Nikolaos Diamantopoulos
Updated 2026-04-17 13:27:57 UTC by Jaron Lendering