This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Building sample "v1.8.0\zephyr\samples\application_development\out_of_tree_driver" gives compiler error!(Sorry, I closed the post by mistake)

Hi, guys.

My first link was here https://devzone.nordicsemi.com/f/nordic-q-a/84673/building-sample-v1-8-0-zephyr-samples-application_development-out_of_tree_driver-gives-compiler-error?ReplySortBy=CreatedDate&ReplySortOrder=Ascending, but I closed it by mistake.

Sorry for Marte Myrvold.

I have been using NRF Connect SDK 1.8.0 , I want to use this

"v1.8.0\zephyr\samples\application_development\out_of_tree_driver"

 to develop my custom driver.

When I compiled this example, I got the following error

How can I solve this problem?

THX everyone.

nRF Connect: Generate support information 

[09:58:24] west build --build-dir d:\study\nrfcode\app\out_of_tree_driver\build d:\study\nrfcode\app\out_of_tree_driver
[09:58:24] Failure (code 1).
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 China",
    "osKernel": "10.0.22000",
    "vscode": "1.63.2",
    "electron": "13.5.2",
    "node": "v14.16.0"
  },
  "system": {
    "date": "2022-02-12T01:59:39.886Z",
    "vscodeRoot": "c:\\Users\\alexc\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
    "nrfConnectForDesktopInstalled": true,
    "vscodeUptime": "00:05:09",
    "osUptime": "04:08:21",
    "cpu": {
      "model": "11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz",
      "speed": "2419 MHz",
      "count": 4
    },
    "memory": {
      "total": "15.79 GB",
      "free": "6.67 GB"
    }
  },
  "workspace": {
    "name": "workspace (工作区)",
    "workspaceFile": "d:\\study\\nrfcode\\app\\workspace.code-workspace",
    "folders": [
      "d:\\study\\nrfcode\\app\\bme280",
      "d:\\study\\nrfcode\\app\\helloworld",
      "d:\\study\\nrfcode\\app\\i2c_test",
      "d:\\study\\nrfcode\\app\\event_manager",
      "d:\\study\\nrfcode\\app\\nrf_desktop",
      "d:\\study\\nrfcode\\app\\peripheral_hids_mouse",
      "d:\\study\\nrfcode\\app\\spi_fujitsu_fram",
      "d:\\study\\nrfcode\\app\\adxl372",
      "d:\\study\\nrfcode\\app\\out_of_tree_driver",
      "d:\\study\\nrfcode\\app\\peripheral_hr",
      "d:\\study\\nrfcode\\app\\peripheral_uart"
    ]
  },
  "extensions": {
    "internal": {
      "nordic-semiconductor.nrf-connect": {
        "version": "2022.1.192",
        "path": "c:\\Users\\alexc\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.1.192",
        "isActive": true
      },
      "nordic-semiconductor.nrf-terminal": {
        "version": "2022.1.30",
        "path": "c:\\Users\\alexc\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.1.30",
        "isActive": true
      },
      "nordic-semiconductor.devicetree": null,
      "nordic-semiconductor.kconfig": null
    },
    "external": {
      "marus25.cortex-debug": "1.2.2",
      "ms-vscode.cpptools": "1.9.0",
      "ms-vscode-remote.remote-wsl-recommender": "0.0.12",
      "ms-vscode.js-debug": "1.62.0",
      "ms-vscode.js-debug-companion": "1.0.15",
      "ms-vscode.references-view": "0.0.81",
      "ms-vscode.vscode-js-profile-table": "0.0.18",
      "cschlosser.doxdocgen": "1.3.2",
      "doingweb.wpy-beautify": "2.0.10",
      "formulahendry.code-runner": "0.11.7",
      "GitHub.vscode-pull-request-github": "0.34.3",
      "golang.go": "0.31.1",
      "hyb1996.auto-js-vscodeext": "0.2.3",
      "jeff-hykin.better-cpp-syntax": "1.15.11",
      "LeetCode.vscode-leetcode": "0.18.0",
      "lextudio.restructuredtext": "168.0.0",
      "marlinfirmware.auto-build": "2.1.37",
      "MS-CEINTL.vscode-language-pack-zh-hans": "1.63.3",
      "ms-python.python": "2022.0.1814523869",
      "ms-python.vscode-pylance": "2022.2.1",
      "ms-toolsai.jupyter": "2021.11.1001550889",
      "ms-toolsai.jupyter-keymap": "1.0.0",
      "ms-toolsai.jupyter-renderers": "1.0.4",
      "ms-vscode-remote.remote-containers": "0.209.6",
      "ms-vscode-remote.remote-ssh": "0.70.0",
      "ms-vscode-remote.remote-ssh-edit": "0.70.0",
      "ms-vscode-remote.remote-wsl": "0.63.13",
      "ms-vscode.cmake-tools": "1.9.2",
      "ms-vscode.cpptools-extension-pack": "1.1.0",
      "ms-vscode.cpptools-themes": "1.0.0",
      "ms-vsliveshare.vsliveshare": "1.0.5330",
      "ms-vsliveshare.vsliveshare-audio": "0.1.91",
      "octref.vetur": "0.35.0",
      "platformio.platformio-ide": "2.4.1",
      "redhat.java": "1.3.0",
      "rust-lang.rust": "0.7.8",
      "tomoki1207.pdf": "1.2.0",
      "trond-snekvik.gnu-mapfiles": "1.1.0",
      "twxs.cmake": "0.0.17",
      "VisualStudioExptTeam.vscodeintellicode": "1.2.17",
      "vscjava.vscode-java-debug": "0.38.0",
      "vscjava.vscode-java-dependency": "0.19.0",
      "vscjava.vscode-java-pack": "0.21.0",
      "vscjava.vscode-java-test": "0.34.0",
      "vscjava.vscode-maven": "0.35.0",
      "vscodevim.vim": "1.22.1",
      "webfreak.debug": "0.25.1"
    }
  },
  "tools": {
    "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.56a",
    "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf5x\\bin\\nrfjprog.exe": "8.5.0",
    "c:\\v1.8.0\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
    "c:\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
    "c:\\v1.8.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
    "c:\\v1.8.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
    "c:\\v1.8.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
    "c:\\v1.8.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
    "c:\\v1.8.0\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
    "c:\\v1.8.0\\toolchain\\opt\\bin\\gn.exe": "1959",
    "c:\\v1.8.0\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
  },
  "connectedDevices": [],
  "config": {
    "nordic-semiconductor.nrf-connect": {
      "topdir": "${nrf-connect.sdk:1.8.0}",
      "toolchain": {
        "path": "${nrf-connect.toolchain:1.8.0}"
      },
      "ozonePath": "",
      "applications": [
        "${workspaceFolder}",
        "${workspaceFolder:helloworld}",
        "d:\\study\\nrfcode\\app\\i2c_test",
        "d:\\study\\nrfcode\\app\\event_manager",
        "d:\\study\\nrfcode\\app\\nrf_desktop",
        "d:\\study\\nrfcode\\app\\peripheral_hids_mouse",
        "d:\\study\\nrfcode\\app\\spi_fujitsu_fram",
        "d:\\study\\nrfcode\\app\\adxl372",
        "${workspaceFolder:out_of_tree_driver}",
        "d:\\study\\nrfcode\\app\\peripheral_hr",
        "d:\\study\\nrfcode\\app\\peripheral_uart"
      ],
      "jlink": {
        "rtosPlugin": ""
      },
      "kconfig": {
        "interface": "kconfig"
      },
      "welcome": {
        "showOnStartup": false
      },
      "west": {
        "env": {
          "$base": "terminal"
        }
      },
      "boardRoots": [],
      "enableTelemetry": false
    },
    "nordic-semiconductor.nrf-terminal": {
      "terminalMode": "character"
    },
    "nordic-semiconductor.devicetree": {
      "modules": [
        "${zephyrBase}",
        "${zephyrBase}/../nrf",
        "."
      ],
      "zephyr": "",
      "ctxFile": "",
      "defaultBoard": ""
    },
    "nordic-semiconductor.kconfig": {
      "root": "",
      "env": {},
      "cfiles": true,
      "disable": false,
      "zephyr": {
        "base": ""
      },
      "python": "",
      "liveValue": true
    },
    "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,
      "showDevDebugOutput": "none"
    }
  },
  "environment": {
    "westExe": "c:\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
    "westEnv": {
      "ELECTRON_RUN_AS_NODE": "1",
      "HOME": "C:\\Users\\alexc\\AppData\\Roaming\\SPB_Data",
      "HOMEDRIVE": "C:",
      "HOMEPATH": "\\Users\\alexc",
      "Path": "c:\\v1.8.0\\toolchain\\mingw64\\bin;c:\\v1.8.0\\toolchain\\mingw64\\libexec\\git-core;c:\\v1.8.0\\toolchain\\opt\\bin;c:\\v1.8.0\\toolchain\\opt\\bin\\Scripts;C:\\Program Files\\Eclipse Adoptium\\jdk-17.0.1.12-hotspot\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Git\\cmd;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf5x\\bin\\;C:\\Program Files\\PuTTY\\;C:\\Users\\alexc\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\;C:\\Users\\alexc\\AppData\\Local\\Programs\\Python\\Python38\\;C:\\Users\\alexc\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\alexc\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\alexc\\AppData\\Roaming\\Amazon;C:\\Users\\alexc\\AppData\\Local\\Programs\\Hyper\\resources\\bin;C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin;D:\\tools\\platform-tools_r31.0.3-windows\\platform-tools;",
      "ZEPHYR_BASE": "c:\\v1.8.0\\zephyr",
      "GNUARMEMB_TOOLCHAIN_PATH": "c:\\v1.8.0\\toolchain\\opt",
      "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
      "PYTHONPATH": "c:\\v1.8.0\\toolchain\\opt\\bin;c:\\v1.8.0\\toolchain\\opt\\bin\\Lib;c:\\v1.8.0\\toolchain\\opt\\bin\\Lib\\site-packages",
      "Python3_ROOT": "c:\\v1.8.0\\toolchain\\opt\\bin"
    },
    "toolchainPath": "c:\\v1.8.0\\toolchain",
    "toolchainBinPath": "c:\\v1.8.0\\toolchain\\opt\\bin",
    "toolchainVersion": "1.8.0"
  },
  "terminal": {
    "shell": null,
    "defaultProfile": "PowerShell"
  }
}

