SAMD21 Unknown USB Device (USB Device Descriptor Request Failed)

Trying to debug on SAMD21-based board, using arduino framework. Have tried several boards: Arduino MKR ZERO, Adafruit Trinket M0 (both SAMD21). Have also tried on Adafruit Feather M4 Express (SAMD51) - same result on all.

My goal to start is to get a functioning debug environment using the USB Serial CDC connection.

Starting with a very simple setup() and loop() as follows:

#include <Arduino.h>
void setup() {

void loop() {
int ch;

ch =;
if(ch > 0)

Start the debugging session, wait for it to land on the startup breakpoint, then simply click “Continue” - the USB connection fails with Windows "Unknown USB Device (USB Device Descriptor Request Failed). Debug single-stepping through startup inside int main(void): the USB attach attempt happens after executing “usbd.attach()” within “bool: USBDeviceClass::attach()” in USBCore.cpp, which is called from main() as USBDevice.attach().
I have tried powering the board from an external power supply and keeping the USB cable disconnected untial after I start the code running in the debugger, same result.

Tried with the exact same debugger setup and simple Arduino setup() and loop() functions on an Arduino Nano33 BLE board (Nordic nRF52480 processor) and the USB CDC enumerated successfully.

Wanting to have the same success on the SAMD21/SAMD51 parts.

Any help would be much appreciated.

platformio.ini (for the MKR ZERO board):
platform = atmelsam
board = mkrzero
framework = arduino
debug_tool = jlink
upload_protocol = jlink

OS: Win11
VSCode v1.89.1
PlatformIO v3.3.3