I am trying set up a multiple board INI file with each board having a release and debug build configuration, possibly adding a test configuration later. What I am trying to do follows this structure:
[Common]
basicSettings
[debug_settings]
flags etc for debug
[release_settings]
flags etc for release (if any)
[board_one]
common.basicSettings
board one settings
[board_one_debug]
board_one settings
debug_settings
[board_one_release]
board_one settings
release_settings
[board_two]
common.basicSettings
board two settings
[board_two_debug]
board_two settings
debug_settings
[board_two_release]
board_two settings
release_settings
The only thing that looks weird to me is the build_flags in env, since every environment inherits from env, it may be that some build_flags are overwritten. You could call it default_build_flags in env and then reference ${env.default_build_flags} in env:nucleo_l452re.
Yes, I just discovered that. The next issue is that I am not getting the build I expected and tried to use the verbose build. However, it seems that command does not build the default build named in the INI file. I have:
[platformio]
default_envs = nucleo_l452re_monitor
However, the verbose build command executes:
Executing task: C:\Users\sidpr\.platformio\penv\Scripts\platformio.exe run --verbose --environment nucleo_l452re
Is it possible to get the verbose command to use the default env?
@maxgerhardt The issue was not the build task, it was the debugging task. I was not building the correct configuration for my special debug build. I needed to create a new debug launch task in VSCode that used the required build configuration.
Many thanks for you help.
No, you should not have to modify any file in .vscode since everything in there is autogenerated, especially the intellisense config and the launch tasks.
For which environment do you want to start the debugger?
Full screenshot of VSCode window?
Have you tried re-selecting the correct environment in the project environment switcher?
Have you tried deleting the .vscode folder in the project and restarting VSCode? (Ctrl+Shift+P → Reload Window)
This seems like a bug since the PIO INI file had a default environment set as I wanted it. Surely, this should also set the project environment switcher?