I also got it working with just platformio.ini
modifications and no .vscode/launch.json
modifications.
[env:teensy40]
platform = teensy
board = teensy40
framework = arduino
build_type = debug
lib_deps =
https://github.com/ftrias/TeensyDebug/archive/refs/heads/master.zip
; activate Dual USB just as README says
build_flags =
-D USB_DUAL_SERIAL
debug_port = \\.\COM9
debug_tool = custom
debug_load_mode = manual
debug_server =
debug_init_cmds =
target extended-remote $DEBUG_PORT
$INIT_BREAK
define pio_reset_run_target
interrupt
tbreak loop
continue
end
define pio_restart_target
echo Restart is undefined for now.
end
debug_init_break =
So with this you can upload once normally and then use the normal “PIO Debug” debug configuration.
And again it works like before.