GDB exited unexpectedly with exit code 253 (0xFD).

Dear colleagues,  I am using the Nordic nrF9151-DK as part of exercise1, lesson 2 of the intermediate Devacademy course.  Lesson 2 is about trying and using the various vscode/nRF-Extension Pack debugger features.  

Build configuration is set as follows:

SDK:  Zephyr v4.1.99

Toolchain: nRF Connect SDK Toolchain v3.0.2

Board target:  nrf9151dk/nrf9151/ns

Optimization level:  Optimize for debugging (-Og)

After the build files are generated, it looks like this:

After selecting "debug", which should burn the build on the board and begin debugging it, I get the following error message: 

Just as a side note, this appears to be a problem with the debugger.  I have not had problems flashing code to this board. 

Here is my nrf-connect-support-20250610154243.jsonc file:

// IMPORTANT: The following data can contain sensitive or confidential information about your environment.
// If you do not want others to see this information, make sure to remove it before sharing the data.

// For help and support, visit Nordic Semiconductor's DevZone at https://devzone.nordicsemi.com/.

{
  "platform": {
    "os": "linux",
    "osVersion": "#63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 19:00:15 UTC 2",
    "osKernel": "6.8.0-60-generic",
    "vscode": "1.100.3",
    "electron": "34.5.1",
    "node": "v20.19.0",
    "name": "Ubuntu",
    "id": "ubuntu",
    "version": "22.04.4 LTS (Jammy Jellyfish)",
    "versionId": "22.04"
  },
  "system": {
    "date": "2025-06-10T15:42:34.805Z",
    "vscodeRoot": "/usr/share/code/resources/app",
    "nrfConnectForDesktopInstalled": "unknown",
    "vscodeUptime": "00:13:09",
    "osUptime": "00:28:53",
    "cpu": "Intel(R) Core(TM) i3-1005G1 CPU @ 1.20GHz"
  },
  "workspace": {
    "name": "l2_e1",
    "workspaceFile": null,
    "folders": [
      "/home/user/zephyrproject/l2_e1"
    ]
  },
  "sdks": [
    {
      "version": "v4.1.99",
      "path": "/home/user/zephyrproject"
    }
  ],
  "activeBuild": "/home/user/zephyrproject/l2_e1/build",
  "apps": [
    {
      "workspace": "/home/user/zephyrproject/l2_e1",
      "uri": "/home/user/zephyrproject/l2_e1",
      "buildConfigurations": [
        {
          "id": "/home/user/zephyrproject/l2_e1/build",
          "name": "build",
          "boardId": "nrf9151dk/nrf9151/ns",
          "type": "Zephyr",
          "isChild": false,
          "isStale": false,
          "taskBindings": {
            "build": [],
            "pristineBuild": [],
            "flash": [],
            "eraseAndFlash": []
          },
          "sdk": "/home/user/zephyrproject",
          "toolchain": "nRF Connect SDK Toolchain v3.0.2"
        }
      ]
    }
  ],
  "toolchains": [
    {
      "version": "3.0.2",
      "path": "/home/user/ncs/toolchains/7cbc0036f4"
    },
    {
      "version": "0.17.0",
      "path": "/home/user/zephyr-sdk-0.17.0"
    }
  ],
  "connectedDevices": [
    {
      "serialNumber": "001051221768",
      "boardVersion": "PCA10171",
      "deviceFamily": "NRF91_FAMILY",
      "deviceVersion": "NRF9151_xxAA_REV3",
      "jlinkObFirmwareVersion": "J-Link OB-nRF5340-NordicSemi compiled Apr 11 2024 17:44:26",
      "protectionStatus": "NRFDL_PROTECTION_STATUS_NONE",
      "protectionStatusCore": "NRFDL_DEVICE_CORE_APPLICATION"
    }
  ],
  "tools": {
    "/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.17.0",
    "/opt/SEGGER/JLink/JLinkExe": "7.94e",
    "/usr/local/bin/nrfjprog": "10.24.2",
    "/home/user/nordic/nrfutil": "8.0.0",
    "/home/user/ncs/toolchains/7cbc0036f4/usr/local/bin/cmake": "3.21.0",
    "/home/user/ncs/toolchains/7cbc0036f4/usr/local/bin/west": "1.2.0",
    "/home/user/ncs/toolchains/7cbc0036f4/usr/local/bin/python3": "3.12.4",
    "/home/user/ncs/toolchains/7cbc0036f4/usr/local/bin/ninja": "1.10.2",
    "/home/user/ncs/toolchains/7cbc0036f4/usr/bin/gperf": "3.1",
    "/home/user/ncs/toolchains/7cbc0036f4/usr/bin/dtc": "1.5.0",
    "/home/user/ncs/toolchains/7cbc0036f4/opt/bin/gn": "2132",
    "/home/user/ncs/toolchains/7cbc0036f4/usr/local/bin/git": "2.37.3",
    "arm-gdbPath": "/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb",
    "riscv-gdbPath": "/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gdb"
  },
  "nrfutil": {
    "nrfutil-device": {
      "version": "2.8.8",
      "binPath": "/home/user/.vscode/extensions/nordic-semiconductor.nrf-connect-2025.5.152-linux-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.18",
          "versionFormat": "string"
        },
        "name": "JlinkARM",
        "version": "JLink_V7.94e",
        "versionFormat": "string"
      }
    },
    "nrfutil-sdk-manager": {
      "version": "1.3.0",
      "binPath": "/home/user/.vscode/extensions/nordic-semiconductor.nrf-connect-2025.5.152-linux-x64/platform/nrfutil/bin/nrfutil-sdk-manager"
    }
  },
  "environment": {
    "westEnv": {
      "GIT_EXEC_PATH": "/home/user/ncs/toolchains/7cbc0036f4/usr/local/libexec/git-core",
      "HOME": "/home/user",
      "PATH": "/home/user/ncs/toolchains/7cbc0036f4/usr/bin:/home/user/ncs/toolchains/7cbc0036f4/usr/bin:/home/user/ncs/toolchains/7cbc0036f4/usr/local/bin:/home/user/ncs/toolchains/7cbc0036f4/opt/bin:/home/user/ncs/toolchains/7cbc0036f4/opt/nanopb/generator-bin:/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/arm-zephyr-eabi/bin:/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk/riscv64-zephyr-elf/bin:/home/user/.local/bin:/home/user/zephyrproject/zephyr:/home/user/nordic:/opt/nrf-command-line-tools:/usr/bin:/bin:/home/user/.local/bin:/usr/bin/git:/bin:/usr/bin:/opt/st/stm32cubeclt_1.18.0:/opt/st/stm32cubeclt_1.18.0/STM32CubeProgrammer/bin:/opt/st/stm32cubeclt_1.18.0/STLink-gdb-server/bin:/opt/st/stm32cubeclt_1.18.0/CMake/bin:/opt/st/stm32cubeclt_1.18.0/Ninja/bin:/opt/st/stm32cubeclt_1.18.0/GNU-tools-for-STM32/bin:/home/user/.local/bin:/opt/st/stm32cubeclt_1.18.0:/opt/st/stm32cubeclt_1.18.0/STM32CubeProgrammer/bin:/opt/st/stm32cubeclt_1.18.0/STLink-gdb-server/bin:/opt/st/stm32cubeclt_1.18.0/CMake/bin:/opt/st/stm32cubeclt_1.18.0/Ninja/bin:/opt/st/stm32cubeclt_1.18.0/GNU-tools-for-STM32/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/user:/snap/bin:/snap/bin:/home/user/.local/bin:/home/user/zephyrproject/zephyr:/home/user/nordic:/opt/nrf-command-line-tools:/usr/bin:/bin:/home/user/.local/bin:/usr/bin/git:/bin:/usr/bin:/opt/st/stm32cubeclt_1.18.0:/opt/st/stm32cubeclt_1.18.0/STM32CubeProgrammer/bin:/opt/st/stm32cubeclt_1.18.0/STLink-gdb-server/bin:/opt/st/stm32cubeclt_1.18.0/CMake/bin:/opt/st/stm32cubeclt_1.18.0/Ninja/bin:/opt/st/stm32cubeclt_1.18.0/GNU-tools-for-STM32/bin:/home/user/.local/bin:/opt/st/stm32cubeclt_1.18.0:/opt/st/stm32cubeclt_1.18.0/STM32CubeProgrammer/bin:/opt/st/stm32cubeclt_1.18.0/STLink-gdb-server/bin:/opt/st/stm32cubeclt_1.18.0/CMake/bin:/opt/st/stm32cubeclt_1.18.0/Ninja/bin:/opt/st/stm32cubeclt_1.18.0/GNU-tools-for-STM32/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/user:/snap/bin:/snap/bin",
      "ZEPHYR_BASE": "/home/user/zephyrproject/zephyr",
      "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
      "ZEPHYR_SDK_INSTALL_DIR": "/home/user/ncs/toolchains/7cbc0036f4/opt/zephyr-sdk",
      "PYTHONPATH": "/home/user/ncs/toolchains/7cbc0036f4/usr/local/lib/python3.12:/home/user/ncs/toolchains/7cbc0036f4/usr/local/lib/python3.12/site-packages",
      "USER": "user"
    },
    "inherited": {
      "ELECTRON_RUN_AS_NODE": "1",
      "HOME": "/home/user",
      "PATH": "/home/user/.local/bin:/home/user/zephyrproject/zephyr:/home/user/nordic:/opt/nrf-command-line-tools:/usr/bin:/bin:/home/user/.local/bin:/usr/bin/git:/bin:/usr/bin:/opt/st/stm32cubeclt_1.18.0:/opt/st/stm32cubeclt_1.18.0/STM32CubeProgrammer/bin:/opt/st/stm32cubeclt_1.18.0/STLink-gdb-server/bin:/opt/st/stm32cubeclt_1.18.0/CMake/bin:/opt/st/stm32cubeclt_1.18.0/Ninja/bin:/opt/st/stm32cubeclt_1.18.0/GNU-tools-for-STM32/bin:/home/user/.local/bin:/opt/st/stm32cubeclt_1.18.0:/opt/st/stm32cubeclt_1.18.0/STM32CubeProgrammer/bin:/opt/st/stm32cubeclt_1.18.0/STLink-gdb-server/bin:/opt/st/stm32cubeclt_1.18.0/CMake/bin:/opt/st/stm32cubeclt_1.18.0/Ninja/bin:/opt/st/stm32cubeclt_1.18.0/GNU-tools-for-STM32/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/user:/snap/bin:/snap/bin",
      "USER": "user"
    }
  },
  "terminal": {
    "defaultProfile": null
  },
  "config": {
    "nordic-semiconductor.nrf-connect": {
      "topdir": "",
      "toolchain": {
        "path": ""
      },
      "ozonePath": "",
      "applications": [],
      "applicationOptions": {},
      "kconfig": {
        "interface": "kconfig"
      },
      "west": {
        "env": {
          "$base": "terminal"
        }
      },
      "boardRoots": [],
      "taskBindings": {},
      "buildTerminal": {
        "condensedProgress": true
      },
      "debugging": {
        "flash": true,
        "bindings": {},
        "justMyCode": false
      },
      "activeAppFollowActiveEditor": true,
      "flash": {
        "softreset": false,
        "erase": false,
        "recover": false
      },
      "enableTelemetry": false,
      "thirdpartyIntegration": {},
      "toolchainManager": {
        "indexURL": null,
        "installDirectory": null
      },
      "nrfutil": {
        "home": null
      },
      "defaultOpenAction": "ask",
      "terminalProfile": {
        "shell": null
      }
    },
    "nordic-semiconductor.nrf-terminal": {
      "terminalMode": "character"
    }
  },
  "extensions": {
    "internal": {
      "nordic-semiconductor.nrf-connect": {
        "version": "2025.5.152",
        "path": "/home/user/.vscode/extensions/nordic-semiconductor.nrf-connect-2025.5.152-linux-x64",
        "isActive": true
      },
      "nordic-semiconductor.nrf-terminal": {
        "version": "2024.9.14",
        "path": "/home/user/.vscode/extensions/nordic-semiconductor.nrf-terminal-2024.9.14",
        "isActive": true
      },
      "nordic-semiconductor.nrf-devicetree": {
        "version": "2025.4.22",
        "path": "/home/user/.vscode/extensions/nordic-semiconductor.nrf-devicetree-2025.4.22",
        "isActive": true
      },
      "nordic-semiconductor.nrf-kconfig": {
        "version": "2025.4.26",
        "path": "/home/user/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2025.4.26",
        "isActive": true
      }
    },
    "external": {
      "marus25.cortex-debug": null,
      "ms-vscode.cpptools": "1.25.3",
      "ms-vscode.js-debug": "1.100.1",
      "ms-vscode.js-debug-companion": "1.1.3",
      "ms-vscode.vscode-js-profile-table": "1.0.10",
      "ms-vscode.cmake-tools": "1.20.53",
      "ms-vscode.cpptools-extension-pack": "1.3.1",
      "ms-vscode.cpptools-themes": "2.0.0",
      "trond-snekvik.gnu-mapfiles": "1.1.0"
    }
  }
}

