VSCode debug failure

Environment:

- Board: nRF54L15-DK (v0.9.2)
- SDK & Toolchain: nRF Connect SDK v3.1.0
- VS Code: v1.105.1
- nRF Connect for VS Code Extension: v2025.9.798
- Host PC: Windows 10

I built the "Hello World" sample from Zephyr using the build configuration with optimization level set to Optimize for debugging (-Og), and flashed it onto the nRF54L15-DK.
When I started debugging in VS Code, the following error message popped up:

> Unable to start debugging. GDB exited unexpectedly with exit code -3 (0xFFFFFFFD). Could not connect to target. No target voltage detected or connection failed.

This issue occurred on two different DK boards. After the failure, the USB driver on my Windows PC seemed to change unexpectedly, and the PC no longer recognized the USB ports on the DKs.
I used J-Link Configurator (J-Link config.exe) to check the driver, and found that the USB driver had switched from SEGGER to WinUSB. After restoring it back to SEGGER, USB communication was recovered.


Question:
How can I debug properly with this setup? Is there any recommended configuration or workaround to avoid this issue?

  • I just updated SEGGER JLink to the latest (v8.84), and after that, the dbugger worked successfully.

    This matches the information in the link below.

    https://devzone.nordicsemi.com/f/nordic-q-a/124514/could-not-connect-to-target-when-use-gdb-debug-in-vscode?ReplyFilter=Answers&ReplySortBy=Answers&ReplySortOrder=Descending

    However, I encountered an issue: I could not easily update J-Link in C://Program Files/SEGGER due to security restrictions.

    I would prefer to install it in the user-space, such as C://Users/XXXX...

    Is there any option or possibility to change the auto-search directory from C://Program Files/SEGGER to a user-space loaciton?

    {
      "tools": {
        "C:\\Program Files\\SEGGER\\JLink_V884\\JLink.exe": "8.84",
        "D:\\ncs\\toolchains\\b8b84efebd\\nrfutil": "8.1.0",
        "D:\\ncs\\toolchains\\b8b84efebd\\cmake": "3.21.0",
        "D:\\ncs\\toolchains\\b8b84efebd\\opt\\bin\\Scripts\\west.exe": "1.4.0",
        "D:\\ncs\\toolchains\\b8b84efebd\\opt\\bin\\python.exe": "3.12.4",
        "D:\\ncs\\toolchains\\b8b84efebd\\opt\\bin\\ninja.exe": "1.10.2",
        "D:\\ncs\\toolchains\\b8b84efebd\\opt\\bin\\gperf.exe": "3.1",
        "D:\\ncs\\toolchains\\b8b84efebd\\opt\\bin\\dtc.exe": "1.4.7",
        "D:\\ncs\\toolchains\\b8b84efebd\\opt\\bin\\gn.exe": "2223",
        "D:\\ncs\\toolchains\\b8b84efebd\\mingw64\\bin\\git.exe": "git version 2.37.3.",
        "debugger (arm)": "d:\\ncs\\toolchains\\b8b84efebd\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe",
        "debugger (riscv)": "d:\\ncs\\toolchains\\b8b84efebd\\opt\\zephyr-sdk\\riscv64-zephyr-elf\\bin\\riscv64-zephyr-elf-gdb.exe"
      },
      "nrfutil": {
        "nrfutil-device": {
          "version": "2.13.1",
          "binPath": "c:\\Users\\XXXXXX\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2025.9.798-win32-x64\\platform\\nrfutil\\bin\\nrfutil-device",
          "jlinkInfo": {
            "description": "This version of SEGGER J-Link is different from the J-Link version that was used to test nrfutil device commands",
            "expectedVersion": {
              "version": "JLink_V8.60",
              "versionFormat": "string"
            },
            "name": "JlinkARM",
            "version": "JLink_V8.84",
            "versionFormat": "string"
          }
        },
        "nrfutil-sdk-manager": {
          "version": "1.6.2",
          "binPath": "c:\\Users\\XXXXXX\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2025.9.798-win32-x64\\platform\\nrfutil\\bin\\nrfutil-sdk-manager"
        }
      },

    In the generated support information above, JLink.exe ver8.84 is auto-searched after the installation.

  • I think that nrfutil will find JLink as long as JLink is in the PATH. 
    If you try to move JLink to your user-space, and then update windows Environement Variables to point to its install location, that might work.
    Could you try this and let me know how it goes?

  • I tried to add a newer JLink (v8.86) to my user-space, however, the vscode didn't recognize it.

    So I ended up installing the Jlink (v8.86) to under the "C:\\Program Files\SEGGER\" and it worked OK.

    Thank you.

Related