Flash and debug fail in Visual Studio Code.

Hi,

I tried building and debugging the sample "https_client" using the method described here.
But debugging fails. Debugging stops prematurely because the source file cannot be found.

Module: nRF9160-DK
SDK: Connect SDK v2.0.0
firmware: mfw_nrf9160_1.3.2.zip

The settings and extended functions when creating the application, and the contents of the output are as follows.

Settings

extension

output

We will also send you the logs output during build, flash, and debug, so please check them.

3113.log_build.txt

Flashing build to undefined
west flash -d c:\Users\protec\Desktop\https_client\build --skip-rebuild -r nrfjprog --dev-id 960007184

-- west flash: using runner nrfjprog
-- runners.nrfjprog: Flashing file: C:\Users\protec\Desktop\https_client\build\zephyr\merged.hex
Parsing image file.
Verifying programming.
Verified OK.
Applying pin reset.
-- runners.nrfjprog: Board with serial number 960007184 flashed successfully.

Cortex-Debug: VSCode debugger extension version 1.6.0 git(3026299). Usaage info: https://github.com/Marus/cortex-debug#usage
Warn: c:/Users/protec/Desktop/https_client/build/zephyr/merged.hex is not an ELF file format. Some features won't work -- Globals, Locals, disassembly, etc.Launching GDB: "c:\\ncs\\toolchains\\v2.0.0\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb-no-py.exe" -q --interpreter=mi2
    IMPORTANT: Set "showDevDebugOutput": "raw" in "launch.json" to see verbose GDB transactions here. Very helpful to debug issues or report problems
Launching gdb-server: "C:\\Program Files (x86)\\SEGGER\\JLink\\JLinkGDBServerCL.exe" -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device nRF9160_xxAA -select usb=960007184 -rtos "C:\\Program Files (x86)\\SEGGER\\JLink\\GDBServer\\RTOSPlugin_Zephyr.dll"
    Please check TERMINAL tab (gdb-server) for output from C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe
