Unable to Flash nRF Device via nRF Connect for VS Code – Device Disconnects

Hello,

I am experiencing an issue when trying to flash any program using nRF Connect for VS Code. When I execute the flash command, my board disappears from the "Connected Devices" section, and the LED5 on the Dev Kit starts blinking rapidly. This continues until I disconnect and reconnect the USB cable.

I have attached the generated log and the terminal output for reference. I have also tried uninstalling all Nordic software and reinstalling it, but the issue persists.

Additional information:

  • nRF SDK v2.5.2

  • nRF toolchain v2.7.0

  • nRF Command Line Tools version: 10.24.2

  • Board: nRF52840 DK

  • OS: Windows 11 - V21H2

  • I have tried multiple USB cables and ports.

Could you please assist me in resolving this issue? It seems like the debugger cannot connect properly to the device, but the J-Link works normally for other operations.

Log file:

[2025-Aug-20 10:33:26] [debug] --------------------------------------------------------------------------------
[2025-Aug-20 10:33:26] [debug] C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\nrfjprog.exe --log --program c:\Users\Techplus\Desktop\imachine-sensor-v3\build_1\zephyr\zephyr.hex --chiperase --verify -f NRF52 --snr 1050297570 
[2025-Aug-20 10:33:26] [debug] nrfjprog version 10.24.2 external
[2025-Aug-20 10:33:26] [debug] --------------------------------------------------------------------------------
[2025-Aug-20 10:33:26] [ info] Load library at C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\nrfjprog.dll.
[2025-Aug-20 10:33:26] [ info] Library loaded, loading member functions.
[2025-Aug-20 10:33:26] [ info] Member functions succesfully loaded.
[2025-Aug-20 10:33:26] [debug] [ Client] - open
[2025-Aug-20 10:33:26] [debug] [ Client] - start
[2025-Aug-20 10:33:26] [ info] [ Client] - stdout: Jlinkarm nRF Worker ready. Handling sequence 62fbb1ef-7819-464a-a879-060f56351e59.

