This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Suddenly getting error from nrfjprog on MacOS after `west update` in my Zephyr project: "JLinkARM DLL reported a problem"

I was working in a Zephyr project and wanted to test something on my nRF52840-Preview-DK board - which I had just used minutes before and successfully had `west flash` write to it fine.  I ran into a build error (it was complaining about `SEGGER_RTT.h` missing) and so I updated my `west.yml` to load the `segger` module - and then I was able to build.  HOWEVER - when I tried to flash the hex file to the board with `west flash`, I got this error:

`FATAL ERROR: command exited with status 33: nrfjprog --program /Users/riz/workspace/ryval-zmk/zephyr/samples/drivers/led_is31fl3733/build/zephyr/zephyr.hex -f NRF52 --snr 683890072 --sectoranduicrerase`

... so I played around with `nrfjprog` and generated the requested log.  Looking at it, I wondered if maybe I needed to update something, so I ran `brew upgrade nordic-nrf-command-line-tools` and also upgraded to the latest Segger J-Link software - but no luck.  Anyone know what's up?

Here's the relevant info:

Board: nRF52840-Preview-DK (PCA10056)

Zephyr 2.4.0 (with some ZMK-related fixes)

OS: MacOS Catalina 10.15.7

This absolutely was working this morning.  :( 

Here's the contents of `log.log`:

[2021-Feb-26 09:49:47] [ info] --------------------------------------------------------------------------------
[2021-Feb-26 09:49:47] [ info] nrfjprog -e -f nRF52 --log
[2021-Feb-26 09:49:47] [ info] nrfjprog version 10.12.1
[2021-Feb-26 09:49:47] [ info] --------------------------------------------------------------------------------
[2021-Feb-26 09:49:47] [debug] [ nRF0x0] - open_dll
[2021-Feb-26 09:49:47] [ info] [ nRF0x0] - Load library at /usr/local/Caskroom/nordic-nrf-command-line-tools/10.12.1/nrfjprog/libjlinkarm_nrf52_nrfjprogdll.dylib.
[2021-Feb-26 09:49:47] [ info] [ nRF0x0] - Library loaded, loading member functions.
[2021-Feb-26 09:49:47] [ info] [ nRF0x0] - Member functions succesfully loaded.
[2021-Feb-26 09:49:47] [ info] [Backend] - Logger callback at 0x105ba6300 registered in Segger backend logger.
[2021-Feb-26 09:49:47] [ info] [ JLink] - [Info ] [JLink ] Logger callback at 0x105ba6300 registered in JLink logger.
[2021-Feb-26 09:49:47] [debug] [nRF520x0] - open
[2021-Feb-26 09:49:47] [debug] [Backend] - open_dll
[2021-Feb-26 09:49:47] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
[2021-Feb-26 09:49:47] [ info] [Backend] - Load library at /Applications/SEGGER/JLink/libjlinkarm.6.96.0.dylib.
[2021-Feb-26 09:49:47] [ info] [Backend] - Library loaded, loading member functions.
[2021-Feb-26 09:49:47] [ info] [Backend] - Member functions succesfully loaded.
[2021-Feb-26 09:49:47] [debug] [Backend] - dll_version
[2021-Feb-26 09:49:47] [ info] [Backend] - Segger dll version 6.96. loaded.
[2021-Feb-26 09:49:47] [debug] [ nRF0x0] - enum_emu_snr
[2021-Feb-26 09:49:47] [debug] [nRF520x0] - enum_emu_snr
[2021-Feb-26 09:49:47] [debug] [Backend] - is_connected_to_emu
[2021-Feb-26 09:49:47] [debug] [Backend] - enum_emu_snr
[2021-Feb-26 09:49:47] [debug] [Backend] - ---just_enum_emu_snr
[2021-Feb-26 09:49:47] [debug] [Backend] - ---just_get_num_emus
[2021-Feb-26 09:49:47] [debug] [Backend] - is_connected_to_emu
[2021-Feb-26 09:49:47] [debug] [ nRF0x0] - connect_to_emu_with_snr
[2021-Feb-26 09:49:47] [debug] [nRF520x0] - connect_to_emu_with_snr
[2021-Feb-26 09:49:47] [debug] [Backend] - is_connected_to_emu
[2021-Feb-26 09:49:47] [debug] [Backend] - connect_to_emu_with_snr
[2021-Feb-26 09:49:47] [debug] [Backend] - is_connected_to_emu
[2021-Feb-26 09:49:47] [debug] [Backend] - ---just_enum_emu_snr
[2021-Feb-26 09:49:47] [debug] [Backend] - ---just_get_num_emus
[2021-Feb-26 09:49:47] [debug] [Backend] - ---just_connect_to_emu_with_snr
[2021-Feb-26 09:49:47] [debug] [Backend] - ---just_connect_to_emu_without_snr
[2021-Feb-26 09:49:47] [ info] [Backend] - Segger logging enabled.
[2021-Feb-26 09:49:47] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
[2021-Feb-26 09:49:47] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
[2021-Feb-26 09:49:47] [ info] [ JLink] - [Info ] [JLink ] Updating firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Feb 2 2021 16:47:20
[2021-Feb-26 09:49:47] [ info] [ JLink] - [Info ] [JLink ] Updating firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Feb 2 2021 16:47:20
[2021-Feb-26 09:49:47] [ info] [ JLink] - [Info ] [JLink ] Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
[2021-Feb-26 09:49:47] [ info] [ JLink] - [Info ] [JLink ] Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
[2021-Feb-26 09:49:49] [ info] [ JLink] - [Info ] [JLink ] Waiting for new firmware to boot
[2021-Feb-26 09:49:49] [ info] [ JLink] - [Info ] [JLink ] Waiting for new firmware to boot
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] New firmware booted successfully
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] New firmware booted successfully
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] Hardware: V1.00
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] S/N: 683890072
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] OEM: SEGGER
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] TELNET listener socket opened on port 19021
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Starting webserver
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Webserver running on local port 19080
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 2908.056ms returns "O.K."
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_Lock()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetHWStatus(...)
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.306ms returns 0
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("SetRestartOnClose = 0", ...).
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.050ms returns 0x01
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("DisableFlashDL", ...).
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.045ms returns 0x00
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.052ms returns 0x00
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog(...)
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.045ms returns 0
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_TIF_Select(JLINKARM_TIF_SWD)
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 1.193ms returns 0x00
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetSpeed(2000)
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.213ms
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetSN()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.007ms returns 683890072
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_load_core_data
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.027ms returns 0x00
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("device = nRF52", ...).
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] XML file found at: /Applications/SEGGER/JLink_V696/JLinkDevices.xml
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] /Applications/SEGGER/JLink_V696/JLinkDevices.xml evaluated successfully.
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] Device "NRF52" selected.
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] Device "NRF52" selected.
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 25.162ms returns 0x00
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [debug] [Backend] - read_debug_port_idr
[2021-Feb-26 09:49:50] [debug] [Backend] - read_debug_port_register
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_read_debug_port_register
[2021-Feb-26 09:49:50] [debug] [Backend] - coresight_configure
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_Configure()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 101.369ms returns 0
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_select_debug_port_register
[2021-Feb-26 09:49:50] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.820ms returns -1
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_abort_debug_action
[2021-Feb-26 09:49:50] [ info] [Backend] - Attempting to clear any configuration errors in debug port before closing connection.
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.823ms returns -1
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.027ms
[2021-Feb-26 09:49:50] [debug] [ nRF0x0] - close_dll
[2021-Feb-26 09:49:50] [debug] [nRF520x0] - close
[2021-Feb-26 09:49:50] [debug] [Backend] - is_connected_to_emu
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.005ms returns 0x01
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_Lock()
[2021-Feb-26 09:49:50] [debug] [Backend] - close
[2021-Feb-26 09:49:50] [debug] [Backend] - disconnect_from_emu
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_disconnect_from_emu
[2021-Feb-26 09:49:50] [debug] [Backend] - is_connected_to_device
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsConnected()
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.004ms returns FALSE
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_is_debug_region_powered
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_read_debug_port_register
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_select_debug_port_register
[2021-Feb-26 09:49:50] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.961ms returns -1
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
[2021-Feb-26 09:49:50] [debug] [Backend] - ---just_abort_debug_action
[2021-Feb-26 09:49:50] [ info] [Backend] - Attempting to clear any configuration errors in debug port before closing connection.
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.894ms returns -1
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-26 09:49:50] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] - 0.055ms
[2021-Feb-26 09:49:50] [ info] [ JLink] - [Info ] [JLink ] JLINK_Close()
[2021-Feb-26 09:49:50] [debug] [Backend] - Segger Backend closed.
[2021-Feb-26 09:49:50] [debug] [nRF520x0] - nRF family DLL closed

