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.

  • Hi Philip

    I will look into your case. Just to start with a few questions. 

    1. I would normally recommend to use a newer version of NCS, but as your are writing test I suspect you have come far in the development, correct?

    2. Which toolchain do you use?

    3. Please post the error log you get here as you are using a different version of NCS

    Regards

    Runar

  • Hi Runar,

    We are using nRF Connect SDK V2.0.0 & same toolchain, as we have significant code created, upgrades can cause firmware issues.

    I have also installed latest nRF connect on a different pc & had same CMake errors.

    Just to confirm on the error log & how to get this, do you mean the Zephyr system logger:

    Logging — Zephyr Project Documentation

    I'll try post a log after your response.

    Thanks.

    Regards,

    Philip

  • coderunner said:

    Logging — Zephyr Project Documentation

    I'll try post a log after your response.

    I think I was a bit unclear, I'm after the build log just so I have something to work when I try it on my end to replicate the issue. 

    coderunner said:

    We are using nRF Connect SDK V2.0.0 & same toolchain, as we have significant code created, upgrades can cause firmware issues.

    Switching would be a big undertaking so it is not something I would suggest just to test something. 

    Do you see the same issue if you try the Ztest base sample which you can find in https://github.com/nrfconnect/sdk-zephyr/tree/main/tests/ztest/base

    In your installation it would be NCS folder/v2.0.0/Zephyr/tests/ztest/base

    Regards

    Runar

  • 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.
Related