Program nRF9160DK inside of an ubuntu container on windows docker desktop

Hi everyone, 

i wrote a dockerfile with all nedeed dependencies and toolchain setups for software development of nRF9160DK. I would link to use Visual Studio Code running on the docker container with nRF Connect extension.

Until now i'm able to create a sample project, modify and build it correctly without errors. The problem arises when i need to flash it to the board. So i install the SEGGER JLINK driver, then i use usbipd following the instruction available online. Until now i'm able to see the board inside visual studio code (bottom part of the extension) and with 'lsusb' i correctly see the SEGGER JLink USB device, but when i press the "Flash" button i get the following errors:

I'm wondering if it is possible or not to do the flashing procedure on windows host. 

Thanks in advance,

Salvo.

Parents Reply Children
  • Can you interface the DK manually inside the container?

  • I discover that even if i run a sample command i get errors:

    root@52678d337f2f:~# nrfjprog -v
    ERROR: An internal error has occurred, please try again.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed

    I'm currently installing JLink drivers with

    RUN dpkg -i JLink_Linux_V763b_x86_64.deb 

    and nrf command line tools with

    RUN dpkg -i nrf-command-line-tools_10.15.3_amd64.deb 

     Am i doing this correctly?

  • Thanks to this link i solve the issue of internal error. Now i get:

    root@84bad2adf27d:/nRF91_Projects/hello_world# nrfjprog -v
    nrfjprog version: 10.15.3 external
    JLinkARM.dll version: 7.63b

    But, when i try to connect to the dk for i.e. a sectorerase command i get the following:

    root@84bad2adf27d:/nRF91_Projects/hello_world# nrfjprog --sectorerase -f nrf91
    ERROR: Unable to connect to a debugger.
    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.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.

    With log parameter:

    root@84bad2adf27d:/nRF91_Projects/hello_world# nrfjprog --sectorerase -f nrf91 --log
    ERROR: Unable to connect to a debugger.
    ERROR: [SeggerBackend] - JLinkARM.dll Open returned error 'Cannot connect to J-Link.'
    ERROR: [SeggerBackend] - JLinkARM.dll Open returned error 'Failed to open DLL'
    ERROR: [SeggerBackend] - Cannot call is_connected_to_device when connect_to_emu_without_snr or connect_to_emu_with_snr has not been called.
    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.

    Return of lsusb command:

    root@84bad2adf27d:/nRF91_Projects/hello_world# lsusb
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 002: ID 1366:1055 SEGGER J-Link
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

  • What does "JLinkExe" output if you try to run that manually?

    It sounds like you have permission problems. Have you followed any guides on how to forward a usb device to a docker instance? If you google "segger docker" - you should be able to find more information/guides on how to set it up.

    Kind regards,

    Håkon

Related