In a project using an LPC1769 mcu I’ve added a debug environment in platformio.ini like so: [env:LPC1769Debug]
extends = env:LPC1769
build_type = debug
build_flags = …
debug_tool = …
debug_server = …
But when I set default_envs = LPC1769Debug as below:
[platformio]
src_dir = …
boards_dir = …
default_envs = LPC1769Debug
include_dir = …
and then click the green arrow next to PIO Debug (upper left corner)…it gives an error message stating " cannot find task…"
Inspecting launch.json the task is there
“version”: “0.2.0”,
“configurations”: [
{
“type”: “platformio-debug”,
“request”: “launch”,
“name”: “PIO Debug”,
“executable”: “c:/Users/tony/Documents/CNC/MAINBOARD/Marlin-bugfix-2.0.x 020221/.pio/build/LPC1769Debug/debug/firmware.elf”,
“projectEnvName”: “LPC1769Debug”,
“toolchainBinDir”: “C:/Users/tony/.platformio/packages/toolchain-gccarmnoneeabi/bin”,
“svdPath”: “C:/Users/tony/.platformio/platforms/nxplpc-arduino-lpc176x/misc/svd/LPC176x5x_v0.2.svd”,
“preLaunchTask”: {
“type”: “PlatformIO”,
“task”: “Pre-Debug (LPC1769Debug)”
},
“internalConsoleOptions”: “openOnSessionStart”
},
BUT, it has the default_envs value appended to it “task”: “Pre-Debug (LPC1769Debug)”
Just guessing, I removed the (LPC1769Debug) so the task becomes “task”: “Pre-Debug”, and then everything is fine. The PIO Debug arrow works as expected. It stays that way until a “Clean” command is run, then it re-writes the launch.json file to contain “task”: “Pre-Debug (LPC1769Debug)” again, and of course the PIO Debug arrow is broken once again.
Is this a bug or am I doing something incorrectly?