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