Debug stops before main

Hi
I'm trying to debug the record_text example in the nrf connect sdk. However when I attached my nrf5340 dk and hit debug in the nrf connect extension, the process stops in the following way (please check screenshots)

I tried using a j-link to debug instead of the dk but I get the same problem.
I also tried using a newer version of j-link gdb server and no luck

Parents
  • Hello,

    Please see Lesson 2 - Debugging and troubleshooting from the nRF Connect SDK Intermediate course on DevAcademy.

    Let me know if you are still facing issues after getting familiar with the lesson.

    Best regards,

    Maria

  • The link you provided wasn't helpful. After I hit the debug button, the FW builds and flashes okay but then execution never stops at main. Even if I put a break point it never stops

  • Hello,

    Sorry to hear that the DevAcademy link was not helpful.

    Do you see the same behaviour if you select the "Attach to debugger option" available through the three dots on the Debug action?

    If yes, please provide us with the support information generated from the VS Code extension through the headset icon:

    Best regards,

    Maria

  • I see the same behavior with "Attach to debugger option"
    Here is the support info

    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": "darwin",
        "osVersion": "Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64",
        "osKernel": "23.5.0",
        "vscode": "1.91.1",
        "electron": "29.4.0",
        "node": "v20.9.0"
      },
      "system": {
        "date": "2024-07-23T23:04:01.560Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": false,
        "vscodeUptime": "00:01:57",
        "osUptime": "06:48:11",
        "cpu": "Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz"
      },
      "workspace": {
        "name": "app",
        "workspaceFile": null,
        "folders": [
          "/Users/ha/Documents/Github/my-workspace/Anne-Aria/app"
        ]
      },
      "sdks": [
        {
          "version": "v2.6.1",
          "path": "/opt/nordic/ncs/v2.6.1"
        },
        {
          "version": "v2.6.1",
          "path": "/Users/ha/Documents/Github/my-workspace"
        }
      ],
      "activeBuild": "/Users/ha/Documents/Github/my-workspace/Anne-Aria/app/build",
      "apps": [
        {
          "workspace": "/Users/ha/Documents/Github/my-workspace/Anne-Aria/app",
          "uri": "/Users/ha/Documents/Github/my-workspace/Anne-Aria/app",
          "buildConfigurations": [
            {
              "id": "/Users/ha/Documents/Github/my-workspace/Anne-Aria/app/build",
              "name": "build",
              "boardId": "anne_aria_rev_c_cpuapp",
              "type": "Zephyr",
              "isChild": false,
              "isStale": false,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        }
      ],
      "topdir": "/Users/ha/Documents/Github/my-workspace",
      "workspaceState": "workspace-ready",
      "toolchains": [
        {
          "version": "2.6.1",
          "path": "/opt/nordic/ncs/toolchains/580e4ef81c"
        }
      ],
      "connectedDevices": [
        {
          "serialNumber": "000051017132"
        },
        {
          "serialNumber": "000051026674"
        }
      ],
      "deviceProvider": "nrfutil",
      "tools": {
        "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.16.5",
        "/Applications/SEGGER/JLink/JLinkExe": "7.94e",
        "/usr/local/bin/nrfjprog": "10.24.2",
        "/usr/local/bin/nrfutil": "7.12.0",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/cmake": "3.21.0",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/west": "1.2.0",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/python3": "3.9.6",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/ninja": "1.10.2",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/gperf": "3.1",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/dtc": "1.6.1",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/gn": "2154",
        "/opt/nordic/ncs/toolchains/580e4ef81c/bin/git": "2.37.3",
        "gdbPath": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb"
      },
      "nrfutil": {
        "nrfutil-device": {
          "version": "2.0.0",
          "binPath": "/Users/ha/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.7.13-darwin-x64/platform/nrfutil/bin/nrfutil-device"
        },
        "nrfutil-toolchain-manager": {
          "version": "0.14.4",
          "binPath": "/Users/ha/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.7.13-darwin-x64/platform/nrfutil/bin/nrfutil-toolchain-manager"
        }
      },
      "environment": {
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/opt/nordic/ncs/toolchains/580e4ef81c/Cellar/git/2.37.3/libexec/git-core",
          "HOME": "/Users/ha",
          "PATH": "/opt/nordic/ncs/toolchains/580e4ef81c/bin:/opt/nordic/ncs/toolchains/580e4ef81c/usr/bin:/opt/nordic/ncs/toolchains/580e4ef81c/usr/local/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/nanopb/generator-bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/aarch64-zephyr-elf/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/x86_64-zephyr-elf/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/riscv64-zephyr-elf/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/ARM/bin:/opt/nordic/ncs/toolchains/580e4ef81c/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/ARM/bin:/opt/nordic/ncs/toolchains/580e4ef81c/bin",
          "ZEPHYR_BASE": "/Users/ha/Documents/Github/my-workspace/zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk",
          "USER": "ha"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "/Users/ha",
          "PATH": "/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/ARM/bin:/opt/nordic/ncs/toolchains/580e4ef81c/bin",
          "USER": "ha"
        },
        "toolchainPath": "/opt/nordic/ncs/toolchains/580e4ef81c",
        "toolchainBinPath": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin",
        "toolchainVersion": "2.6.1"
      },
      "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": true
          },
          "activeAppFollowActiveEditor": true,
          "deviceProvider": "",
          "flash": {
            "softreset": false,
            "erase": false,
            "recover": false
          },
          "enableTelemetry": true,
          "thirdpartyIntegration": {},
          "toolchainManager": {
            "indexURL": null,
            "installDirectory": null
          },
          "nrfutil": {
            "home": null
          },
          "defaultOpenAction": "ask"
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "marus25.cortex-debug": {
          "variableUseNaturalFormat": true,
          "liveWatchRefreshRate": "300",
          "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,
          "dbgServerLogfile": null
        }
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2024.7.13",
            "path": "/Users/ha/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.7.13-darwin-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2024.3.15",
            "path": "/Users/ha/.vscode/extensions/nordic-semiconductor.nrf-terminal-2024.3.15",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2024.6.20",
            "path": "/Users/ha/.vscode/extensions/nordic-semiconductor.nrf-devicetree-2024.6.20",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2024.6.20",
            "path": "/Users/ha/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2024.6.20",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": "1.12.1",
          "ms-vscode.cpptools": "1.21.2",
          "ms-vscode.js-debug": "1.91.0",
          "ms-vscode.js-debug-companion": "1.1.2",
          "ms-vscode.vscode-js-profile-table": "1.0.9",
          "mcu-debug.debug-tracker-vscode": "0.0.15",
          "mcu-debug.memory-view": "0.0.25",
          "mcu-debug.peripheral-viewer": "1.4.6",
          "mcu-debug.rtos-views": "0.0.7",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      }
    }
    
    

  • Hello,

    We are not able to reproduce this issue with the current information.

    Please double check that you have configured the sample for debugging like documented in the How to debug section for the extension.

    Best regards,

    Maria

Reply Children
No Data
Related