Parents Reply Children
  • Hi,

    "CMake Tools extension" means the vs code plugin? 

    I diable it, and updated the nrfjprog version to the latest.

    But the problem remains.

    Except the out_of_tree_driver can't be compiled, the others example are OK。

    [14:38:37] west build --build-dir d:\study\nrfcode\app\out_of_tree_driver\build d:\study\nrfcode\app\out_of_tree_driver --pristine --board nrf52dk_nrf52832 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="d:/study/nrfcode/app/bme280;d:/study/nrfcode/app/helloworld;d:/study/nrfcode/app/adxl372;d:/study/nrfcode/app/peripheral_hr;d:/study/nrfcode/app/peripheral_uart" -DCONF_FILE:STRING="d:/study/nrfcode/app/out_of_tree_driver/prj.conf"
    [14:38:48] Failure (code 1).
    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 China",
        "osKernel": "10.0.22000",
        "vscode": "1.64.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-02-15T06:38:55.686Z",
        "vscodeRoot": "c:\\Users\\alexc\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:00:49",
        "osUptime": "21:03:39",
        "cpu": {
          "model": "11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz",
          "speed": "2419 MHz",
          "count": 4
        },
        "memory": {
          "total": "15.79 GB",
          "free": "5.39 GB"
        }
      },
      "workspace": {
        "name": "workspace (工作区)",
        "workspaceFile": "d:\\study\\nrfcode\\app\\workspace.code-workspace",
        "folders": [
          "d:\\study\\nrfcode\\app\\bme280",
          "d:\\study\\nrfcode\\app\\helloworld",
          "d:\\study\\nrfcode\\app\\i2c_test",
          "d:\\study\\nrfcode\\app\\event_manager",
          "d:\\study\\nrfcode\\app\\nrf_desktop",
          "d:\\study\\nrfcode\\app\\peripheral_hids_mouse",
          "d:\\study\\nrfcode\\app\\spi_fujitsu_fram",
          "d:\\study\\nrfcode\\app\\adxl372",
          "d:\\study\\nrfcode\\app\\peripheral_hr",
          "d:\\study\\nrfcode\\app\\peripheral_uart",
          "d:\\study\\nrfcode\\app\\out_of_tree_driver"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.1.192",
            "path": "c:\\Users\\alexc\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.1.192",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.1.30",
            "path": "c:\\Users\\alexc\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.1.30",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "1.2.2",
          "ms-vscode.cpptools": "1.9.0",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.12",
          "ms-vscode.js-debug": "1.64.3",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.81",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "cschlosser.doxdocgen": "1.3.2",
          "doingweb.wpy-beautify": "2.0.10",
          "formulahendry.code-runner": "0.11.7",
          "GitHub.vscode-pull-request-github": "0.36.1",
          "golang.go": "0.31.1",
          "hyb1996.auto-js-vscodeext": "0.2.3",
          "jeff-hykin.better-cpp-syntax": "1.15.13",
          "LeetCode.vscode-leetcode": "0.18.0",
          "lextudio.restructuredtext": "168.0.0",
          "marlinfirmware.auto-build": "2.1.37",
          "MS-CEINTL.vscode-language-pack-zh-hans": "1.64.6",
          "ms-python.python": "2022.0.1814523869",
          "ms-python.vscode-pylance": "2022.2.1",
          "ms-toolsai.jupyter": "2022.1.1201831736",
          "ms-toolsai.jupyter-keymap": "1.0.0",
          "ms-toolsai.jupyter-renderers": "1.0.6",
          "ms-vscode-remote.remote-containers": "0.217.4",
          "ms-vscode-remote.remote-ssh": "0.70.0",
          "ms-vscode-remote.remote-ssh-edit": "0.70.0",
          "ms-vscode-remote.remote-wsl": "0.64.2",
          "ms-vscode.cpptools-extension-pack": "1.1.0",
          "ms-vscode.cpptools-themes": "1.0.0",
          "ms-vsliveshare.vsliveshare": "1.0.5330",
          "ms-vsliveshare.vsliveshare-audio": "0.1.91",
          "octref.vetur": "0.35.0",
          "platformio.platformio-ide": "2.4.2",
          "redhat.java": "1.3.0",
          "rust-lang.rust": "0.7.8",
          "tomoki1207.pdf": "1.2.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17",
          "VisualStudioExptTeam.vscodeintellicode": "1.2.17",
          "vscjava.vscode-java-debug": "0.38.0",
          "vscjava.vscode-java-dependency": "0.19.0",
          "vscjava.vscode-java-pack": "0.21.0",
          "vscjava.vscode-java-test": "0.34.0",
          "vscjava.vscode-maven": "0.35.0",
          "vscodevim.vim": "1.22.1",
          "webfreak.debug": "0.25.1"
        }
      },
      "tools": {
        "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.60h",
        "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.2",
        "c:\\v1.8.0\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
        "c:\\v1.8.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\v1.8.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\v1.8.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\v1.8.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\v1.8.0\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "c:\\v1.8.0\\toolchain\\opt\\bin\\gn.exe": "1959",
        "c:\\v1.8.0\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },
      "connectedDevices": [
        {
          "id": "682518119",
          "alias": "helloworld"
        }
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.8.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.8.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}",
            "${workspaceFolder:helloworld}",
            "d:\\study\\nrfcode\\app\\i2c_test",
            "d:\\study\\nrfcode\\app\\event_manager",
            "d:\\study\\nrfcode\\app\\nrf_desktop",
            "d:\\study\\nrfcode\\app\\peripheral_hids_mouse",
            "d:\\study\\nrfcode\\app\\spi_fujitsu_fram",
            "d:\\study\\nrfcode\\app\\adxl372",
            "d:\\study\\nrfcode\\app\\peripheral_hr",
            "d:\\study\\nrfcode\\app\\peripheral_uart",
            "d:\\study\\nrfcode\\app\\out_of_tree_driver"
          ],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": false
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": false
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "nordic-semiconductor.devicetree": {
          "modules": [
            "${zephyrBase}",
            "${zephyrBase}/../nrf",
            "."
          ],
          "zephyr": "",
          "ctxFile": "",
          "defaultBoard": ""
        },
        "nordic-semiconductor.kconfig": {
          "root": "",
          "env": {},
          "cfiles": true,
          "disable": false,
          "zephyr": {
            "base": ""
          },
          "python": "",
          "liveValue": true
        },
        "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,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "c:\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\alexc\\AppData\\Roaming\\SPB_Data",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\alexc",
          "Path": "c:\\v1.8.0\\toolchain\\mingw64\\bin;c:\\v1.8.0\\toolchain\\mingw64\\libexec\\git-core;c:\\v1.8.0\\toolchain\\opt\\bin;c:\\v1.8.0\\toolchain\\opt\\bin\\Scripts;C:\\Program Files\\Eclipse Adoptium\\jdk-17.0.1.12-hotspot\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Git\\cmd;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\PuTTY\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\alexc\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\;C:\\Users\\alexc\\AppData\\Local\\Programs\\Python\\Python38\\;C:\\Users\\alexc\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\alexc\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\alexc\\AppData\\Roaming\\Amazon;C:\\Users\\alexc\\AppData\\Local\\Programs\\Hyper\\resources\\bin;C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin;D:\\tools\\platform-tools_r31.0.3-windows\\platform-tools;C:\\Cadence\\SPB_17.4\\tools\\bin;",
          "ZEPHYR_BASE": "c:\\v1.8.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\v1.8.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\v1.8.0\\toolchain\\opt\\bin;c:\\v1.8.0\\toolchain\\opt\\bin\\Lib;c:\\v1.8.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\v1.8.0\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\v1.8.0\\toolchain",
        "toolchainBinPath": "c:\\v1.8.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.8.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": "PowerShell"
      }
    }

  • updated the nrfjprog version to the latest.

    when i flash the other example, alway get the warning info.

    how can i add "verfity" parameters to  ensure the success of flash.

  • Hi,

    I managed to reproduce the issue by creating an out of tree driver application on another disk than what my nRF Connect SDK installation is on. The issue was with constructing a Zephyr library in the Hello World module that is a part of the out_of_tree_driver sample. I provide a more in-depth explanation below, but to fix it all you need to do is to replace zephyr_library with zephyr_library_named in out_of_tree_driver/hello_world_module/zephyr/CMakeLists.txt:

    # SPDX-License-Identifier: Apache-2.0
    
    if(CONFIG_HELLO_WORLD_DRIVER)
      # Add hello_world_driver.h to the set of global include paths.
      zephyr_include_directories(.)
    
      zephyr_library_named(hello_world_module)
      zephyr_library_sources(
        hello_world_driver.c
        )
    endif()
    

    Explanation:

    Both zephyr_library and zephyr_library_named can be used to construct a Zephyr library. In the latter you explicitly give a name for the library, while zephyr_library will determine what the current directory's library name would be according to the provided base, and then give this name as an argument in zephyr_library_named:

    macro(zephyr_library)
      zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name)
      zephyr_library_named(${lib_name})
    endmacro()

    The issue here is caused by the way zephyr_library_get_current_dir_lib_name is implemented. The comments explain how it should usually find the name:

    macro(zephyr_library_get_current_dir_lib_name base lib_name)
      # Remove the prefix (/home/sebo/zephyr/driver/serial/CMakeLists.txt => driver/serial/CMakeLists.txt)
      file(RELATIVE_PATH name ${base} ${CMAKE_CURRENT_LIST_FILE})
    
      # Remove the filename (driver/serial/CMakeLists.txt => driver/serial)
      get_filename_component(name ${name} DIRECTORY)
    
      # Replace / with __ (driver/serial => driver__serial)
      string(REGEX REPLACE "/" "__" name ${name})
    
      set(${lib_name} ${name})
    endmacro()

    It already fails on the first line in your case, and when I tested. The following will compute a relative path from <directory> to a <file> and store it in the <variable>

    file(RELATIVE_PATH <variable> <directory> <file>)

    In zephyr_library_get_current_dir_lib_name this will be:

    • <directory> = ${ZEPHYR_BASE}
    • <file> = ${CMAKE_CURRENT_LIST_FILE}

    This will work if ZEPHYR_BASE and CMAKE_CURRENT_LIST_FILE are on the same drive and especially when the paths are as similar as possible, as it is in the example in the comments of zephyr_library_get_current_dir_lib_name. However, in your case you have:

    • ZEPHYR_BASE = C:/v1.8.0/zephyr
    • CMAKE_CURRENT_LIST_FILE = d:/study/nrfcode/app/out_of_tree_driver/hello_world_module/zephyr

    So as you see, it is unable to shorten the path at all. It is able to remove the filename in the next part, but that is it. The name of the library cannot contain slashes, so all "/" will be replaced with "__". In your case you will then end up with the following as libname (Zephyr library name):

    d:__study__nrfcode__app__out_of_tree_driver__hello_world_module__zephyr

    Because of this, it fails when adding hello_world_driver.c to zephyr_library_sources in the next part in CMakeLists.txt:

    zephyr_library_sources(
      hello_world_driver.c
      )

    The function zephyr_library_sources is a zephyr_library version of the CMake target_sources function:

    function(zephyr_library_sources source)
      target_sources(${ZEPHYR_CURRENT_LIBRARY} PRIVATE ${source} ${ARGN})
    endfunction()

    This function is used to add sources to a target. In this case, it is used to add the source file hello_world_driver.c to the target ${ZEPHYR_CURRENT_LIBRARY}. However, this target, ${ZEPHYR_CURRENT_LIBRARY}, is the Zephyr library name (libname) that was determined by zephyr_library() previously as:

    • ${ZEPHYR_CURRENT_LIBRARY} = d:__study__nrfcode__app__out_of_tree_driver__hello_world_module__zephyr

    This target name is not valid, and will result in a CMake error.

    Hope this helps explain it!

    darkknight said:
    how can i add "verfity" parameters to  ensure the success of flash.

    This is a nrfjprog command. If you flash on the command line you can use nrfjprog commands, but as of now you cannot add --verify when you program your device using the 'Flash' action in VS Code.

    Best regards,

    Marte

Related