Teensy 4.1 gdb debug - USB_DUAL_SERIAL

Hi,

Just found a project https://github.com/ftrias/TeensyDebug which seems to offer what I need to track down some tricky bugs as it offers some level of gdb in dual USB serial config with teensy.

Need to get it into USB_DUAL_SERIAL mode but despite changing the defines in my .vscode\c_cpp_properties.json file so that it has

"defines": ["PLATFORMIO=40304",
                "__IMXRT1062__",
                "ARDUINO_TEENSY41",
                "USB_DUAL_SERIAL",
                "ARDUINO=10805",
                "TEENSYDUINO=153",
                "CORE_TEENSY",
                "F_CPU=600000000",
                "LAYOUT_US_ENGLISH",
                "" ]

it is still using the usb_desc.h section for USB_SERIAL,

Am I changing this in the correct way?

HAs anyone had success with this debug route? Printf’s get me a lot but its hanging in impossible places so need to be able get closer to the code

This file is auto-generated for VSCode from the PlatformIO configuration and affects only VSCode; it doesn’t affect the compilation process at all. So that’s no wonder.

The correct way should be, as the documentation says, to explicitly add it as a build flag. If none is set, USB_SERIAL will be added, which is the behavior you’re seeing. But adding

build_flags = -D USB_DUAL_SERIAL

in the platformio.ini should do it.

That is, if this feature exists in the Teensyduino core v1.53, which is the latest version PlatformIO supports (Releases · platformio/platform-teensy · GitHub)

Thanks will give that a go then, still feeling my way around this, I had managed to skip to the 4.1 docs so missed the general docs at the top of the page.