GNU gdb (Zephyr SDK 0.14.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-host_w64-mingw32 --target=arm-zephyr-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://github.com/zephyrproject-rtos/sdk-ng/issues>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
0x0001244e in ?? ()
Program stopped, probably due to a reset and/or halt issued by debugger
add symbol table from file "c:/Users/protec/Desktop/https_client/build/zephyr/zephyr.elf"
(y or n) [answered Y; input not from terminal]
Reading symbols from c:/Users/protec/Desktop/https_client/build/zephyr/zephyr.elf...
add symbol table from file "c:/Users/protec/Desktop/https_client/build/tfm/bin/tfm_s.elf"
(y or n) [answered Y; input not from terminal]
Reading symbols from c:/Users/protec/Desktop/https_client/build/tfm/bin/tfm_s.elf...
Reading symbols from c:/Users/protec/Desktop/https_client/build/zephyr/zephyr.elf...
add symbol table from file "c:/Users/protec/Desktop/https_client/build/tfm/bin/tfm_s.elf"
(y or n) [answered Y; input not from terminal]
Reading symbols from c:/Users/protec/Desktop/https_client/build/tfm/bin/tfm_s.elf...
2
Resetting target
[New Remote target]
[New Thread 536955656]
[New Thread 536956032]
[Switching to Thread 536955840]

Thread 2 hit Temporary breakpoint 1, main () at C:/ncs/v2.0.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/cmsis_psa/main.c:130
130	    __ASM volatile(
[New Remote target]

build settings

I would be very happy if you could tell me how to solve it.

(In this state, nothing was displayed even when connected to LTE Link Monitor.)

Parents Reply Children
  • Hi Priyanka,

    The version of Cortex Debug was the latest v1.6.0.

    I changed to the previous v1.4.4, but unfortunately it didn't improve.

    Even if I debug it, it stops in the middle and I get an error "cannot open source file".

    Is my setting wrong?

  • Hi Norio,

    Is it possible to Generate Support Information and attach it here? Also, is this the only sample with which you face this issue?

    -Priyanka

  • Hi,

    How can I obtain support information?

    "Show capture in folder" in Trace Collector v1.1.2 only had empty files.

    Another sample "at_client" sent an AT command with LTE Link Monitor and confirmed that there was a response.

  • Hi,

    thank you for your answer.
    Attach 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.19044",
        "vscode": "1.70.2",
        "electron": "18.3.5",
        "node": "v16.13.2"
      },
      "system": {
        "date": "2022-08-29T00:32:13.451Z",
        "vscodeRoot": "c:\\Users\\protec\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:01:26",
        "osUptime": "444:02:21",
        "cpu": {
          "model": "Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz",
          "speed": "2304 MHz",
          "count": 4
        },
        "memory": {
          "total": "15.81 GB",
          "free": "6.47 GB"
        }
      },
      "workspace": {
        "name": "未設定 (ワークスペース)",
        "workspaceFile": "1658473311128",
        "folders": [
          "c:\\Users\\protec\\Desktop\\hello_world",
          "c:\\Users\\protec\\Desktop\\https_client",
          "c:\\Users\\protec\\Desktop\\at_client"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.7.242",
            "path": "c:\\Users\\protec\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.7.242-win32-x64",
            "isActive": false
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.7.21",
            "path": "c:\\Users\\protec\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.7.21",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2022.7.36",
            "path": "c:\\Users\\protec\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2022.7.36",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2022.7.24",
            "path": "c:\\Users\\protec\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2022.7.24",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": "1.4.4",
          "ms-vscode.cpptools": "1.11.5",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.15",
          "ms-vscode.js-debug": "1.70.0",
          "ms-vscode.js-debug-companion": "1.0.18",
          "ms-vscode.vscode-js-profile-table": "1.0.3",
          "MS-CEINTL.vscode-language-pack-ja": "1.70.8170911",
          "ms-vscode.cmake-tools": "1.11.26",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "c:\\ncs\\toolchains\\v2.0.0\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.14.1",
        "C:\\Program Files (x86)\\SEGGER\\JLink\\JLink.exe": "7.66a",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.16.0",
        "nrfutil": "Not found",
        "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\Scripts\\west.exe": "0.13.1",
        "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\python.exe": "3.8.2",
        "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\gperf.exe": "3.1",
        "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\gn.exe": "2039",
        "c:\\ncs\\toolchains\\v2.0.0\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },
      "sdks": [
        {
          "version": "2.0.0",
          "path": "c:\\ncs\\v2.0.0"
        }
      ],
      "toolchains": [
        {
          "version": "2.0.0",
          "path": {
            "$mid": 1,
            "fsPath": "c:\\ncs\\toolchains\\v2.0.0",
            "_sep": 1,
            "path": "/C:/ncs/toolchains/v2.0.0",
            "scheme": "file"
          }
        }
      ],
      "connectedDevices": [
        {
          "serialNumber": "960007184"
        }
      ],
      "deviceProviders": [
        "nrfjprog"
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:2.0.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:2.0.0}"
          },
          "ozonePath": "",
          "applications": [
            "c:\\Users\\protec\\Desktop\\https_client",
            "c:\\Users\\protec\\Desktop\\at_client"
          ],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": true
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": true,
          "taskBindings": {},
          "debugging": {
            "backend": "Cortex-Debug"
          },
          "activeAppFollowActiveEditor": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "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,
          "flattenAnonymous": false,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true,
          "dbgServerLogfile": null,
          "showRTOS": false,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\protec",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\protec",
          "Path": "c:\\ncs\\toolchains\\v2.0.0\\mingw64\\bin;c:\\ncs\\toolchains\\v2.0.0\\mingw64\\libexec\\git-core;c:\\ncs\\toolchains\\v2.0.0\\opt\\bin;c:\\ncs\\toolchains\\v2.0.0\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;c:\\ncs\\toolchains\\v2.0.0\\arm-zephyr-eabi\\bin;c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\Scripts;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\GCC for Renesas RX 8.3.0.202002-GNURX-ELF\\rx-elf\\rx-elf\\bin;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\\Microsoft SQL Server\\130\\Tools\\Binn\\;c:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C:\\Program Files\\Thorlabs\\Thorlabs OSA;C:\\Program Files\\Thorlabs\\Thorlabs OSA\\bin;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\\Thorlabs Redstone OSA;C:\\Program Files\\Thorlabs Redstone OSA\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\protec\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\protec\\.dotnet\\tools;;C:\\Users\\protec\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "ZEPHYR_BASE": "c:\\ncs\\v2.0.0\\zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "c:\\ncs\\toolchains\\v2.0.0\\opt\\zephyr-sdk",
          "PYTHONPATH": "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin;c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\Lib;c:\\ncs\\toolchains\\v2.0.0\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\ncs\\toolchains\\v2.0.0\\opt\\bin"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\protec",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\protec",
          "Path": "C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\GCC for Renesas RX 8.3.0.202002-GNURX-ELF\\rx-elf\\rx-elf\\bin;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\\Microsoft SQL Server\\130\\Tools\\Binn\\;c:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C:\\Program Files\\Thorlabs\\Thorlabs OSA;C:\\Program Files\\Thorlabs\\Thorlabs OSA\\bin;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\\Thorlabs Redstone OSA;C:\\Program Files\\Thorlabs Redstone OSA\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\protec\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\protec\\.dotnet\\tools;;C:\\Users\\protec\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "PATH": "C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Users\\protec\\.nrfconnect-apps\\node_modules\\pc-nrfconnect-toolchain-manager\\resources\\nrfutil-toolchain-manager\\win32\\vcruntime140.dll;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\GCC for Renesas RX 8.3.0.202002-GNURX-ELF\\rx-elf\\rx-elf\\bin;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\\Microsoft SQL Server\\130\\Tools\\Binn\\;c:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C:\\Program Files\\Thorlabs\\Thorlabs OSA;C:\\Program Files\\Thorlabs\\Thorlabs OSA\\bin;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\\Thorlabs Redstone OSA;C:\\Program Files\\Thorlabs Redstone OSA\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\protec\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\protec\\.dotnet\\tools;;C:\\Users\\protec\\AppData\\Local\\Programs\\Microsoft VS Code\\bin"
        },
        "toolchainPath": "c:\\ncs\\toolchains\\v2.0.0",
        "toolchainBinPath": "c:\\ncs\\toolchains\\v2.0.0\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
        "toolchainVersion": "2.0.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

Related