Hi, I am seeking assistance with a very weird issue encountered while programming an nRF5340 SoC using a custom debugging-PCB using a SEGGER J-Link EDU debugger.
The debugging PCB is designed to plug directly into the J-Link (and the board featuring the nRF5340 plugs into this board).
The nRF appears in VS Coder under connected devices, but attempts to flash the device result in the following error:
HOWEVER, when the debugging PCB is not plugged directly into the J-Link, but each pin is individually connected to the J-Link using jumper wires, programming proceeds without issues.
I've narrowed down the issue to the SWCLK line: connecting the debugging PCB directly and soldering a 5 cm jumper wire between the SWCLK pins solves the issue.
This doesn't work:
This does work:
This doesn't work again:
Troubleshooting Steps Undertaken:
1. Measured the resistance of the connecting cable, which is approximately 0.5 Ω
2. Introduced resistors ranging from 0.5 ohms to 200 Ω in series with each J-Link pin (especially SWCLK to simulate the jumper wire resistance); this did not resolve the issue.
3. I noticed that probing the SWCLK line with an oscilloscope prevents successful flashing, indicating sensitivity on this line.
4. Implemented external pull-up and pull-down resistors for SWDIO and SWCLK , as well as low-pass filters, without achieving successful programming.
5. Built an "extension" plug that plugs directly into the J-Link and then in the debugging PCB, then it doesn't work. If the debugging board is not entirely plugged in all the way (leaving some millimetres while ensuring all lines are connected, it works....
When probing the lines with an oscilloscope, you can see a bit of ringing, but the signal is the same if probed with jumper wire extensions or without, so this can't be the issue, right?
TLDR: I'm literally clueless at this point. All my colleagues have looked over the schematics, we ruled out any issues we've come up with, it just doesn't work, when there's a direct connection, it works when there a jumper wire in the SWCLK line
I appreciate any insights or recommendations from the community to resolve this weird bug