How to use the IP address to connect DK/JLINK on VS code

Dear Nordic Engineers

I use NCS2.1.2 and I have a question would to ask you. As we all know, we can use the IP address to connect the DK or Jink on Segger IDE. Becasue Segger IDE use the basics of JLINK flash.

So I would like to know VS Code has any function, it's the same as Segger IDE. It can use the IP address to connect DK or JLNK.

This  is very convenient function while I use the office computer  remotely from my home. 

...

Best regards,

Parents
  • Hi,

    I would like to request this feature as well.  Currently, the VSCode plugin doesn't support using a JLink Pro device via its IP address (USB is the only supported interface).  I tried adding a configuration to the launch.json file using gdbTarget, but this doesn't work with more complicated images used by the nRF5340 or nRF9160. 

    Is there a way to add this as a feature request for the VSCode plugin team?

  • We have had requests / queries for WSL support too, but not sure that we will support these very soon. But you can get debugging working using "Remote debug" and this could help you very much when remoting.

    One required prerequisite
    • jlinkgdbserverCL.exe firewall rule in Windows must accept incoming connection from private network
    One convenience to automatically get the Windows host IP
    • export hostip=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')

    Then you can give the debug conf in launch.json as follows:

    "configurations": [
            {
                "type": "nrf-connect",
                "request": "launch",
                "name": "Launch modem_shell/build",
                "config": "${workspaceFolder}/nrf/samples/nrf9160/modem_shell/build",
                "serverAddress": "${env:hostip}:${port}",
                "serverpath": "JLinkGDBServerCL.exe",
                "serverArgs": "-if swd -device ${device} -select usb=${snr} -speed 12000 -port ${port} -singlerun -nogui -halt -noir -silent -rtos ${rtosPlugin} -noLocalhostOnly",
                "flash": false,
            }
        ]

    -Priyanka

  • If I use a nrf-connect type configuration without a JLINK connected via USB, I get the error message "No devices connected".  Is there a way to disable this check?

    This is the configuration I used, which I think would work with my JLink pro otherwise.

            {
                "type": "nrf-connect",
                "request": "launch",
                "name": "Debug",
                "config": "${workspaceFolder}/build",
                "serverAddress": "localhost:${port}",
                "serverpath": "/Applications/SEGGER/JLink_V770/JLinkGDBServerCLExe",
                "serverArgs": "-if swd -device ${device} -select ip=192.168.50.196 -speed 12000 -port ${port} -singlerun -nogui -halt -noir -silent -rtos ${rtosPlugin} -noLocalhostOnly",
                "flash": false,
            }

Reply
  • If I use a nrf-connect type configuration without a JLINK connected via USB, I get the error message "No devices connected".  Is there a way to disable this check?

    This is the configuration I used, which I think would work with my JLink pro otherwise.

            {
                "type": "nrf-connect",
                "request": "launch",
                "name": "Debug",
                "config": "${workspaceFolder}/build",
                "serverAddress": "localhost:${port}",
                "serverpath": "/Applications/SEGGER/JLink_V770/JLinkGDBServerCLExe",
                "serverArgs": "-if swd -device ${device} -select ip=192.168.50.196 -speed 12000 -port ${port} -singlerun -nogui -halt -noir -silent -rtos ${rtosPlugin} -noLocalhostOnly",
                "flash": false,
            }

Children
  • Hi,

    Could you try using this:

    #!/bin/bash
    
    nrfjprog.exe $*

    in opt/nrfjprog

    -Priyanka
  • Hi Priyanka,

    I don't understand how to do for IP debug in VScode?

    Best Regards,

    George XIONG

  • I have been using the "cortex-debug" configuration instead of the "nrf-connect" configuration.  Otherwise, I get the "No devices connected" message if I don't have a JLINK plugged into my computer locally via USB.  I also put in a feature request for adding full support for Ethernet devices (ex. JLINK Pro) for the Nordic plugin.  Please also do so if you are interested in this feature using the "Give Feedback" link in the plugin.

    For now, this is an example of how I am configuring the "cortex-m" launch configuration on a Mac.

    {
    	"name": "JLINK Pro",
    	"type": "cortex-debug",
    	"request": "launch",
    	"executable": "${workspaceFolder}/build/zephyr/zephyr.elf",
    	"cwd": "${workspaceFolder}",
    	"serverpath": "/Applications/SEGGER/JLink_V770/JLinkGDBServerCLExe",
    	"ipAddress": "192.168.50.187",
    	"servertype": "jlink",
    	"device": "nRF52840_xxAA",
    	"interface": "swd",
    	"gdbPath": "/opt/nordic/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb",
    	"gdbTarget": "localhost:50000",
    	"runToEntryPoint": "main",
    	"rtos": "/Applications/SEGGER/JLink_V770/GDBServer/RTOSPlugin_Zephyr.dylib",
    	"serverArgs": [
    		"-speed",
    		"12000"
    	]
    }

Related