NCS 2.5.0: CMake Error ... version.cmake:74 (math): math cannot parse the expression

After updating the NCS from 2.4.2 to 2.5.0 my project cannot be created.

The following error occurs:

-- CMake version: 3.20.5
-- Found Python3: D:/Nordic/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: D:/Nordic/v2.5.0/zephyr/.cache
-- Zephyr version: 3.4.99 (D:/Nordic/v2.5.0/zephyr)
CMake Error at D:/Nordic/v2.5.0/zephyr/cmake/modules/version.cmake:74 (math):
  math cannot parse the expression: "( << 16) + ( << 8) + ()": syntax error,
  unexpected exp_SHIFTLEFT (4).
Call Stack (most recent call first):
  D:/Nordic/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
  D:/Nordic/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  D:/Nordic/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:11 (find_package)


CMake Error at D:/Nordic/v2.5.0/zephyr/cmake/modules/version.cmake:75 (math):
  math cannot parse the expression: "( << 24) + ( << 16) + ( << 8) + ()":
  syntax error, unexpected exp_SHIFTLEFT (4).
Call Stack (most recent call first):
  D:/Nordic/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
  D:/Nordic/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  D:/Nordic/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:11 (find_package)

How can I fix this?

Parents Reply
  • Sorry for the late reply...

    I have now tested several projects and this error only occurs in one project. Two other projects can be updated from 2.4.0 and 2.4.2 to 2.5.0. There are more warnings here, but the build process is running through (firmware not yet tested).

    When comparing the projects, I noticed that I have a "VERSION" file in the project folder. I had already prepared this based on the documentation (Application version management).

    ~~~
    VERSION_MAJOR=0
    VERSION_MINOR=5
    PATCH LEVEL=0
    VERSION_TWEAK=0
    EXTRAVERSION=unstable
    ~~~

    If I remove this file I can successfully run a build with 2.5.0 (firmware not tested yet).

    However, I can't really understand the connection to the error message...

Children
Related