J-Link Base not showing anything and debug not working VS Code

Hi,

I am currently developing a software for a custom board with nRF9160 chip.

The code is tested and works on nrf9160DK. The debugging works and the device is showing all information from logs.

The problem comes when I move to my custom board and I try to upload code from my J-Link Base.

There the code uploads but you cannot see any log information on the port of the J-Link.

Also when I try to debug the code I get the following message:

and I cannot seem to fix it.

For trying to see the log I go to NRF Terminal, select the COM port that the device is on and choose 115200 8n1.

Also tried with putty with 9600 but still the connection is established but nothing comes on the screen,

Any suggestions on why the J-Link is not functioning as intended?

Parents Reply
  • I did that but I get the same error.

    The error tells me to open launch.json file but that is it.

    Here is my launch.js file I don't know what to look in it.

    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "(gdb) Launch",
                "type": "cppdbg",
                "request": "launch",
                "program": "enter program name, for example ${workspaceFolder}/a.exe",
                "args": [],
                "stopAtEntry": false,
                "cwd": "${fileDirname}",
                "environment": [],
                "externalConsole": false,
                "MIMode": "gdb",
                "miDebuggerPath": "/path/to/gdb",
                "setupCommands": [
                    {
                        "description": "Enable pretty-printing for gdb",
                        "text": "-enable-pretty-printing",
                        "ignoreFailures": true
                    }
                ]
            },
            {
                "type": "nrf-connect",
                "request": "launch",
                "name": "Launch build",
                "config": "${workspaceFolder}/build",
                "runToEntryPoint": "main"
            }
        ]
    }

