I am working on a new SSTM32 project and initially because of a dev board being available I am going to write the code for Nucleo-L452. Later, the project will switch to Nucleo-G431. I am using the plarformio-freertos library, and I need different settings for the compiler for the two builds.
I have two “env” sections for the two boards and each has a similar, but not identical set of “build_flags”. I would like to avoid repeating the flags that are common to the two builds, however, it does not seem possible to have a “common” section with the shared build-flags and then have each env add the env specific flags to those build_flags.
This is the current contents of my PlatformIO.ini file:
[platformio]
default_envs = nucleo_l452re
[env:nucleo_l452re]
platform = ststm32
board = nucleo_l452re
framework = stm32cube
build_flags = -D STM32L4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16
build_type = debug
lib_deps = bojit/PlatformIO-FreeRTOS@^2.1.3
[env:nucleo_g431rb]
platform = ststm32
board = nucleo_g431rb
framework = stm32cube
build_flags = -D G431RB -mfloat-abi=softfp -mfpu=fpv4-sp-d16
lib_deps = bojit/PlatformIO-FreeRTOS@^2.1.3
Is this possible with Platform IO please?