[2025-Aug-20 10:33:26] [trace] [ Client] - Command open executed for 71 milliseconds with result 0
[2025-Aug-20 10:33:26] [debug] [ Client] - config
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - Logger sink registered in Segger backend logger
[2025-Aug-20 10:33:26] [debug] [  JLink] - Logger sink registered in JLink logger
[2025-Aug-20 10:33:26] [debug] [  nRF52] - open
[2025-Aug-20 10:33:26] [debug] [  nRF52] - just_check_family
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - open_dll
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - No J-Link DLL path was provided. Attempting to auto detect.
[2025-Aug-20 10:33:26] [ info] [SeggerBackend] - Load library at C:\Program Files\SEGGER\JLink_V858\JLink_x64.dll.
[2025-Aug-20 10:33:26] [ info] [SeggerBackend] - Library loaded, loading member functions.
[2025-Aug-20 10:33:26] [ info] [SeggerBackend] - Member functions succesfully loaded.
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - Set batch mode
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - dll_version
[2025-Aug-20 10:33:26] [ info] [SeggerBackend] - Segger dll version 8.58.  loaded.
[2025-Aug-20 10:33:26] [trace] [ Worker] - Command open executed for 7 milliseconds with result 0
[2025-Aug-20 10:33:26] [debug] [  nRF52] - config
[2025-Aug-20 10:33:26] [trace] [ Client] - Command config executed for 33 milliseconds with result 0
[2025-Aug-20 10:33:26] [debug] [ Client] - enum_emu_snr
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - enum_emu_snr
[2025-Aug-20 10:33:26] [trace] [ Worker] - Command config executed for 32 milliseconds with result 0
[2025-Aug-20 10:33:26] [debug] [  nRF52] - enum_emu_con_info
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - is_connected_to_emu
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - enum_emu_con_info
[2025-Aug-20 10:33:26] [trace] [ Client] - Command enum_emu_con_info executed for 39 milliseconds with result 0
[2025-Aug-20 10:33:26] [debug] [ Client] - connect_to_emu_with_snr
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - is_connected_to_emu
[2025-Aug-20 10:33:26] [trace] [ Worker] - Command enum_emu_con_info executed for 20 milliseconds with result 0
[2025-Aug-20 10:33:26] [debug] [  nRF52] - connect_to_emu_with_snr
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - is_connected_to_emu
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - connect_to_emu_with_snr
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - is_connected_to_emu
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - ---just_enum_emu_snr
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - ---just_get_num_emus
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - ---just_connect_to_emu_with_snr
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - ---just_connect_to_emu_without_snr
[2025-Aug-20 10:33:26] [debug] [SeggerBackend] - Segger logging enabled.
[2025-Aug-20 10:33:26] [trace] [  JLink] - Firmware: J-Link OB-nRF5340-NordicSemi compiled Feb 11 2025 17:15:35
[2025-Aug-20 10:33:26] [trace] [  JLink] - Firmware: J-Link OB-nRF5340-NordicSemi compiled Feb 11 2025 17:15:35
[2025-Aug-20 10:33:26] [trace] [  JLink] - Updating firmware:  J-Link OB-nRF5340-NordicSemi compiled Jul  8 2025 10:15:34
[2025-Aug-20 10:33:26] [trace] [  JLink] - Updating firmware:  J-Link OB-nRF5340-NordicSemi compiled Jul  8 2025 10:15:34
[2025-Aug-20 10:33:26] [trace] [  JLink] - Replacing firmware: J-Link OB-nRF5340-NordicSemi compiled Feb 11 2025 17:15:35
[2025-Aug-20 10:33:26] [trace] [  JLink] - Replacing firmware: J-Link OB-nRF5340-NordicSemi compiled Feb 11 2025 17:15:35
[2025-Aug-20 10:34:00] [trace] [  JLink] -    ***** Error: 
[2025-Aug-20 10:34:00] [trace] [  JLink] - Failed to activate bootloader (timeout)
[2025-Aug-20 10:34:00] [error] [ Client] - Encountered error -105: Command connect_to_emu_with_snr executed for 33907 milliseconds with result -105
[2025-Aug-20 10:34:00] [trace] [  JLink] -    ***** Error: 
[2025-Aug-20 10:34:00] [trace] [  JLink] - Communication timed out: Requested 4 bytes, received 0 bytes !
[2025-Aug-20 10:34:00] [trace] [  JLink] -    ***** Error: 
[2025-Aug-20 10:34:00] [trace] [  JLink] - Cannot connect to J-Link
[2025-Aug-20 10:34:00] [trace] [  JLink] - - 33766.804ms returns "Failed to activate bootloader (timeout) Communication timed out: Requested 4 bytes, received 0 bytes ! Cannot connect to J-Link"  
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_HasError()  
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_OpenEx(...)  
[2025-Aug-20 10:34:00] [trace] [  JLink] -    ***** Error: 
[2025-Aug-20 10:34:00] [trace] [  JLink] - Cannot connect to J-Link.
[2025-Aug-20 10:34:00] [trace] [  JLink] - - 21.079ms returns "Cannot connect to J-Link."  
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_HasError()  
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_OpenEx(...)  
[2025-Aug-20 10:34:00] [trace] [  JLink] -    ***** Error: 
[2025-Aug-20 10:34:00] [trace] [  JLink] - Cannot connect to J-Link.
[2025-Aug-20 10:34:00] [trace] [  JLink] - - 9.042ms returns "Cannot connect to J-Link."  
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_HasError()  
[2025-Aug-20 10:34:00] [debug] [SeggerBackend] - is_connected_to_emu
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_IsOpen()  
[2025-Aug-20 10:34:00] [trace] [  JLink] - - 0.031ms returns 0x00  
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_HasError()  
[2025-Aug-20 10:34:00] [error] [ Worker] - JLinkARM.dll Open returned error 'Cannot connect to J-Link.'
[2025-Aug-20 10:34:00] [trace] [ Worker] - Command connect_to_emu_with_snr executed for 33885 milliseconds with result -105
[2025-Aug-20 10:34:00] [debug] [  nRF52] - close
[2025-Aug-20 10:34:00] [debug] [SeggerBackend] - is_connected_to_emu
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_IsOpen()  
[2025-Aug-20 10:34:00] [trace] [  JLink] - - 0.021ms returns 0x00  
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_HasError()  
[2025-Aug-20 10:34:00] [debug] [SeggerBackend] - close
[2025-Aug-20 10:34:00] [debug] [SeggerBackend] - disconnect_from_emu
[2025-Aug-20 10:34:00] [debug] [SeggerBackend] - is_connected_to_emu
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_IsOpen()  
[2025-Aug-20 10:34:00] [trace] [  JLink] - - 0.010ms returns 0x00  
[2025-Aug-20 10:34:00] [trace] [  JLink] - JLINK_HasError()  
[2025-Aug-20 10:34:00] [debug] [SeggerBackend] - Segger Backend closed.
[2025-Aug-20 10:34:00] [debug] [  nRF52] - nRF family DLL closed
[2025-Aug-20 10:34:00] [trace] [ Client] - Command close executed for 39 milliseconds with result 0
[2025-Aug-20 10:34:00] [debug] [ Client] - terminate
[2025-Aug-20 10:34:00] [trace] [ Client] - Command terminate executed for 5 milliseconds with result 0
[2025-Aug-20 10:34:00] [trace] [ Worker] - Command close executed for 34 milliseconds with result 0
[2025-Aug-20 10:34:00] [trace] [ Worker] - Command terminate executed for 0 milliseconds with result 0
[2025-Aug-20 10:34:00] [trace] [ Worker] - Executed 6 commands for 33978 milliseconds
[2025-Aug-20 10:34:00] [debug] [ Client] - Worker process exited with code: 0
[2025-Aug-20 10:34:00] [debug] [ Client] - Worker process exited with code: 0
[2025-Aug-20 10:34:00] [debug] [ Client] - Child process terminated with result 0
[2025-Aug-20 10:34:00] [trace] [ Client] - Executed 6 commands for 34094 milliseconds
[2025-Aug-20 10:34:00] [debug] [ Client] - terminate