Children
  • Hi.

    The second part of your file is pointing to a workspace build folder.

    Can you share where you're entering debug mode from? Here's where I'm selecting my project and entering debug:

     

    Can you please press "CTRL + shift + p" and write "nrf connect generate support information" and run that? This should print out all your environment details in the "OUTPUT". Please copy this and share it.

     

    Kind regards,

    Håkon

  • I am entering debug mode the same way as you are.

    Here are the results from the support information:

    IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.
    
    For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "win32",
        "osVersion": "Windows 10 Pro",
        "osKernel": "10.0.19041",
        "vscode": "1.74.3",
        "electron": "19.1.8",
        "node": "v16.14.2"
      },
      "system": {
        "date": "2023-01-17T07:28:30.519Z",
        "vscodeRoot": "c:\\Users\\SvetoslavAnev\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:08:11",
        "osUptime": "00:18:44",
        "cpu": {
          "model": "Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz",
          "speed": "1992 MHz",
          "count": 4
        },
        "memory": {
          "total": "15.88 GB",
          "free": "8.39 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1670502190484",
        "folders": [
          "c:\\Users\\SvetoslavAnev\\tests\\aws",
          "c:\\Users\\SvetoslavAnev\\tests\\at",
          "c:\\Users\\SvetoslavAnev\\tests\\at_monitor"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.11.140",
            "path": "c:\\Users\\SvetoslavAnev\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.11.140-win32-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.11.29",
            "path": "c:\\Users\\SvetoslavAnev\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.11.29",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2022.11.153",
            "path": "c:\\Users\\SvetoslavAnev\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2022.11.153",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2022.11.50",
            "path": "c:\\Users\\SvetoslavAnev\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2022.11.50",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": "1.6.9",
          "ms-vscode.cpptools": "1.14.0",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.18",
          "ms-vscode.js-debug": "1.74.1",
          "ms-vscode.js-debug-companion": "1.0.18",
          "ms-vscode.vscode-js-profile-table": "1.0.3",
          "bibhasdn.git-easy": "1.11.0",
          "cschlosser.doxdocgen": "1.4.0",
          "eamodio.gitlens": "13.2.0",
          "GitHub.vscode-pull-request-github": "0.56.0",
          "jeff-hykin.better-cpp-syntax": "1.17.2",
          "mcu-debug.debug-tracker-vscode": "0.0.13",
          "mcu-debug.memory-view": "0.0.18",
          "mcu-debug.rtos-views": "0.0.3",
          "ms-python.isort": "2022.8.0",
          "ms-python.python": "2022.20.2",
          "ms-python.vscode-pylance": "2023.1.20",
          "ms-toolsai.jupyter": "2022.11.1003412109",
          "ms-toolsai.jupyter-keymap": "1.0.0",
          "ms-toolsai.jupyter-renderers": "1.0.12",
          "ms-toolsai.vscode-jupyter-cell-tags": "0.1.6",
          "ms-toolsai.vscode-jupyter-slideshow": "0.1.5",
          "ms-vscode-remote.remote-containers": "0.266.1",
          "ms-vscode-remote.remote-ssh": "0.94.0",
          "ms-vscode-remote.remote-ssh-edit": "0.84.0",
          "ms-vscode-remote.remote-wsl": "0.72.0",
          "ms-vscode.cmake-tools": "1.12.27",
          "ms-vscode.cpptools-extension-pack": "1.3.0",
          "ms-vscode.cpptools-themes": "2.0.0",
          "ms-vscode.remote-explorer": "0.0.3",
          "ms-vsliveshare.vsliveshare": "1.0.5803",
          "ms-vsliveshare.vsliveshare-audio": "0.1.91",
          "redjue.git-commit-plugin": "1.1.2",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9.2.1",
        "C:\\Program Files (x86)\\SEGGER\\JLink\\JLink.exe": "7.80c",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.18.1",
        "nrfutil": "Not found",
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.11.1",
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\gn.exe": "1937",
        "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1",
        "gdbPath": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\arm-none-eabi-gdb.exe"
      },
      "sdks": [
        {
          "version": "1.7.0",
          "path": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0"
        }
      ],
      "toolchains": [
        {
          "version": "1.7.0",
          "path": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain"
        }
      ],
      "connectedDevices": [
        {
          "serialNumber": "51011598"
        },
        {
          "serialNumber": "960072282"
        }
      ],
      "deviceProviders": [
        "nrfjprog"
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.7.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.7.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}",
            "c:\\Users\\SvetoslavAnev\\tests\\at_monitor",
            "c:\\Users\\SvetoslavAnev\\tests\\at"
          ],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig",
            "executeInDefaultShell": false
          },
          "welcome": {
            "showOnStartup": true
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": false,
          "taskBindings": {},
          "debugging": {
            "backend": "nRF Debug",
            "flash": true,
            "bindings": {
              "${workspaceFolder}/build": "Launch build"
            }
          },
          "activeAppFollowActiveEditor": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character",
          "scrollBack": 1000
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": null,
          "objdumpPath": null,
          "JLinkGDBServerPath": null,
          "openocdPath": null,
          "pyocdPath": null,
          "PEGDBServerPath": null,
          "stutilPath": null,
          "stlinkPath": null,
          "stm32cubeprogrammer": null,
          "enableTelemetry": true,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true,
          "dbgServerLogfile": null,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\SvetoslavAnev",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\SvetoslavAnev",
          "Path": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\mingw64\\bin;c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\mingw64\\libexec\\git-core;c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin;c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\Scripts;C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\CMake\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\;C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\SvetoslavAnev\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\SvetoslavAnev\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Python27\\",
          "ZEPHYR_BASE": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin;c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\Lib;c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\SvetoslavAnev",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\SvetoslavAnev",
          "Path": "C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\CMake\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\;C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\SvetoslavAnev\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\SvetoslavAnev\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Python27\\",
          "PATH": "C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\CMake\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\;C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\SvetoslavAnev\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\SvetoslavAnev\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Python27\\"
        },
        "toolchainPath": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain",
        "toolchainBinPath": "c:\\Users\\SvetoslavAnev\\ncs\\v1.7.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.7.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

  • Hi,

     

    At your end, it is most likely the wrong debug configuration type is used in launch.json:

    "name": "(gdb) Launch",
    "type": "cppdbg"
    ...

    Can you try to remove that or just select the correct "nrf-connect" type when launching?

     

    Kind regards,

    Håkon

  • I tried removing this line but didn't fix the problem.

    What do you mean by selecting the correct nrf-connect type?

  • Hi,

     

    Svetlio141 said:
    What do you mean by selecting the correct nrf-connect type?

    You have two debug targets defined in your launch.json at this time.

    You can either remove the whole of:

    {
        "name": "(gdb) Launch",
        "type": "cppdbg"
        ...
    },

    And only keep the "nrf-connect" part, or select "nrf-connect" as your debug target.

    Svetlio141 said:
    I tried removing this line but didn't fix the problem.

    Is there still no output in the debug console?

     

    Kind regards,

    Håkon

Related