JLink ‘Stopping in Setup()'

Please show a screenshot of what the VSCode IDE looks like when you press “step over” after your last screenshot.

Next, place a breakpoint at line 20 and restart debugging. Use the “run” button (first) to forward execution. Does it hit the breakpoint?

I also note that you’re using Serial.println("hello"); without having called Serial.begin(9600); (example) first, and you’re also not using a while(!Seriail) yield(); loop after that to wait for a USB connection. Can you remove the Serial.println() line and retry? (Because Serial.println() might attempt to initialize the USB-CDC peripheral and trigger the USB enumeration, thus throwing off the debugger hard.)

If none of these work, you may be running into the issue described in Problems starting debug session with jlink on feather M0 - #11 by prototypicalpro, which is specific to Jlink + SAMD21G18, the microcontroller chip on your MKRWAN1310. In that case I can walk you through a solution attempt, derived from the linked post.

1 Like