Thank you,

Parents
  • Hi,

    It seems there may be an issue with the firmware of the onboard debugger. Can you try restorign the debugger firmware using J-Link Configurator?

  • Hi,

    I tried to restore the onboard debugger firmware using J-Link Configurator as you suggested, but the update fails every time. Here is the output I get:

    New firmware:  J-Link OB-nRF5340-NordicSemi compiled JUL  8 2025 10:15:34
    Current firmware: J-Link OB-nRF5340-NordicSemi compiled Apr  1 2025 10:13:35
    Starting bootloader...
      Waiting for emulator to detach... OK after 213ms.
      Waiting for emulator to attach... Timeout.
    ERROR: Communication timeout. Emulator did not re-enumerate.
    ERROR: Firmware update failed.

    I have already tried:

    • Disconnecting and reconnecting the USB cable

    • Using a different USB port and cable

    • Running J-Link Configurator as Administrator

    But the error persists.
    Do you have any other steps I can try to recover the onboard debugger?

    Thanks.

Reply
  • Hi,

    I tried to restore the onboard debugger firmware using J-Link Configurator as you suggested, but the update fails every time. Here is the output I get:

    New firmware:  J-Link OB-nRF5340-NordicSemi compiled JUL  8 2025 10:15:34
    Current firmware: J-Link OB-nRF5340-NordicSemi compiled Apr  1 2025 10:13:35
    Starting bootloader...
      Waiting for emulator to detach... OK after 213ms.
      Waiting for emulator to attach... Timeout.
    ERROR: Communication timeout. Emulator did not re-enumerate.
    ERROR: Firmware update failed.

    I have already tried:

    • Disconnecting and reconnecting the USB cable

    • Using a different USB port and cable

    • Running J-Link Configurator as Administrator

    But the error persists.
    Do you have any other steps I can try to recover the onboard debugger?

    Thanks.

Children
  • Hi,

    I see. From the log it seems the debugger does not enter bootloader mode for some reason. It is a bit far fetched, but can you check the nRF Only|Default switch on the top of the DK, to the right? perhaps move it to nRF only and then back to Default. And also check teh power close to left side of the DK flip it back to the middle possition? And the same with the power swithc. (This would be to ensure that there is no issue caused by bad connections).

    Lastly, it could be worth updating to the latest J-Link driver which is currently 8.62, but that is also  stretch as I have not reproduced any similar issue with 8.58 that I see from the log you use.

Related