New in version 4.0.0.
There are 2 types (build_type) of build configuration in PlatformIO:
release
:Default configuration. A “release” configuration of your firmware/program does not contain symbolic debug information and is optimized for the firmware size or speed (depending on Development Platforms)
debug
:A “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.
If you need to build a project in debug
configuration, please use one of
these options:
Add build_type with debug
value to “platformio.ini” (Project Configuration File)
Use target debug
for platformio run --target
command.
Note
PIO Unified Debugger automatically switches to debug
configuration when you do
project debugging from PlatformIO IDE or use platformio debug command.
To avoid project rebuilding, please create a separate build environment
and add build_type = debug
. See example below where mydebug
build
environment will be used automatically by PIO Unified Debugger:
[env]
platform = ...
board = ...
framework = ...
... other common configuration
[env:myrelease]
some_extra_options = ...
[env:mydebug]
build_type = debug
some_extra_options = ...
Please note that you can set a default build environment per a project using default_envs option in Section [platformio].