I would appreciate any help you could provide on this.

Thank you,

sonic4

  • Dear Colleagues,

    Strangely, I got a sort-of workaround going today.  I upversioned to JLink V810i (nrf-connect wanted V794i).  Then, after building with "Optimize for debugging (-Og) enabled in the configuration, I edited bootutil_misc.c to correct line 153.  A problem with this file is shown in the "problems" window:   implicit declaration of function 'flash area_get_sector'; did you mean 'flash_area_get_sectors'?[-Wimplicit-function-declaration] gcc [Ln 153, Col 15]

    I simply edited the file inline and hit "debug", the trusted firmware version flashed and now I am proceeding with the lesson. I did not rebuild.

    I believe this will be a consistent problem with each future "debugging enabled" build, since bootutil_misc.c appears to be generated as part of the build.

    At least I can proceed with this lesson, though and seem to have identified a temporary workaround. It will be interesting to see what happens the next time I have to use the debugger-- or the next time I start VS.

    Thanks,  sonic4

  • ...as expected, the "workaround" I described above only worked to get me through assignment 1 in lesson 2 of the Nordic Devacademy intermediate course.  Opening a new ticket for the "issue" that is occuring with assignment 2 in lesson 2.  This making me hanker for an IDE that is less-ambitious in its functionality, but way-more reliable and transparent. Most of the time I'm doing on this course is figuring out workarounds with VSCode.  Trying to build lesson 2 of assigment 2 of the Nordic Devacademy intermediate class with an nRF9151-Dk.  On to the next ticket...

    sonic4

  • Hi Sonic4,

    Seems liike there are two issues that you are seeing. The debugger seeems to be failing mostly due to the target voltage being low or not detected which could be a hardware or USB issue.

    The second problem seems to be that your TFM generated files seems to use an outdate function (flash_area_get_sector) which might not be available in the SDK version you are using. Are you sure you are using the same SDK version suggested in the lesson?

  • Hi, I have the same problem. I had to roll back to 2.9.x to get it to work.

    Today I tried on a different pc (windows 10), with clean SDK 3.0.2 and only debugging a blinky on nrf9151dk.

    I have the same issue while debugging with J-Link Base debugger.



    Please check power, connection and settings.
    "C:\Program Files\SEGGER\JLink_V794i\JLinkGDBServerCL.exe" exited with code -3 (0xFFFFFFFD).


    Please take a closer look at this, seems to be an issue with nRF9151 and SDK 3.0.2.

    debugging nRF5340 on SDK 3.0.2 works fine, I only have issues on the nRF9151

  • Thanks for the info Simen, 

    Since more than one is having this issue, I will try to get help to investigate this internally. Seems like an issue in our solution but if it is in the SDK or VSC is unclear for now until we dive in a bit deeper. The response internally will be a bit slower these coming 3 weeks due to summer holidays in Norway. But if I get an update sooner I will revert here after that.

Related