New in version 3.6.1.
There are 2 types of build configurations in PlatformIO:
|Release:||Default configuration. The release configuration of your firmware/program does not contain symbolic debug information and is fully optimized.|
|Debug:||The debug configuration of your firmware/program is compiled with full symbolic debug information and no optimization. Optimization complicates debugging, because the relationship between source code and generated instructions is more complex.|
As we mentioned before, PlatformIO builds project in
by default. You can build project in
Debug configuration using one of
- Using target
platformio run --targetcommand
- Using targets option in “platformio.ini” (Project Configuration File) per build environment.
If you use the same build environment for “Release” and for PIO Unified Debugger, PlatformIO will rebuild your project each time when you switch between build configurations. To avoid this issue, please declare 2 separate project build environments in “platformio.ini” (Project Configuration File) as described below in example.
Otherwise, please add
targets = debug to your build environment and
PlatformIO will build project using “Debug” configuration even when you
do not use PIO Unified Debugger.
Example of classic “release” and “debug” scheme using “platformio.ini” (Project Configuration File)
[env:debug] platform = ... board = ... framework = ... targets = debug [env:release] platform = ... board = ... framework = ...
- platformio run command builds ALL environments and places artifacts to build_dir
platformio run --environment debugbuilds only
platformio run --environment releasebuilds only
platformio run --environment release --target uploadbuilds project using “Release” configuration and upload firmware/artifacts to end device.