Parents
  • Hello,

    Is this from just trying to run "nrfjprog -e", or as part of a "west flash" command? If it is not the first, can you please try to run "nrfjprog -e" directly from the command line?

    Do you have any other DKs? Have you tried them using nrfjprog directly? We'll try to figure out whats going on, but I just want to know exactly what you have and have not tried first.

    Best regards,

    Edvin

  • Yes, I have run "nrfjprog -e" from the commandline.  I do have a second identical board - until a few minutes ago, it was still in factory packaging... and things seem to work on that board (both "nrfjprog -e" and "west flash").  So... looks like maybe I coincidentally fried the first board around the same time I made the other changes?  Is there anything I can do to recover it?

    Thanks for getting back to me and sorry for not testing this first.  :/

    +j

  • Hello,

    Can you please try the following:

    1: Power off the DK

    2: Hold the IF BOOT/RESET button while you power it back on.

    3: Note that LED5 will blink slowly. The device should appear as BOOTLOADER on your computer (on Windows under "This PC". Not sure what that looks like on a Mac).

    4: Download this file (do that up front. This file is also found here),

    1385.J-Link OB-SAM3U128-V2-NordicSemi 170724.bin

    and copy it into the device named BOOTLOADER:

    If the device disappears before you came this far, start from step 1 again. It will disconnect after about a minute if nothing is done.

    5: After uploading the file, note that the LED5 will start blinking a bit faster.

    6: Power cycle the DK again, this time without holding the IF BOOT/RESET, and the device should appear as JLink.

    Does the DK work now? If not, were you able to follow the guide, where does the behavior differ from the description?

    I assume you have checked the switches on the DK that is not working. Make sure that they are in the same positions as the one that is working. 

    Does any of the other nrfjprog commands work with the defect DK? Have you tried nrfjprog --ids? Is the device listed?

    BR,

    Edvin

Reply
  • Hello,

    Can you please try the following:

    1: Power off the DK

    2: Hold the IF BOOT/RESET button while you power it back on.

    3: Note that LED5 will blink slowly. The device should appear as BOOTLOADER on your computer (on Windows under "This PC". Not sure what that looks like on a Mac).

    4: Download this file (do that up front. This file is also found here),

    1385.J-Link OB-SAM3U128-V2-NordicSemi 170724.bin

    and copy it into the device named BOOTLOADER:

    If the device disappears before you came this far, start from step 1 again. It will disconnect after about a minute if nothing is done.

    5: After uploading the file, note that the LED5 will start blinking a bit faster.

    6: Power cycle the DK again, this time without holding the IF BOOT/RESET, and the device should appear as JLink.

    Does the DK work now? If not, were you able to follow the guide, where does the behavior differ from the description?

    I assume you have checked the switches on the DK that is not working. Make sure that they are in the same positions as the one that is working. 

    Does any of the other nrfjprog commands work with the defect DK? Have you tried nrfjprog --ids? Is the device listed?

    BR,

    Edvin

Children
Related