Debug is going to stop

Hi,
I want to debugging PlatformIO project in VSCode + J-Link on Windows 10.
When I start debugging, it will automatically break with init().
Next, I execute ‘Continue’, An error occurs on the USB connected to the Wio Terminal and the debug function does not work afterwards.

Is anyone able to debug with PlatformIO + VSCode + J-link on Windows 10?

platformio.ini:

[env:seeed_wio_terminal]
platform = atmelsam
board = seeed_wio_terminal
framework = arduino
upload_protocol = jlink
debug_tool = jlink

You might check the -g -DDEBUG=1 parameter is set for debugging.

Segger has an excellent debugger GUI application, Ozone.

See

Have you tried it?

1 Like

Hi @reivilo ,
Thanks for your advise.

Build option is here: -Og -g2 -ggdb2

Building in debug mode
arm-none-eabi-g++ -o .pio\build\seeed_wio_terminal\src\main.cpp.o -c -fno-rtti -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -Wall -mcpu=cortex-m4 -mthumb -nostdlib --param max-inline-insns-single=500 -Wno-expansion-to-defined -Og -g2 -ggdb2 -DPLATFORMIO=50001 -D__SAMD51P19A__ -DWIO_TERMINAL -DSEEED_WIO_TERMINAL -DSEEED_GROVE_UI_WIRELESS -D__SAMD51__ -D__FPU_PRESENT -DARM_MATH_CM4 -DARDUINO=10805 -DF_CPU=120000000L -DUSBCON -DUSB_VID=0x2886 -DUSB_PID=0x802D "-DUSB_PRODUCT=\"Seeed Wio Terminal\"" -DUSB_MANUFACTURER=\"Seeed\" -DARDUINO_ARCH_SAMD -DUSB_CONFIG_POWER=100 -D__PLATFORMIO_BUILD_DEBUG__ -Iinclude -Isrc -IC:\Users\takashi\.platformio\packages\framework-cmsis\CMSIS\Include -IC:\Users\takashi\.platformio\packages\framework-cmsis-atmel\CMSIS\Device\ATMEL 
-IC:\Users\takashi\.platformio\packages\framework-arduino-samd-seeed\cores\arduino -IC:\Users\takashi\.platformio\packages\framework-arduino-samd-seeed\cores\arduino\TinyUSB -IC:\Users\takashi\.platformio\packages\framework-arduino-samd-seeed\cores\arduino\TinyUSB\Adafruit_TinyUSB_ArduinoCore -IC:\Users\takashi\.platformio\packages\framework-arduino-samd-seeed\cores\arduino\TinyUSB\Adafruit_TinyUSB_ArduinoCore\tinyusb\src -IC:\Users\takashi\.platformio\packages\framework-arduino-samd-seeed\variants\wio_terminal src\main.cpp

I was able to debug successfully by adding #undef USBCON and disabling VCOM.
The USB part may be affected by the inability to debug.
But I want to use VCOM.