Unable to flash nRF52840dk using west flash

Hi there,

A couple of weeks ago, I'm facing the issue that my nRF52840DK board is not visible and led5 is flashing rapidly. I reflashed the bootloader, j-link-ob-sam3u128-v2-nordicsemi-170724, on the board by following the instruction here https://devzone.nordicsemi.com/f/nordic-q-a/8144/i-can-t-update-the-j-link-ob-firmware-nrf51-dk 

After reflashing the bootloader, the board is visible again with the name Jlink. But somehow I'm not able to flash it anymore with west flash as shown in the screenshot below.


But I am able to flash the board using jlink-commander and the blinky program seems to be working fine.


Thanks in advance for any helps!
Leo

  • [2022-Apr-13 10:44:41] [ info] --------------------------------------------------------------------------------
    [2022-Apr-13 10:44:41] [ info] nrfjprog --recover --log 
    [2022-Apr-13 10:44:41] [ info] nrfjprog version 10.15.4 external
    [2022-Apr-13 10:44:41] [ info] --------------------------------------------------------------------------------
    [2022-Apr-13 10:44:41] [ info] Load library at C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\nrfjprog.dll.
    [2022-Apr-13 10:44:41] [ info] Library loaded, loading member functions.
    [2022-Apr-13 10:44:41] [ info] Member functions succesfully loaded.
    [2022-Apr-13 10:44:41] [debug] [ Client] - open
    [2022-Apr-13 10:44:41] [debug] [ Client] - start
    [2022-Apr-13 10:44:41] [ info] [ Client] - stdout: Jlinkarm nRF Worker ready. Handling sequence ab5fdf48-baf1-4773-a6c5-42f5c7630959.
    
    [2022-Apr-13 10:44:41] [trace] [ Client] - Command open executed for 50 milliseconds with result 0
    [2022-Apr-13 10:44:41] [debug] [ Client] - enum_emu_snr
    [2022-Apr-13 10:44:41] [trace] [ Client] - Command enum_emu_con_info executed for 15 milliseconds with result 0
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - Logger sink registered in Segger backend logger
    [2022-Apr-13 10:44:41] [debug] [  JLink] - Logger sink registered in JLink logger
    [2022-Apr-13 10:44:41] [debug] [  nRFXX] - open
    [2022-Apr-13 10:44:41] [debug] [  nRFXX] - just_check_family
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - open_dll
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2022-Apr-13 10:44:41] [ info] [SeggerBackend] - Load library at C:\Program Files\SEGGER\JLink\JLink_x64.dll.
    [2022-Apr-13 10:44:41] [ info] [SeggerBackend] - Library loaded, loading member functions.
    [2022-Apr-13 10:44:41] [ info] [SeggerBackend] - Member functions succesfully loaded.
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - dll_version
    [2022-Apr-13 10:44:41] [ info] [SeggerBackend] - Segger dll version 7.58.b loaded.
    [2022-Apr-13 10:44:41] [trace] [ Worker] - Command open executed for 6 milliseconds with result 0
    [2022-Apr-13 10:44:41] [debug] [  nRFXX] - enum_emu_con_info
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - enum_emu_con_info
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:44:41] [trace] [ Worker] - Command enum_emu_con_info executed for 1 milliseconds with result 0
    [2022-Apr-13 10:44:41] [debug] [  nRFXX] - close
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - close
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - disconnect_from_emu
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:44:41] [debug] [SeggerBackend] - Segger Backend closed.
    [2022-Apr-13 10:44:41] [trace] [ Client] - Command close executed for 16 milliseconds with result 0
    [2022-Apr-13 10:44:41] [debug] [ Client] - terminate
    [2022-Apr-13 10:44:41] [trace] [ Client] - Command terminate executed for 0 milliseconds with result 0
    [2022-Apr-13 10:44:41] [debug] [  nRFXX] - nRF family DLL closed
    [2022-Apr-13 10:44:41] [trace] [ Worker] - Command close executed for 15 milliseconds with result 0
    [2022-Apr-13 10:44:41] [trace] [ Worker] - Command terminate executed for 0 milliseconds with result 0
    [2022-Apr-13 10:44:41] [trace] [ Worker] - Executed 4 commands for 22 milliseconds
    [2022-Apr-13 10:44:41] [debug] [ Client] - Worker process exited with code: 0
    [2022-Apr-13 10:44:41] [debug] [ Client] - Worker process exited with code: 0
    [2022-Apr-13 10:44:41] [debug] [ Client] - Child process terminated with result 0
    [2022-Apr-13 10:44:41] [trace] [ Client] - Executed 4 commands for 81 milliseconds
    [2022-Apr-13 10:44:41] [debug] [ Client] - terminate
    [2022-Apr-13 10:44:52] [ info] --------------------------------------------------------------------------------
    [2022-Apr-13 10:44:52] [ info] nrfjprog --recover --log 
    [2022-Apr-13 10:44:52] [ info] nrfjprog version 10.15.4 external
    [2022-Apr-13 10:44:52] [ info] --------------------------------------------------------------------------------
    [2022-Apr-13 10:44:52] [ info] Load library at C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\nrfjprog.dll.
    [2022-Apr-13 10:44:52] [ info] Library loaded, loading member functions.
    [2022-Apr-13 10:44:52] [ info] Member functions succesfully loaded.
    [2022-Apr-13 10:44:52] [debug] [ Client] - open
    [2022-Apr-13 10:44:52] [debug] [ Client] - start
    [2022-Apr-13 10:44:52] [ info] [ Client] - stdout: Jlinkarm nRF Worker ready. Handling sequence 9e6e1d72-b99a-4af9-9db6-59ad6900371d.
    
    [2022-Apr-13 10:44:52] [trace] [ Client] - Command open executed for 42 milliseconds with result 0
    [2022-Apr-13 10:44:52] [debug] [ Client] - enum_emu_snr
    [2022-Apr-13 10:44:52] [trace] [ Client] - Command enum_emu_con_info executed for 5 milliseconds with result 0
    [2022-Apr-13 10:44:52] [debug] [ Client] - connect_to_emu_with_snr
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - Logger sink registered in Segger backend logger
    [2022-Apr-13 10:44:52] [debug] [  JLink] - Logger sink registered in JLink logger
    [2022-Apr-13 10:44:52] [debug] [  nRFXX] - open
    [2022-Apr-13 10:44:52] [debug] [  nRFXX] - just_check_family
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - open_dll
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2022-Apr-13 10:44:52] [ info] [SeggerBackend] - Load library at C:\Program Files\SEGGER\JLink\JLink_x64.dll.
    [2022-Apr-13 10:44:52] [ info] [SeggerBackend] - Library loaded, loading member functions.
    [2022-Apr-13 10:44:52] [ info] [SeggerBackend] - Member functions succesfully loaded.
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - dll_version
    [2022-Apr-13 10:44:52] [ info] [SeggerBackend] - Segger dll version 7.58.b loaded.
    [2022-Apr-13 10:44:52] [trace] [ Worker] - Command open executed for 5 milliseconds with result 0
    [2022-Apr-13 10:44:52] [debug] [  nRFXX] - enum_emu_con_info
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - enum_emu_con_info
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:44:52] [trace] [ Worker] - Command enum_emu_con_info executed for 5 milliseconds with result 0
    [2022-Apr-13 10:44:52] [debug] [  nRFXX] - connect_to_emu_with_snr
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - connect_to_emu_with_snr
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - ---just_enum_emu_snr
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - ---just_get_num_emus
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - ---just_connect_to_emu_with_snr
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - ---just_connect_to_emu_without_snr
    [2022-Apr-13 10:44:52] [debug] [SeggerBackend] - Segger logging enabled.
    [2022-Apr-13 10:44:53] [trace] [  JLink] - Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
    [2022-Apr-13 10:44:53] [trace] [  JLink] - Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
    [2022-Apr-13 10:44:53] [trace] [  JLink] - Updating firmware:  J-Link OB-SAM3U128-V2-NordicSemi compiled Feb  2 2021 16:47:20
    [2022-Apr-13 10:44:53] [trace] [  JLink] - Updating firmware:  J-Link OB-SAM3U128-V2-NordicSemi compiled Feb  2 2021 16:47:20
    [2022-Apr-13 10:44:53] [trace] [  JLink] - Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
    [2022-Apr-13 10:44:53] [trace] [  JLink] - Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
    [2022-Apr-13 10:45:38] [trace] [  JLink] -    ***** Error: 
    [2022-Apr-13 10:45:38] [trace] [  JLink] - Communication timeout. Emulator did not re-enumerate.
    [2022-Apr-13 10:45:38] [trace] [  JLink] -    ***** Error: 
    [2022-Apr-13 10:45:38] [trace] [  JLink] - Cannot connect to J-Link
    [2022-Apr-13 10:45:38] [trace] [ Client] - Command connect_to_emu_with_snr executed for 45176 milliseconds with result -102
    [2022-Apr-13 10:45:38] [trace] [  JLink] - - 45119.608ms returns "Communication timeout. Emulator did not re-enumerate. Cannot connect to J-Link"  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_HasError()  
    [2022-Apr-13 10:45:38] [error] [SeggerBackend] - JLinkARM.dll Open returned error 'Communication timeout. Emulator did not re-enumerate.
    Cannot connect to J-Link'
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_OpenEx(...)  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - - 10.801ms returns "Failed to open DLL"  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_HasError()  
    [2022-Apr-13 10:45:38] [error] [SeggerBackend] - JLinkARM.dll Open returned error 'Failed to open DLL'
    [2022-Apr-13 10:45:38] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_IsOpen()  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - - 0.005ms returns 0x00  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_HasError()  
    [2022-Apr-13 10:45:38] [trace] [ Worker] - Command connect_to_emu_with_snr executed for 45171 milliseconds with result -102
    [2022-Apr-13 10:45:38] [debug] [  nRFXX] - close
    [2022-Apr-13 10:45:38] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_IsOpen()  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - - 0.006ms returns 0x00  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_HasError()  
    [2022-Apr-13 10:45:38] [debug] [SeggerBackend] - close
    [2022-Apr-13 10:45:38] [debug] [SeggerBackend] - disconnect_from_emu
    [2022-Apr-13 10:45:38] [debug] [SeggerBackend] - is_connected_to_emu
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_IsOpen()  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - - 0.003ms returns 0x00  
    [2022-Apr-13 10:45:38] [trace] [  JLink] - JLINK_HasError()  
    [2022-Apr-13 10:45:38] [debug] [SeggerBackend] - Segger Backend closed.
    [2022-Apr-13 10:45:38] [debug] [  nRFXX] - nRF family DLL closed
    [2022-Apr-13 10:45:38] [trace] [ Client] - Command close executed for 14 milliseconds with result 0
    [2022-Apr-13 10:45:38] [debug] [ Client] - terminate
    [2022-Apr-13 10:45:38] [trace] [ Client] - Command terminate executed for 14 milliseconds with result 0
    [2022-Apr-13 10:45:38] [trace] [ Worker] - Command close executed for 13 milliseconds with result 0
    [2022-Apr-13 10:45:38] [trace] [ Worker] - Command terminate executed for 0 milliseconds with result 0
    [2022-Apr-13 10:45:38] [trace] [ Worker] - Executed 5 commands for 45194 milliseconds
    [2022-Apr-13 10:45:38] [debug] [ Client] - Worker process exited with code: 0
    [2022-Apr-13 10:45:38] [debug] [ Client] - Worker process exited with code: 0
    [2022-Apr-13 10:45:38] [debug] [ Client] - Child process terminated with result 0
    [2022-Apr-13 10:45:38] [trace] [ Client] - Executed 5 commands for 45251 milliseconds
    [2022-Apr-13 10:45:38] [debug] [ Client] - terminate
    

    Here is the error log for the reference

  • Hi Leo

    Which version of the nRF52840DK do you have?

    Are you able to enter bootloader mode again?
    Try to update the bootloader once more the same way. Give the device a minute before re-powering it (plug it out and back in. Make sure no battery is connected) after the new bootloader has been programmed.

    Does it still show the same error after?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    Thanks for your response!
    I am not sure where to find the version of the nRF52840DK. The sticker on the development board shows PCA10056      2.0.1      2021.10     683083855

    It still shows the same error after. I am not sure why Jlink keeps recognizing the firmware downloaded from https://devzone.nordicsemi.com/f/nordic-q-a/8144/i-can-t-update-the-j-link-ob-firmware-nrf51-dk is compiled in 2017. 



    With the above being said, if I choose not to update the firmware in J-link commander, select no in the picture below.
    I am able to flash the program properly.

  • Sorry, the link in the above comment is not correct. The firmware I'm using is downloaded here, www.nordicsemi.com/.../J-Link-OB-SAM3U128-V2-NordicSemi-170724.bin

  • Huizhe Zheng said:

    With the above being said, if I choose not to update the firmware in J-link commander, select no in the picture below.
    I am able to flash the program properly.

    Just to be clear:

    So you do are able to use the nRF52840DK with this?

    Regards,
    Sigurd Hellesvik

Related