nrfutil [jlink] INTERNAL_ERROR, code: Nrfjlink

Hi,

I am unable to use the new nrfutil to do even a device reset of my devkit. I have installed the recommended segger version and the apple-silicon version of nrfutil on my Macbook M3 machine (tested on my colleague's M2 as well with the same result).

The output of --version is normal:

>> nrfutil device --version      
nrfutil-device 2.7.5 (6460d8f 2024-11-07)
commit-hash: 6460d8f68cc20bfb87b93a5311d4afe388a7a44f
commit-date: 2024-11-07
host: aarch64-apple-darwin
build-timestamp: 2024-11-07T10:21:59.397001000Z
classification: nrf-external

Detected SEGGER J-Link version: JLink_V7.94i

It can also detect the connected nrf52840-DK without problems:

>> nrfutil device list     
1050321577
product         J-Link
board version   PCA10040
ports           /dev/tty.usbmodem0010503215771, vcom: 0
                /dev/tty.usbmodem0010503215773, vcom: 1
traits          devkit, jlink, seggerUsb, serialPorts, usb

Found 1 supported device(s)

However, when attempting to reset, erase or flash code to my target, I consistently get the following error message (here copied from an NRF5340 DK, all my devkits show the same behaviour):

nrfutil device reset    
❌ Failed to reset 960140919, [jlink] INTERNAL_ERROR
Error: One or more reset tasks failed:
 * 960140919: [jlink] INTERNAL_ERROR, code: Nrfjlink

I have updated the j-link firmware using JLinkConfig. I also managed to directly use the JLinkExe tool to connect, reset, erase and flash to that same target successfully.

One thing that strikes me there in the console ouptut is the following (again from the NRF5340 DK, but equivalent result on the other DKs I have):

Found Cortex-M33 r0p4, Little endian.
Cortex-M: The connected J-Link (S/N 960140919) uses an old firmware module: V1 (current is 2)
Cortex-M (ARMv8-M and later): The connected J-Link (S/N 960140919) uses an old firmware module that does not handle I/D-cache correctly. Proper debugging functionality cannot be guaranteed if cache is enabled

Is this the thing nrfutil cannot handle? Are really all my devkits too old already?

Thanks for any help in advance!

  • Hi,

    Thanks for checking with us about this issue.

    I found nrfutil-device just have a release 2.7.6 today and fixed some issue on MacOS.

    Just tried on a M1 MacBook Air, it works fine. Could you have a try?

    cs@MacBookAir ~ % nrfutil device --changelog
    ## 2024-11-13: Version 2.7.6
    
    ### Added
    
    * Added support for modem updates for Nordic Thingy:91 X.
    
    ### Changed
    
    * Updated the serial port plugin.
    
    ### Fixed
    
    * Fixed a rare issue in the board controller plugin with the discovery of new devices on Linux and macOS.
    * Fixed an issue with board controller commands erroring out if Serial Wire Debug (SWD) is disabled.
    
    cs@MacBookAir ~ % nrfutil device --version
    
    nrfutil-device 2.7.6 (040a257 2024-11-15)
    commit-hash: 040a25785d0b79da111e042ef002f04cf8547e46
    commit-date: 2024-11-15
    host: aarch64-apple-darwin
    build-timestamp: 2024-11-15T09:59:52.897820000Z
    classification: nrf-externalcs@MacBookAir ~ % nrfutil device list
    
    960156581
    product J-Link
    board version PCA10095
    ports /dev/tty.usbmodem0009601565811, vcom: 0
    /dev/tty.usbmodem0009601565813, vcom: 1
    /dev/tty.usbmodem0009601565815, vcom: 2
    traits devkit, jlink, seggerUsb, serialPorts, usb
    
    Found 1 supported device(s)
    
    Detected SEGGER J-Link version: JLink_V7.94i
    cs@MacBookAir ~ % nrfutil device reset
    ???️ Reset was applied to 960156581

    Best regards,

    Charlie

  • Hi Charlie, thanks for the hint, sadly this didn't change anything.

    For what it's worth, I sometimes get another error message:

    nrfutil device reset
    ❌ Failed to reset 1050287558, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error
    Error: One or more reset tasks failed:
     * 1050287558: [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1), code: Generic
    

    After I try to flash the firmware, the error becomes the one in the title of this post again.

    Any otther ideas what to do?

  • Thanks for the update.

    I will try to get help from colleague with M2 MacBook to see if we can repeate this issue.

  • Hi Charlie,

    I have also retried it on my previous x86 Mac with the same result.

    However, some progress: with sudo, it works. Any idea how I can avoid using sudo?

  • anther clue: I've had the same issue like  Flashing issues after updating Command Line Tools on macOS

    sudo also allowed me to run the latest verstion (10.24.2) of nrfjprog, without sudo it would fail.

    Reverting to 10.24.0 allowed me to run nrfjprog without sudo.

    Is there any previous version of nrfutil available to download?

Related