SAMD21 "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 until 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

All the boards you have mentioned do not have on-board debug probe - if you look at this list you can see links to the details of that boards and their debug capabilities - for example the Adafruit Trinket M0

I am using one of the recommended “external probes” (the J-Link) for debugging and am successful at entering a debug session and stepping through code with single steps and breakpoints.
I just can’t seem to determine why the serial USB connection to a Windows PC fails while in a debug session. I have tried a number of things, including disabling the initial breakpoint (using “debug_init_break=” in platformio.ini) and simply clicking “Continue” once the debug session loads. I have also tried powering the board from an external power supply, starting the debug session and clicking “Continue” (to get the code running), THEN connecting the USB cable. Nothing seems to solve the problem of Windows reporting “USB Device Descriptor Request Failed”.

I’ve finally found the solution - it was previously documented on here: Problems starting debug session with jlink on feather M0 - #8 by manuelbl and /10

The bootloader must be unprotected and overwritten by making the modifications indicated in adafruit_feather_m0.json file (renamed to _no_bootloader) : change “ldscript”: “flash_without_bootloader.ld” and change “offset_address”: “0x0000”.
Also change platformio.ini board = adafruit_feather_m0_no_bootloader.

Once I made these changes the USB enumeration is successful upon starting the debug session and clicking “Continue”.