On running z-test, reports CMake error - Could not find a package configuration file provided by "Zephyr-sdk" on Windows

Hi,

I am having similar error as reported in Case ID: 308488, however here issue is running z-test on provided Nordic test samples.

(note: nRF-connect SDK, works as expected for standard build using VS Studio).

Installed  nRF SDK v2.00, using nRF-Connect & Tool chain manager.

I have tried setting:

- Set ZEPHYR_BASE to the location of the zephyr repository:
  zephyr-env.cmd

- Set Zephyr SDK Install directory:
  set ZEPHYR_SDK_INSTALL_DIR = C:\ncs\toolchains\v2.0.0\
- Set Zephyr Tool Chain:
  set ZEPHYR_TOOL_CHAIN_VARIANT = zephyr

Additionally:

To avoid reported CMake error during z-test:
- Export Zephyr CMake package allows CMake to automatically find a Zephyr base.
 cmake -P C:\ncs\v2.0.0\zephyr\share\zephyr-package\cmake\zephyr_export.cmake
  - Consequently Added to the user package registry in:
    HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\Zephyr

However the same CMake error persists (as in previous post).

BTW those files do not seem to be in my install directory, namely:

zephyr-sdk-config.cmake (or similar).

Can Nordic support suggest a solution?

I have also posted on Discord (Zephyr support) but no replies received.

Thanking you in advance.

Parents
  • Customer reply

    This issue appears to arise due to a failure in the CMake tool verification (see attached).
    This script run error message is reported by twister (Z-Test) for me on running any test :
    There doesn't appear to be a build log generated as such as the test fails at toolchain CMake verifiy:
    PS C:\ncs\v2.0.0\zephyr> python ./scripts/twister -T tests/ztest/base
    ZEPHYR_BASE unset, using "C:\ncs\v2.0.0\zephyr"
    Renaming output directory to C:\ncs\v2.0.0\zephyr\twister-out.28
    INFO - Zephyr version: v3.0.99-ncs1
    INFO - JOBS: 8
    ERROR - Cmake script failure: C:\ncs\v2.0.0\zephyr\cmake\modules\verify-toolchain.cmake
    E: CMake Error at cmake/modules/verify-toolchain.cmake:84 (find_package):
    Could not find a package configuration file provided by "Zephyr-sdk"
    (requested version 0.13.1) with any of the following names:
    Zephyr-sdkConfig.cmake
    zephyr-sdk-config.cmake
    Add the installation prefix of "Zephyr-sdk" to CMAKE_PREFIX_PATH or set
    "Zephyr-sdk_DIR" to a directory containing one of the above files. If
    "Zephyr-sdk" provides a separate development package or SDK, be sure it has
    Let me know what you think & if you can also resolve issue with posting on the forum.

    been installed.
    Above fail was tested & repeatable even on the Ztest base sample.
  • Hi

    When you ran the samples, did you start the command line prompt from the start menu or launching cmd/bash from the toolchain manager dropdown/nRF Connect  terminal inside vscode? The difference is that if you just ran just by starting powershell/terminal the environment from the toolchain may not have been loaded. 

    Regards

    Runar

  • Hi Runar,

    I ran code from both within VS Code (terminal), launched using nRF Toolchain manager & also tried on Windows command prompt, however same CMake error results.

    Hope makes sense.

  • Thanks. 

    Are you trying to run the tests on target(52840) or native posix? The last one will only work if you are running Linux. 

    Edit, you should still be able to compile. So it might not valid yet. 

    I do wonder if the changes you have done might have something to do with the issues you are seeing, As I can build with the base sample and busy_sim test without any issue

    Regards

    Runar

  • Actually didn't flash a device as running basic samples but didn't compile due to CMake error.

    Our aim is to run on hardware (nRF-52840) - HIL vs. emulation (QEMU).

    Can try on Linux by installing Windows Subsystem for Linux (WSL) & then can use native posix etc. 

    Note:

    Due to issues finding executables, the Zephyr Project doesn’t currently support application flashing using the Windows Subsystem for Linux (WSL) (WSL).

    Therefore, we don’t recommend using WSL when getting started.

    Other suggestion might be to create a Virtual Environment & download Zephyr source code there:

    Getting Started Guide — Zephyr Project Documentation

    Can Export a Zephyr CMake package.

    (This allows CMake to automatically load boilerplate code required for building Zephyr applications).

    west zephyr-export

    Suggested to use Chocolatey -  Package Manager for Windows.

    Doing this might work, however we are constrained to use SDK v2.0.0 in our application.

    What do you think on it Runar?

    Thanks.

  • I'm running this by the developer team and will update as soon as I hear from them

    Regards

    Runar

Reply Children
No Data
Related