I'm trying to get the PPK working when connected to aNRF52840-DK, but getting the error -Error while setting up device [REDACTED_SERIAL]: Error occured when close opened device. Errorcode: CouldNotOpenDevice (0x4) Lowlevel error: JLINKARM_DLL_ERROR (ffffff9a).
This only seems to happen when the PPK is connected to the DK - the DK works fine by itself (or seems to at least); the PPK works fine when I use it standalone and connect it through a different JLINK programmer; but when I try to use both together I get the error.
I've set up up as per the documentation (set all switches and cut the jumper), updated nRF Connect and updated to the latest JLINK drivers. I've tried downgrading both app and drivers, with no success there either. I've also tried erasing the DK and re-flashing the PPK but neither have had any effect.
Could anybody shed any light on this please? The only thread I can find that's similar (https://devzone.nordicsemi.com/f/nordic-q-a/37234/not-possible-to-use-ppk-while-debugging) suggests its a JLINK driver fault, but that was 11 months ago so surely that would have been fixed by now? I'm also not trying to debug or anything, I'm just trying to get a measurement.
The log I get is as follows (I've x'd out any personal information).
2019-08-07T19:23:57.339Z INFO Application data folder: /Users/XXXXXXXX/Library/Application Support/nrfconnect/pc-nrfconnect-ppk2019-08-07T19:23:57.343Z INFO App initialized2019-08-07T19:23:57.629Z DEBUG App pc-nrfconnect-ppk v2.2.0 official2019-08-07T19:23:57.629Z DEBUG App path: /Users/XXXXXXXXXXX/.nrfconnect-apps/node_modules/pc-nrfconnect-ppk2019-08-07T19:23:57.629Z DEBUG nRFConnect 3.0.0 is supported by the app (^3.0.0)2019-08-07T19:23:57.629Z DEBUG nRFConnect path: /Applications/nRF Connect.app/Contents/Resources/app.asar2019-08-07T19:23:57.629Z DEBUG HomeDir: /Users/XXXXXXXXXXX2019-08-07T19:23:57.629Z DEBUG TmpDir: /var/folders/30/zvpj033s0b51hbn_29547t5c0000gn/T/2019-08-07T19:23:57.630Z VERBOSE Could not fetch serial number for serial port at /dev/tty.Bluetooth-Incoming-Port2019-08-07T19:24:00.708Z INFO Validating firmware for device with s/n XXXXXXXXXXXXX2019-08-07T19:24:00.711Z INFO PPK closed2019-08-07T19:24:02.554Z ERROR Error while setting up device XXXXXXXXXXXXXX: Error occured when close opened device. Errorcode: CouldNotOpenDevice (0x4)Lowlevel error: JLINKARM_DLL_ERROR (ffffff9a)
2019-08-07T19:24:02.554Z INFO Deselecting device2019-08-07T19:24:02.556Z INFO PPK closed
First of all, could you try downloading and installing the nRF Command Line Tools, and try running the nrfjprog --recover command to recover your DK, to see if that changes anything. What code is your DK flashed with when you're trying this. Does the same behavior occur if you use one of our SDK examples? Do you have any other DKs to try it with to see if it is the one DK that is the problem?
Thanks for getting back to me.
I was initially running custom code, but I've ran the recover command and getting the same error with just the blinky example from the SDK. I'm getting the error even with no code on the DK at all, straight after a recover command.
I don't have another DK unfortunately - I did consider buying one to test, but didn't really want to drop £40 on another one if I was missing something obvious and can make this one work!
I have/had the same problem. In another thread someone suggested to change the USB cable and I think it helped also in my case.
Would be cheaper than buying another DK :-)
I've tried that, but no difference I'm afraid. Thanks though.
Also tried plugging into different USB sockets but still the same error.
I still see the error from time to time.
I realized, that there are some issues if you are running two or more dev kits on the same computer. E.g one for the ppk and another for debugging your firmware.
The ppk uses RTT for data transmission, so check if there are some conflicts.