nRF52840: JLink unable to establish connection

Hi all,

I got a board back from one of my students, which kind of broke it.

Initially, the JLink on the board did not reply at all to anything. Therefore, I reflashed the firmware onto the JLink via holding the boot button and copying the MCU interface binary into the mast storage device registered on my PC. I'm not entirely sure if the reflashing worked correctly as LED5 kept flashing.

After a reboot of the board registered a serial port and the LED5 was on. Nonetheless, when I try flashing my program I get an error, the corresponding log is here:

[2023-Mar-08 08:28:37] [ info] --------------------------------------------------------------------------------
[2023-Mar-08 08:28:37] [ info] nrfjprog --log --program /workingdir/project/build/zephyr/zephyr.hex --sectoranduicrerase --verify -f NRF52 --snr 683884227 
[2023-Mar-08 08:28:37] [ info] nrfjprog version 10.15.4 external
[2023-Mar-08 08:28:37] [ info] --------------------------------------------------------------------------------
[2023-Mar-08 08:28:37] [ info] Load library at /opt/nrf-command-line-tools/lib/libnrfjprogdll.so.
[2023-Mar-08 08:28:37] [ info] Library loaded, loading member functions.
[2023-Mar-08 08:28:37] [ info] Member functions succesfully loaded.
[2023-Mar-08 08:28:37] [debug] [ Client] - open
[2023-Mar-08 08:28:37] [debug] [ Client] - start
[2023-Mar-08 08:28:37] [ info] [ Client] - stdout: Jlinkarm nRF Worker ready. Handling sequence b9031f65-d371-4acd-81e1-7f5760dde19c.
[2023-Mar-08 08:28:37] [trace] [ Client] - Command open executed for 3 milliseconds with result 0
[2023-Mar-08 08:28:37] [debug] [ Client] - enum_emu_snr
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - Logger sink registered in Segger backend logger
[2023-Mar-08 08:28:37] [debug] [  JLink] - Logger sink registered in JLink logger
[2023-Mar-08 08:28:37] [debug] [  nRF52] - open
[2023-Mar-08 08:28:37] [debug] [  nRF52] - just_check_family
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - open_dll
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - No J-Link DLL path was provided. Attempting to auto detect.
[2023-Mar-08 08:28:37] [ info] [SeggerBackend] - Load library at /opt/SEGGER/JLink/libjlinkarm.so.7.64.3.
[2023-Mar-08 08:28:37] [ info] [SeggerBackend] - Library loaded, loading member functions.
[2023-Mar-08 08:28:37] [ info] [SeggerBackend] - Member functions succesfully loaded.
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - dll_version
[2023-Mar-08 08:28:37] [ info] [SeggerBackend] - Segger dll version 7.64.c loaded.
[2023-Mar-08 08:28:37] [trace] [ Worker] - Command open executed for 2 milliseconds with result 0
[2023-Mar-08 08:28:37] [debug] [  nRF52] - enum_emu_con_info
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - enum_emu_con_info
[2023-Mar-08 08:28:37] [trace] [ Client] - Command enum_emu_con_info executed for 87 milliseconds with result 0
[2023-Mar-08 08:28:37] [debug] [ Client] - connect_to_emu_with_snr
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:28:37] [trace] [ Worker] - Command enum_emu_con_info executed for 87 milliseconds with result 0
[2023-Mar-08 08:28:37] [debug] [  nRF52] - connect_to_emu_with_snr
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - connect_to_emu_with_snr
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - ---just_enum_emu_snr
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - ---just_get_num_emus
[2023-Mar-08 08:28:37] [debug] [SeggerBackend] - ---just_connect_to_emu_with_snr
[2023-Mar-08 08:28:38] [debug] [SeggerBackend] - ---just_connect_to_emu_without_snr
[2023-Mar-08 08:28:38] [debug] [SeggerBackend] - Segger logging enabled.
[2023-Mar-08 08:28:38] [trace] [ Client] - Command connect_to_emu_with_snr executed for 275 milliseconds with result -102
[2023-Mar-08 08:28:38] [trace] [  JLink] -    ***** Error: 
[2023-Mar-08 08:28:38] [trace] [  JLink] - Cannot connect to J-Link.
[2023-Mar-08 08:28:38] [trace] [  JLink] - - 10.780ms returns "Cannot connect to J-Link."  
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:28:38] [error] [SeggerBackend] - JLinkARM.dll Open returned error 'Cannot connect to J-Link.'
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_OpenEx(...)  
[2023-Mar-08 08:28:38] [trace] [  JLink] - - 0.052ms returns "Failed to open DLL"  
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:28:38] [error] [SeggerBackend] - JLinkARM.dll Open returned error 'Failed to open DLL'
[2023-Mar-08 08:28:38] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_IsOpen()  
[2023-Mar-08 08:28:38] [trace] [  JLink] - - 0.002ms returns 0x00  
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:28:38] [trace] [ Worker] - Command connect_to_emu_with_snr executed for 275 milliseconds with result -102
[2023-Mar-08 08:28:38] [debug] [  nRF52] - close
[2023-Mar-08 08:28:38] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_IsOpen()  
[2023-Mar-08 08:28:38] [trace] [  JLink] - - 0.002ms returns 0x00  
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:28:38] [debug] [SeggerBackend] - close
[2023-Mar-08 08:28:38] [debug] [SeggerBackend] - disconnect_from_emu
[2023-Mar-08 08:28:38] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_IsOpen()  
[2023-Mar-08 08:28:38] [trace] [  JLink] - - 0.003ms returns 0x00  
[2023-Mar-08 08:28:38] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:28:38] [debug] [SeggerBackend] - Segger Backend closed.
[2023-Mar-08 08:28:38] [debug] [  nRF52] - nRF family DLL closed
[2023-Mar-08 08:28:38] [trace] [ Client] - Command close executed for 25 milliseconds with result 0
[2023-Mar-08 08:28:38] [debug] [ Client] - terminate
[2023-Mar-08 08:28:38] [trace] [ Client] - Command terminate executed for 0 milliseconds with result 0
[2023-Mar-08 08:28:38] [trace] [ Worker] - Command close executed for 25 milliseconds with result 0
[2023-Mar-08 08:28:38] [trace] [ Worker] - Command terminate executed for 0 milliseconds with result 0
[2023-Mar-08 08:28:38] [trace] [ Worker] - Executed 5 commands for 389 milliseconds
[2023-Mar-08 08:28:38] [debug] [ Client] - Worker process exited with code: 0
[2023-Mar-08 08:28:38] [debug] [ Client] - Worker process exited with code: 0
[2023-Mar-08 08:28:38] [debug] [ Client] - Child process terminated with result 0
[2023-Mar-08 08:28:38] [trace] [ Client] - Executed 5 commands for 390 milliseconds
[2023-Mar-08 08:28:38] [debug] [ Client] - terminate
[2023-Mar-08 08:34:06] [ info] --------------------------------------------------------------------------------
[2023-Mar-08 08:34:06] [ info] nrfjprog --log --program /workingdir/project/build/zephyr/zephyr.hex --sectoranduicrerase --verify -f NRF52 --snr 683884227 
[2023-Mar-08 08:34:06] [ info] nrfjprog version 10.15.4 external
[2023-Mar-08 08:34:06] [ info] --------------------------------------------------------------------------------
[2023-Mar-08 08:34:06] [ info] Load library at /opt/nrf-command-line-tools/lib/libnrfjprogdll.so.
[2023-Mar-08 08:34:06] [ info] Library loaded, loading member functions.
[2023-Mar-08 08:34:06] [ info] Member functions succesfully loaded.
[2023-Mar-08 08:34:06] [debug] [ Client] - open
[2023-Mar-08 08:34:06] [debug] [ Client] - start
[2023-Mar-08 08:34:06] [ info] [ Client] - stdout: Jlinkarm nRF Worker ready. Handling sequence 554ace45-fb9a-4bd0-bfa9-e1db9cab8eca.
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - Logger sink registered in Segger backend logger
[2023-Mar-08 08:34:06] [debug] [  JLink] - Logger sink registered in JLink logger
[2023-Mar-08 08:34:06] [debug] [  nRF52] - open
[2023-Mar-08 08:34:06] [debug] [  nRF52] - just_check_family
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - open_dll
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - No J-Link DLL path was provided. Attempting to auto detect.
[2023-Mar-08 08:34:06] [ info] [SeggerBackend] - Load library at /opt/SEGGER/JLink/libjlinkarm.so.7.64.3.
[2023-Mar-08 08:34:06] [trace] [ Client] - Command open executed for 32 milliseconds with result 0
[2023-Mar-08 08:34:06] [debug] [ Client] - enum_emu_snr
[2023-Mar-08 08:34:06] [ info] [SeggerBackend] - Library loaded, loading member functions.
[2023-Mar-08 08:34:06] [ info] [SeggerBackend] - Member functions succesfully loaded.
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - dll_version
[2023-Mar-08 08:34:06] [ info] [SeggerBackend] - Segger dll version 7.64.c loaded.
[2023-Mar-08 08:34:06] [trace] [ Worker] - Command open executed for 31 milliseconds with result 0
[2023-Mar-08 08:34:06] [debug] [  nRF52] - enum_emu_con_info
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - enum_emu_con_info
[2023-Mar-08 08:34:06] [trace] [ Client] - Command enum_emu_con_info executed for 97 milliseconds with result 0
[2023-Mar-08 08:34:06] [debug] [ Client] - connect_to_emu_with_snr
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:34:06] [trace] [ Worker] - Command enum_emu_con_info executed for 97 milliseconds with result 0
[2023-Mar-08 08:34:06] [debug] [  nRF52] - connect_to_emu_with_snr
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - connect_to_emu_with_snr
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - ---just_enum_emu_snr
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - ---just_get_num_emus
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - ---just_connect_to_emu_with_snr
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - ---just_connect_to_emu_without_snr
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - Segger logging enabled.
[2023-Mar-08 08:34:06] [trace] [ Client] - Command connect_to_emu_with_snr executed for 287 milliseconds with result -102
[2023-Mar-08 08:34:06] [trace] [  JLink] -    ***** Error: 
[2023-Mar-08 08:34:06] [trace] [  JLink] - Cannot connect to J-Link.
[2023-Mar-08 08:34:06] [trace] [  JLink] - - 10.927ms returns "Cannot connect to J-Link."  
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:34:06] [error] [SeggerBackend] - JLinkARM.dll Open returned error 'Cannot connect to J-Link.'
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_OpenEx(...)  
[2023-Mar-08 08:34:06] [trace] [  JLink] - - 0.057ms returns "Failed to open DLL"  
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:34:06] [error] [SeggerBackend] - JLinkARM.dll Open returned error 'Failed to open DLL'
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_IsOpen()  
[2023-Mar-08 08:34:06] [trace] [  JLink] - - 0.002ms returns 0x00  
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:34:06] [trace] [ Worker] - Command connect_to_emu_with_snr executed for 287 milliseconds with result -102
[2023-Mar-08 08:34:06] [debug] [  nRF52] - close
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_IsOpen()  
[2023-Mar-08 08:34:06] [trace] [  JLink] - - 0.003ms returns 0x00  
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - close
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - disconnect_from_emu
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - is_connected_to_emu
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_IsOpen()  
[2023-Mar-08 08:34:06] [trace] [  JLink] - - 0.002ms returns 0x00  
[2023-Mar-08 08:34:06] [trace] [  JLink] - JLINK_HasError()  
[2023-Mar-08 08:34:06] [debug] [SeggerBackend] - Segger Backend closed.
[2023-Mar-08 08:34:06] [debug] [  nRF52] - nRF family DLL closed
[2023-Mar-08 08:34:06] [trace] [ Client] - Command close executed for 10 milliseconds with result 0
[2023-Mar-08 08:34:06] [debug] [ Client] - terminate
[2023-Mar-08 08:34:06] [trace] [ Client] - Command terminate executed for 0 milliseconds with result 0
[2023-Mar-08 08:34:06] [trace] [ Worker] - Command close executed for 10 milliseconds with result 0
[2023-Mar-08 08:34:06] [trace] [ Worker] - Command terminate executed for 0 milliseconds with result 0
[2023-Mar-08 08:34:06] [trace] [ Worker] - Executed 5 commands for 425 milliseconds
[2023-Mar-08 08:34:06] [debug] [ Client] - Worker process exited with code: 0
[2023-Mar-08 08:34:06] [debug] [ Client] - Worker process exited with code: 0
[2023-Mar-08 08:34:06] [debug] [ Client] - Child process terminated with result 0
[2023-Mar-08 08:34:06] [trace] [ Client] - Executed 5 commands for 426 milliseconds
[2023-Mar-08 08:34:06] [debug] [ Client] - terminate

The interesting thing is that the JLink registers a mass storage device and I can flash the firmware via this interface.

I'm kinda lost now and I don't know if there is a way to save the board. Is there anything left I can do?

Related