nrf9160dk Failed to write DebugPort register 2: Unknown Error in J-Link DLL

Using JLink_V7.94i

2024-12-04T19:02:56.137Z INFO Initialising the bundled nrfutil device
2024-12-04T19:02:56.144Z DEBUG Started watching devices
2024-12-04T19:02:56.487Z INFO Using the bundled core version for nrfutil device: 7.13.0
2024-12-04T19:02:56.607Z INFO Using nrfutil-device version: 2.7.5
2024-12-04T19:02:56.607Z INFO Using nrf-device-lib version: 0.17.41
2024-12-04T19:02:56.607Z INFO Using nrfjprog DLL version: 10.24.2
2024-12-04T19:02:56.607Z INFO Using JLink version: JLink_V7.94i
2024-12-04T19:02:59.136Z DEBUG Selected device: nRF9160 DK
2024-12-04T19:02:59.164Z DEBUG Changed step: Info
2024-12-04T19:03:02.604Z DEBUG Changed step: Rename
2024-12-04T19:03:03.561Z DEBUG Changed step: Program
2024-12-04T19:03:07.862Z ERROR  NRFDLException(1): [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)
2024-12-04T19:14:34.858Z ERROR  NRFDLException(1): [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)

Using JLink V8.10f

2024-12-04T18:15:04.194Z INFO Initialising the bundled nrfutil device
2024-12-04T18:15:04.204Z DEBUG Started watching devices
2024-12-04T18:15:04.578Z INFO Using the bundled core version for nrfutil device: 7.13.0
2024-12-04T18:15:04.698Z INFO Using nrfutil-device version: 2.7.5
2024-12-04T18:15:04.699Z INFO Using nrf-device-lib version: 0.17.41
2024-12-04T18:15:04.699Z INFO Using nrfjprog DLL version: 10.24.2
2024-12-04T18:15:04.699Z INFO Using JLink version: JLink_V8.10f
2024-12-04T18:15:04.700Z INFO Your version of SEGGER J-Link (8.10f) is newer than the one this app was tested with (7.94i). The tested version is not required, and your J-Link version will most likely work fine. If you get issues related to J-Link with your devices, use the tested version.
2024-12-04T18:15:07.193Z DEBUG Selected device: nRF9160 DK
2024-12-04T18:15:07.220Z DEBUG Changed step: Info
2024-12-04T18:15:09.301Z DEBUG Changed step: Rename
2024-12-04T18:15:10.896Z DEBUG Changed step: Program
2024-12-04T18:15:14.855Z ERROR  NRFDLException(1): [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)
2024-12-04T18:15:16.990Z ERROR  NRFDLException(1): [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)
2024-12-04T18:15:17.858Z ERROR  NRFDLException(1): [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)
2024-12-04T18:15:18.689Z ERROR  NRFDLException(1): [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)

  • If I use the programmer:

    2024-12-04T19:18:27.616Z INFO Initialising the bundled nrfutil device
    2024-12-04T19:18:27.634Z DEBUG Application data folder: /home/ivan/.config/nrfconnect/pc-nrfconnect-programmer
    2024-12-04T19:18:27.656Z DEBUG App pc-nrfconnect-programmer v4.4.2 (official)
    2024-12-04T19:18:27.656Z DEBUG App path: /home/ivan/.nrfconnect-apps/node_modules/pc-nrfconnect-programmer
    2024-12-04T19:18:27.656Z DEBUG nRFConnect 5.1.0, required by the app is (>=5.0.2)
    2024-12-04T19:18:27.656Z DEBUG nRFConnect path: /tmp/.mount_nrfcon1fwUSG/resources/app.asar
    2024-12-04T19:18:27.656Z DEBUG HomeDir: /home/ivan
    2024-12-04T19:18:27.656Z DEBUG TmpDir: /tmp
    2024-12-04T19:18:27.989Z INFO Using the bundled core version for nrfutil device: 7.13.0
    2024-12-04T19:18:28.109Z INFO Using nrfutil-device version: 2.6.4
    2024-12-04T19:18:28.109Z INFO Using nrf-device-lib version: 0.17.35
    2024-12-04T19:18:28.109Z INFO Using nrfjprog DLL version: 10.24.2
    2024-12-04T19:18:28.109Z INFO Using JLink version: JLink_V7.94i
    2024-12-04T19:18:28.162Z INFO Getting serial port options from the persistent store for 000960057614.pc-nrfconnect-programmer
    2024-12-04T19:18:29.754Z INFO Selecting device with the serial number 000960057614
    2024-12-04T19:18:30.193Z INFO Selected device with the serial number 000960057614
    2024-12-04T19:18:30.194Z INFO Using nrfutil device to communicate with target via JLink
    2024-12-04T19:18:30.548Z INFO Reading readback protection status for Application core
    2024-12-04T19:18:30.549Z ERROR Failed "reading readback protection status for application core". Error: code: 1, description: Generic, message: Batch task protection-get failed, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)
    2024-12-04T19:18:30.639Z ERROR Error: Failed with exit code 1.
    One or more batch tasks failed:
     - [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1), code: Generic.
    Message: Batch task protection-get failed, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1).
    2024-12-04T19:18:48.904Z INFO Reading readback protection status for Application core
    2024-12-04T19:18:48.904Z ERROR Failed "reading readback protection status for application core". Error: code: 1, description: Generic, message: Batch task protection-get failed, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)

    Note: I do have a nrf52dk and nrf53dk, everything is working with this DKs.

  • Hello, does the nRF9160DK have the jumper on the nRF Current Measurement header? Can you provide a close up picture of the board you are using?

    Kind regards,
    Øyvind

  • Hi Øyvind,


    I got the same result with and without the jumper.

    Here a picture of the board: I can not load picture directly here, not sure why.
    I loaded to google pictures: https://photos.google.com/photo/AF1QipMKw_vncjbmabwSOpXpTF3drmAN-VO8JGnwsIGk


  • May be its worth to mention that I can program the nrf52 when selecting it with SW10. So the issue is related with the nrf91 only I guess.

  • I had a similar issue on my board.

    It turns out the Software Debugger was disabled on my board. I used Board Configurator to enable SWD and it fixed the issue for me.

     

Related