Can't launch debugger for custom board

Hello,

I have been able to successfully use the debugger in nRF Connect for VS Code for the nRF 5340DK. But now I am using a custom board (with a 5340 SOC) and when I try to launch the debugger the same way as with the DK, I am shown the following VS Code error. 

This is what is in the launch.json file, I have two builds, one being "optimised for debugging".

{
	"version": "0.2.0",
	"configurations": [
		{
			"type": "nrf-connect",
			"request": "launch",
			"name": "Launch build_debug",
			"config": "${workspaceFolder}/build_debug",
			"runToEntryPoint": "main",
			"logging": {
				"programOutput": true,
				"engineLogging": true,
				"trace": false,
				"traceResponse": false
			}
		},
		{
			"type": "nrf-connect",
			"request": "launch",
			"name": "Launch build",
			"config": "${workspaceFolder}/build",
			"runToEntryPoint": "main"
		}
	]
}

The debug console outputs the following error, but I can't find any reference to what a code 42 might relate to.

The program 'c:/_Workspace/Folder/SubFolder/build/zephyr/zephyr.elf' has exited with code 42 (0x0000002a).

Posting publicly here in case anyone else has had a similar issue and been able to resolve it, my Googling hasn't got me very far in trying to fix the debugger. 

Thanks

  • Hi, I've attached the log in the .txt file.

    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.22631",
        "vscode": "1.86.2",
        "electron": "27.2.3",
        "node": "v18.17.1"
      },
      "system": {
        "date": "2024-02-27T13:56:48.306Z",
        "vscodeRoot": "c:\\Users\\tbischiniotis\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:09:42",
        "osUptime": "170:06:36",
        "cpu": "12th Gen Intel(R) Core(TM) i7-12700H"
      },
      "workspace": {
        "name": "debugTest",
        "workspaceFile": null,
        "folders": [
          "c:\\_Workspace\\TDL01\\debugTest"
        ]
      },
      "sdks": [
        {
          "version": "v2.5.2",
          "path": "c:\\ncs\\v2.5.2"
        },
        {
          "version": "v2.4.1",
          "path": "c:\\ncs\\v2.4.1"
        }
      ],
      "activeBuild": "c:\\_Workspace\\TDL01\\debugTest\\build",
      "apps": [
        {
          "workspace": "c:\\_Workspace\\TDL01\\debugTest",
          "uri": "c:\\_Workspace\\TDL01\\debugTest",
          "buildConfigurations": [
            {
              "id": "c:\\_Workspace\\TDL01\\debugTest\\build",
              "name": "build",
              "boardId": "tdl01",
              "type": "Zephyr",
              "isChild": false,
              "isStale": false,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        }
      ],
      "topdir": "c:\\ncs\\v2.5.2",
      "workspaceState": "freestanding-ready",
      "toolchains": [
        {
          "version": "2.5.2",
          "path": "c:\\ncs\\toolchains\\c57af46cb7"
        },
        {
          "version": "2.4.1",
          "path": "c:\\ncs\\toolchains\\31f4403e35"
        }
      ],
      "connectedDevices": [
        {
          "serialNumber": "000519002001"
        }
      ],
      "deviceProvider": "nrfutil",
      "tools": {
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.16.1",
        "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.94e",
        "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.24.0",
        "nrfutil": "Not found",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\cmake.exe": "3.20.5",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Scripts\\west.exe": "1.1.0",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\python.exe": "3.8.2",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\ninja.exe": "1.9.0",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\gperf.exe": "3.1",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\dtc.exe": "1.4.7",
        "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\gn.exe": "2122",
        "C:\\ncs\\toolchains\\c57af46cb7\\mingw64\\bin\\git.exe": "2.37.3.windows.1",
        "gdbPath": "c:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe"
      },
      "nrfutil": {
        "nrfutil-device": {
          "version": "2.0.0",
          "binPath": "c:\\Users\\tbischiniotis\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\bin\\nrfutil-device"
        },
        "nrfutil-toolchain-manager": {
          "version": "0.14.1",
          "binPath": "c:\\Users\\tbischiniotis\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\bin\\nrfutil-toolchain-manager"
        }
      },
      "environment": {
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\tbischiniotis",
          "HOMEDRIVE": "K:",
          "HOMEPATH": "\\",
          "PATH": "C:\\ncs\\toolchains\\c57af46cb7;C:\\ncs\\toolchains\\c57af46cb7\\mingw64\\bin;C:\\ncs\\toolchains\\c57af46cb7\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Scripts;C:\\ncs\\toolchains\\c57af46cb7\\opt\\nanopb\\generator-bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\aarch64-zephyr-elf\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\x86_64-zephyr-elf\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;c:\\Users\\tbischiniotis\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\lib\\nrfutil-toolchain-manager;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\PuTTY\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\TortoiseSVN\\bin;C:\\Users\\tbischiniotis\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\tbischiniotis\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\tbischiniotis\\AppData\\Local\\Programs\\Git\\cmd",
          "ZEPHYR_BASE": "c:\\ncs\\v2.5.2\\zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk",
          "PYTHONPATH": "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Lib;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Lib\\site-packages"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\tbischiniotis",
          "HOMEDRIVE": "K:",
          "HOMEPATH": "\\",
          "Path": "C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\PuTTY\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\TortoiseSVN\\bin;C:\\Users\\tbischiniotis\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\tbischiniotis\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\tbischiniotis\\AppData\\Local\\Programs\\Git\\cmd",
          "PATH": "C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\PuTTY\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\TortoiseSVN\\bin;C:\\Users\\tbischiniotis\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\tbischiniotis\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\tbischiniotis\\AppData\\Local\\Programs\\Git\\cmd"
        },
        "toolchainPath": "c:\\ncs\\toolchains\\c57af46cb7",
        "toolchainBinPath": "c:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
        "toolchainVersion": "2.5.2"
      },
      "terminal": {
        "defaultProfile": null
      },
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "",
          "toolchain": {
            "path": ""
          },
          "ozonePath": "",
          "applications": [],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig"
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [
            "C:\\my_boards"
          ],
          "taskBindings": {},
          "debugging": {
            "flash": true,
            "bindings": {
              "${workspaceFolder}/build": "Launch build"
            },
            "justMyCode": true
          },
          "activeAppFollowActiveEditor": true,
          "deviceProvider": "",
          "flash": {
            "softreset": false,
            "erase": false,
            "recover": false
          },
          "enableTelemetry": false,
          "thirdpartyIntegration": {},
          "toolchainManager": {
            "indexURL": null,
            "installDirectory": null
          },
          "nrfutil": {
            "home": null
          },
          "defaultOpenAction": "ask"
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        }
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2023.11.301",
            "path": "c:\\Users\\tbischiniotis\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2023.10.17",
            "path": "c:\\Users\\tbischiniotis\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2023.10.17",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2023.11.120",
            "path": "c:\\Users\\tbischiniotis\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2023.11.120",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2023.11.64",
            "path": "c:\\Users\\tbischiniotis\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2023.11.64",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": null,
          "ms-vscode.cpptools": "1.19.4",
          "ms-vscode.js-debug": "1.86.1",
          "ms-vscode.js-debug-companion": "1.1.2",
          "ms-vscode.vscode-js-profile-table": "1.0.8",
          "ms-vscode.cmake-tools": "1.17.16",
          "ms-vscode.cpptools-extension-pack": "1.3.0",
          "ms-vscode.cpptools-themes": "2.0.0",
          "ms-vscode.vscode-serial-monitor": "0.11.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      }
    }
    
    

    Thanks again

  • Hello,

    I have asked this internally, as I am not sure what the issue is here. I will get back to you as soon as I have an update from the team.

     

    Kind Regards,

    Abhijith

  • Hello,

    We are looking into this and it should be fixed within the week.

    Kind Regards,

    Abhijith

  • Hello,

    A new version of the VScode(v2024.2.214) extension was released last week. Have you checked the release? I think this issue has been fixed with the latest release; can you check and update it here?

    Kind Regards,

    Abhijith

  • Hi, I'm indeed able to use the debugger with my custom board now! Thank you for your help

Related