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

nRF52840 DK disconnects when programming in a virtual Linux environment

Hi,

I am trying to prgram the nRF52840 DK board (revision 2.0.1) within a virual machine (VirtualBox running Linux Mint). I have installed the SDK and the nrf command line. When I run "make flash" in the directory of project (e.g. /home/damian/Documents/nRF5_SDK_17.0.2_d674dde/examples/peripheral/blinky/pca10056/blank) the following happens:

1. The outpuit of the terminal shows 

DONE nrf52840_xxaa
Flashing: _build/nrf52840_xxaa.hex
nrfjprog -f nrf52 --program _build/nrf52840_xxaa.hex --sectorerase

2. The JLink device that the nRF52840 DK board normally appears as suddenly disconnects and it halts at this last line before outputting the error

ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.
make: *** [Makefile:138: flash] Error 33

I then have to unplug and replug the DK board to make it appear again as a JLink drive. I have found that flashing the board with the MBED firmare fixes this problem and the device will sucesfully program the onboard chip. The problem here is that I am using the DK board to program an external board and when I have made the change to MBED, the debug out function no longer works. I need to be able to both program the DK in the virual linux environment and program an external board with it.

Thanks for you help

Parents Reply Children
  • Sure Stian,

    Here is the output of the log.log file

    [2021-Jun-29 22:10:53] [ info] --------------------------------------------------------------------------------
    [2021-Jun-29 22:10:53] [ info] nrfjprog -f nrf52 --log --program _build/nrf52840_xxaa.hex --sectorerase
    [2021-Jun-29 22:10:53] [ info] nrfjprog version 10.12.2
    [2021-Jun-29 22:10:53] [ info] --------------------------------------------------------------------------------
    [2021-Jun-29 22:10:53] [debug] [ nRF0x0] - open_dll
    [2021-Jun-29 22:10:53] [ info] [ nRF0x0] - Load library at /home/damian/Documents/nRF-Command-Line-Tools_10_12_2_Linux-amd64/nrfjprog/libjlinkarm_nrf52_nrfjprogdll.so.
    [2021-Jun-29 22:10:53] [ info] [ nRF0x0] - Library loaded, loading member functions.
    [2021-Jun-29 22:10:53] [ info] [ nRF0x0] - Member functions succesfully loaded.
    [2021-Jun-29 22:10:53] [ info] [Backend] - Logger callback at 0x55bd2b944150 registered in Segger backend logger.
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Logger callback at 0x55bd2b944150 registered in JLink logger.
    [2021-Jun-29 22:10:53] [debug] [nRF520x0] - open
    [2021-Jun-29 22:10:53] [debug] [Backend] - open_dll
    [2021-Jun-29 22:10:53] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2021-Jun-29 22:10:53] [ info] [Backend] - Load library at /opt/SEGGER/JLink/libjlinkarm.so.7.
    [2021-Jun-29 22:10:53] [ info] [Backend] - Library loaded, loading member functions.
    [2021-Jun-29 22:10:53] [ info] [Backend] - Member functions succesfully loaded.
    [2021-Jun-29 22:10:53] [debug] [Backend] - dll_version
    [2021-Jun-29 22:10:53] [ info] [Backend] - Segger dll version 7.22.b loaded.
    [2021-Jun-29 22:10:53] [debug] [ nRF0x0] - enum_emu_snr
    [2021-Jun-29 22:10:53] [debug] [nRF520x0] - enum_emu_snr
    [2021-Jun-29 22:10:53] [debug] [Backend] - is_connected_to_emu
    [2021-Jun-29 22:10:53] [debug] [Backend] - enum_emu_snr
    [2021-Jun-29 22:10:53] [debug] [Backend] - ---just_enum_emu_snr
    [2021-Jun-29 22:10:53] [debug] [Backend] - ---just_get_num_emus
    [2021-Jun-29 22:10:53] [debug] [Backend] - is_connected_to_emu
    [2021-Jun-29 22:10:53] [debug] [ nRF0x0] - connect_to_emu_with_snr
    [2021-Jun-29 22:10:53] [debug] [nRF520x0] - connect_to_emu_with_snr
    [2021-Jun-29 22:10:53] [debug] [Backend] - is_connected_to_emu
    [2021-Jun-29 22:10:53] [debug] [Backend] - connect_to_emu_with_snr
    [2021-Jun-29 22:10:53] [debug] [Backend] - is_connected_to_emu
    [2021-Jun-29 22:10:53] [debug] [Backend] - ---just_enum_emu_snr
    [2021-Jun-29 22:10:53] [debug] [Backend] - ---just_get_num_emus
    [2021-Jun-29 22:10:53] [debug] [Backend] - ---just_connect_to_emu_with_snr
    [2021-Jun-29 22:10:53] [debug] [Backend] - ---just_connect_to_emu_without_snr
    [2021-Jun-29 22:10:53] [ info] [Backend] - Segger logging enabled.
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Updating firmware:  J-Link OB-SAM3U128-V2-NordicSemi compiled Feb  2 2021 16:47:20
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Updating firmware:  J-Link OB-SAM3U128-V2-NordicSemi compiled Feb  2 2021 16:47:20
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ]    ***** Error:
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] Communication timeout. Emulator did not re-enumerate.
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ]    ***** Error:
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] Cannot connect to J-Link
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] - 47139.052ms returns "Communication timeout. Emulator did not re-enumerate. Cannot connect to J-Link"  
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Jun-29 22:11:40] [ info] [Backend] - JLinkARM.dll Open returned error 'Communication timeout. Emulator did not re-enumerate.
    Cannot connect to J-Link'
    [2021-Jun-29 22:11:40] [debug] [Backend] - is_connected_to_emu
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x00  
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Jun-29 22:11:40] [debug] [ nRF0x0] - close_dll
    [2021-Jun-29 22:11:40] [debug] [nRF520x0] - close
    [2021-Jun-29 22:11:40] [debug] [Backend] - is_connected_to_emu
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] - 0.004ms returns 0x00  
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Jun-29 22:11:40] [debug] [Backend] - close
    [2021-Jun-29 22:11:40] [debug] [Backend] - disconnect_from_emu
    [2021-Jun-29 22:11:40] [debug] [Backend] - is_connected_to_emu
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()  
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] - 0.003ms returns 0x00  
    [2021-Jun-29 22:11:40] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()  
    [2021-Jun-29 22:11:40] [debug] [Backend] - Segger Backend closed.
    [2021-Jun-29 22:11:40] [debug] [nRF520x0] - nRF family DLL closed

  • DamianSof said:
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Updating firmware:  J-Link OB-SAM3U128-V2-NordicSemi compiled Feb  2 2021 16:47:20
    [2021-Jun-29 22:10:53] [ info] [  JLink] - [Info    ] [JLink     ] Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00

    Looks to me like it's trying to upgrade the J-Link OB firmware on the DK before actually flashing the application on the nrF52, but then fails.

    Can you try to install the newest JLink drivers on the host computer, and then open the JLink Commander or similar to do the JLink OB firmware upgrade? Then you can try to connect the DK to the VM again and flash the application. It should now program the application without trying to upgrade the JLink FW first.

  • Hi Stian,

    Yes the firmware update you suggested fixed it. Thank you for your help.

Related