nRF Connect SDK Intermediate Lesson 1 Exercise 1 Debugging Issues

Hi

This is my first time using nRF connect and Visual studio but I have been following through first the Fundamentals course on the Dev Academy using the nRF52840 DK with no issues.

However in exercise 1 of lesson 1 of the Intermediate course, when attempting to debug i do not end up in "main" function but in the file ".../zephyr/arch/arm/core/cortex_m/reset.S". I also do not have any of the functions showing in the call stack or any threads in the thread view of the NRF Debug terminal.

The code appears to run correctly if i stop debugging and i get the LEDs toggling and the terminal outputs as expected and i get the same behavior using the solution code so i assume it is something to do with my setup rather than the code itself.

I am connected to the nRF52840 DK directly via USB.

I would be grateful for an suggestions on how to go about resolving this.

Parents Reply Children
  • Hi Edvin,

    Thank you for your help, hopefully this is the correct way to upload the file, please let me know if you need anything else.

    inter_less1_exer1.zip

    Best regards,

    Tom

  • When you see the window that you are seeing, and says "No threads are available for display.", like it does in your previous screenshot. What does it say if you press "Terminal"? Can you share a screenshot of that aswell?

    And please try to make sure you selected the correct project before clicking "Debug", and that you have opened the main.c file of that project before you click "Debug". (Opened properly, by double clicking the main.c tab at the top of the screen:

    What does the terminal tab look like?

  • Here is the screenshot of the terminal window after starting debugging and having continued to the breakpoint in main():

    I only have a single project open so i dont think that has been an issue but doing as you suggest seems not to make a difference, still not threads available for display.

    Not sure if it is useful but here is the debug terminal output as well:

    Cheers,

    Tom

  • Hello Tom,

    Ok, try opening a new nRF Connect terminal by pressing the little plus sign at the far right:

    And kill all other terminals than the nRF Connect one. Then start the debug session all over. See if that helps. If not, can you please try to generate some support information:

    Save that information to a file, and upload it here. 

    TomSansome said:

    Not sure if it is useful but here is the debug terminal output as well:

    What does this say if you press the play button so that the breakpoint in main is hit? And after it is hit, does the NRF DEBUG terminal still doesn't show anything?

    BR,
    Edvin

  • Hi Edvin,

    Closing the other terminals and the opening a new nRF connect terminal does not make any difference, but it does appear to be named differently than the terminal in your screenshot. When i start a new debug session it creates a new terminal that does not start with "nRF Connect:" not sure if this matters?

    here is 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 Home",
        "osKernel": "10.0.19045",
        "vscode": "1.89.1",
        "electron": "28.2.8",
        "node": "v18.18.2"
      },
      "system": {
        "date": "2024-05-13T09:04:46.842Z",
        "vscodeRoot": "c:\\Users\\Tom Sansome\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": false,
        "vscodeUptime": "00:02:37",
        "osUptime": "00:03:51",
        "cpu": "AMD Ryzen 5 5600 6-Core Processor"
      },
      "workspace": {
        "name": "inter_less1_exer1",
        "workspaceFile": null,
        "folders": [
          "c:\\ncs\\myApps\\inter_less1_exer1"
        ]
      },
      "sdks": [
        {
          "version": "v2.6.1",
          "path": "c:\\ncs\\v2.6.1"
        }
      ],
      "activeBuild": "c:\\ncs\\myApps\\inter_less1_exer1\\build",
      "apps": [
        {
          "workspace": "c:\\ncs\\myApps\\inter_less1_exer1",
          "uri": "c:\\ncs\\myApps\\inter_less1_exer1",
          "buildConfigurations": [
            {
              "id": "c:\\ncs\\myApps\\inter_less1_exer1\\build",
              "name": "build",
              "boardId": "nrf52840dk_nrf52840",
              "type": "Zephyr",
              "isChild": false,
              "isStale": false,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        }
      ],
      "topdir": "c:\\ncs\\v2.6.1",
      "workspaceState": "freestanding-ready",
      "toolchains": [
        {
          "version": "2.6.1",
          "path": "c:\\ncs\\toolchains\\cf2149caf2"
        }
      ],
      "connectedDevices": [
        {
          "serialNumber": "001050270477"
        }
      ],
      "deviceProvider": "nrfutil",
      "tools": {
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.16.5",
        "C:\\Program Files\\SEGGER\\JLink_V796f\\JLink.exe": "7.96f",
        "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.24.2",
        "nrfutil": "Not found",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\cmake.exe": "3.21.0",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\Scripts\\west.exe": "1.2.0",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\python.exe": "3.9.13",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\ninja.exe": "1.10.2",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\gperf.exe": "3.1",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\dtc.exe": "1.4.7",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\gn.exe": "2154",
        "C:\\ncs\\toolchains\\cf2149caf2\\mingw64\\bin\\git.exe": "2.37.3.windows.1",
        "gdbPath": "c:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe"
      },
      "nrfutil": {
        "nrfutil-device": {
          "version": "2.0.0",
          "binPath": "c:\\Users\\Tom Sansome\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64\\platform\\nrfutil\\bin\\nrfutil-device"
        },
        "nrfutil-toolchain-manager": {
          "version": "0.14.1",
          "binPath": "c:\\Users\\Tom Sansome\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64\\platform\\nrfutil\\bin\\nrfutil-toolchain-manager"
        }
      },
      "environment": {
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\Tom Sansome",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\Tom Sansome",
          "PATH": "C:\\ncs\\toolchains\\cf2149caf2;C:\\ncs\\toolchains\\cf2149caf2\\mingw64\\bin;C:\\ncs\\toolchains\\cf2149caf2\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\Scripts;C:\\ncs\\toolchains\\cf2149caf2\\opt\\nanopb\\generator-bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\aarch64-zephyr-elf\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\x86_64-zephyr-elf\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\riscv64-zephyr-elf\\bin;c:\\Users\\Tom Sansome\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64\\platform\\nrfutil\\lib\\nrfutil-toolchain-manager;C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.8.10-hotspot\\bin;C:\\Program Files\\Microsoft MPI\\Bin\\;C:\\SIMULIA\\Commands;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\110\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\120\\DTS\\Binn\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\MATLAB\\R2016a\\bin;C:\\Program Files\\Calibre2\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\SIMULIA\\Abaqus\\Commands;C:\\Program Files\\Elmer 8.4-Release\\bin;C:\\Program Files\\PuTTY\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Users\\Tom Sansome\\AppData\\Local\\Programs\\Python\\Python310;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Tom Sansome\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files (x86)\\FAHClient;C:\\Users\\Tom Sansome\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "ZEPHYR_BASE": "c:\\ncs\\v2.6.1\\zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk",
          "PYTHONPATH": "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\Lib;C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\Lib\\site-packages"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\Tom Sansome",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\Tom Sansome",
          "Path": "C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.8.10-hotspot\\bin;C:\\Program Files\\Microsoft MPI\\Bin\\;C:\\SIMULIA\\Commands;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\110\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\120\\DTS\\Binn\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\MATLAB\\R2016a\\bin;C:\\Program Files\\Calibre2\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\SIMULIA\\Abaqus\\Commands;C:\\Program Files\\Elmer 8.4-Release\\bin;C:\\Program Files\\PuTTY\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Users\\Tom Sansome\\AppData\\Local\\Programs\\Python\\Python310;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Tom Sansome\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files (x86)\\FAHClient;C:\\Users\\Tom Sansome\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "PATH": "C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.8.10-hotspot\\bin;C:\\Program Files\\Microsoft MPI\\Bin\\;C:\\SIMULIA\\Commands;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\110\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\120\\DTS\\Binn\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\MATLAB\\R2016a\\bin;C:\\Program Files\\Calibre2\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\SIMULIA\\Abaqus\\Commands;C:\\Program Files\\Elmer 8.4-Release\\bin;C:\\Program Files\\PuTTY\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Users\\Tom Sansome\\AppData\\Local\\Programs\\Python\\Python310;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Tom Sansome\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files (x86)\\FAHClient;C:\\Users\\Tom Sansome\\AppData\\Local\\Programs\\Microsoft VS Code\\bin"
        },
        "toolchainPath": "c:\\ncs\\toolchains\\cf2149caf2",
        "toolchainBinPath": "c:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
        "toolchainVersion": "2.6.1"
      },
      "terminal": {
        "defaultProfile": null
      },
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:2.6.1}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:2.6.1}"
          },
          "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": false,
          "thirdpartyIntegration": {},
          "toolchainManager": {
            "indexURL": null,
            "installDirectory": null
          },
          "nrfutil": {
            "home": null
          },
          "defaultOpenAction": "ask",
          "welcome": {
            "showOnStartup": false
          }
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        }
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2024.3.25",
            "path": "c:\\Users\\Tom Sansome\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2024.3.15",
            "path": "c:\\Users\\Tom Sansome\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2024.3.15",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2024.3.78",
            "path": "c:\\Users\\Tom Sansome\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2024.3.78",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2024.3.21",
            "path": "c:\\Users\\Tom Sansome\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2024.3.21",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": null,
          "ms-vscode.cpptools": "1.20.5",
          "ms-vscode.js-debug": "1.89.0",
          "ms-vscode.js-debug-companion": "1.1.2",
          "ms-vscode.vscode-js-profile-table": "1.0.9",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      }
    }
    
    

    What does this say if you press the play button so that the breakpoint in main is hit? And after it is hit, does the NRF DEBUG terminal still doesn't show anything?

    I had continued to the breakpoint in main() in the previous screenshot (the breakpoint was not right at the start of main() but it makes no difference where i place it in main(). The NRF DEBUG window still shows no threads available at this breakpoint.

    Many thanks,

    Tom

Related