I am working with the NRF52832 DK with a Tag-Connect 3 prong cable attached to the debug port.
I have found a bug that has so far been 100% reproducible. It already happened 5 times for me.
Do note that the DK and Tag-Connect cable are both in pristine condition, this is not an electrical issue.
Steps:
1. Open RTT terminal (in VS Code) and connect to the DK
2. Do not close the RTT terminal
3. Try to flash code through the NRFDesktop app.
What will than happen is that the debug port will no longer be available for anywhere from 15 minutes to a few days after which it fixes on its own. I haven't singled out what exactly fixes it, but each time it did fix on its own, I have been restarting and trying to flash code hundreds of times.
The errors shown during flashing are the following:
21:46:49.159
Failed "reading readback protection status for application core". Error: code: 1, description: Generic, message: Batch task protection-get failed, Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown error in the J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Double-check device power supply and SWD lines, and ensure that SWD is not disabled
21:46:49.179
Error: Failed with exit code 1. One or more batch tasks failed: * 1050390093: Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown error in the J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Double-check device power supply and SWD lines, and ensure that SWD is not disabled (Generic) Message: Batch task protection-get failed, Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown error in the J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Double-check device power supply and SWD lines, and ensure that SWD is not disabled.
21:47:10.986
Error: Failed with exit code 1. One or more device info tasks failed: * 1050390093: Device error: Failed to read from memory address 0x10000130: Failed to read AccessPort register 0x0c: Unknown error in the J-Link DLL (error code =-2) (Generic) Message: Operation device-info failed, Device error: Failed to read from memory address 0x10000130: Failed to read AccessPort register 0x0c: Unknown error in the J-Link DLL (error code =-2).
Trying to get the info or recover the DK through nrfutil also does not work:
PS C:\Windows\System32> nrfutil device device-info
Error: One or more device info tasks failed:
* 1050390093: Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown error in the J-Link DLL (error code =-1)).
This might indicate that the debug port is unavailable. Double-check device power supply and SWD lines, and ensure that SWD is not disabled (Generic)
PS C:\Windows\System32> nrfutil device recover
x Failed to recover 1050390093, Device error: Setting the debug port SELECT register failed while powering up sys and deError: One or more recover tasks failed:
* 1050390093: Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown error in the J-Link DLL (error code =-1)).
This might indicate that the debug port is unavailable. Double-check device power supply and SWD lines, and ensure that SWD is not disabled (Generic)
Interestingly, all of these errors go away once the Tag-Connect is disconnected from the debug port. Code can be flashed and the DK can be recovered without issues.
The problem is that, regardless if the DK has been recovered or restarted, once the Tag-Connect is reconnected to the DK, the issues reappear.
Can someone please provide help with recovering the DK+Tag-Connect to a usable state reliably? It is frustrating waiting and trying endlessly to flash code until it works again.