Cmake Error "Math cannot parse the expression" with NCS > 2.4.2

Hello,

i'm using nrf connect sdk 2.4.2 to develop the firmware for my custom nrf5340 board without issues. I'm trying to upgrade to the the latest release but both 2.5.0 and 2.5.2 gives me this error when trying to compile:

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).

I found THIS issue on DevZone that is extremely similar to my one and posted there some material to test on, but i didn't get any feedback in few months. For this reason, i'm opening a new issue.

The issue is clearly correlated to the Application versioning, but even reading the docs and making some tests i was not able to solve it.

Any suggestion?

Frax

Parents
  • I'm a bit at a loss here. Could you upload your project so I can have a look?

    Just to summarize 

    New version of the SDK

    new sample project with only hello world and no changes? Are you including any file named version in your project folder? I don't believe are you, just need to check. 

    Could you generate the support information from vscode and post it here?

    Regards

    Runar

    NB: Due to public holidays here in Norway, we will be out until the 2. of April. 

  • Hi runsiv,

    Correct, new version of SDK and toolchain. Project with only hellow world and no changes. I am NOT including any file named version in my project folder. 

    Here follows the support information generated from vscode:

    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.19045",
        "vscode": "1.87.2",
        "electron": "27.3.2",
        "node": "v18.17.1"
      },
      "system": {
        "date": "2024-03-27T15:58:04.253Z",
        "vscodeRoot": "c:\\Users\\Frax\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:01:26",
        "osUptime": "07:24:04",
        "cpu": "Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz"
      },
      "workspace": {
        "name": "nrf5340_PASTO (Workspace)",
        "workspaceFile": "c:\\nrf5340_PASTO\\nrf5340_PASTO.code-workspace",
        "folders": [
          "c:\\nrf5340_PASTO",
          "c:\\nrf5340dk_projects\\PASTO\\hello_world"
        ]
      },
      "sdks": [
        {
          "version": "v2.6.0",
          "path": "c:\\ncs\\v2.6.0"
        },
        {
          "version": "v2.4.2",
          "path": "c:\\ncs\\v2.4.2"
        }
      ],
      "activeBuild": "c:\\nrf5340_PASTO\\Glass_firmware\\build-DK",
      "apps": [
        {
          "workspace": "c:\\nrf5340_PASTO",
          "uri": "c:\\nrf5340_PASTO\\Glass_firmware",
          "buildConfigurations": [
            {
              "id": "c:\\nrf5340_PASTO\\Glass_firmware\\build_glass_nrf5340",
              "name": "build_glass_nrf5340",
              "boardId": "pasto_glass_nrf5340_cpuapp_ns",
              "type": "Zephyr",
              "isChild": false,
              "isStale": true,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            },
            {
              "id": "c:\\nrf5340_PASTO\\Glass_firmware\\build_glass-nrf5340_rev",
              "name": "build_glass-nrf5340_rev",
              "boardId": "pasto_glass_nrf5340_cpuapp_ns",
              "type": "Zephyr",
              "isChild": false,
              "isStale": true,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            },
            {
              "id": "c:\\nrf5340_PASTO\\Glass_firmware\\build-DK",
              "name": "build-DK",
              "boardId": "pasto_glass_nrf5340_cpuapp_ns",
              "type": "Zephyr",
              "isChild": false,
              "isStale": false,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        },
        {
          "workspace": "c:\\nrf5340dk_projects\\PASTO\\hello_world",
          "uri": "c:\\nrf5340dk_projects\\PASTO\\hello_world",
          "buildConfigurations": [
            {
              "id": "c:\\nrf5340dk_projects\\PASTO\\hello_world\\hello_world_PASTO_BOARD",
              "name": "hello_world_PASTO_BOARD",
              "boardId": "nrf5340dk_nrf5340_cpuapp_ns",
              "type": "Zephyr",
              "isChild": false,
              "isStale": false,
              "taskBindings": {
                "build": [],
                "pristineBuild": [],
                "flash": [],
                "eraseAndFlash": []
              }
            }
          ]
        }
      ],
      "topdir": "c:\\ncs\\v2.6.0",
      "workspaceState": "freestanding-ready",
      "toolchains": [
        {
          "version": "2.6.0",
          "path": "c:\\ncs\\toolchains\\cf2149caf2"
        },
        {
          "version": "2.4.2",
          "path": "c:\\ncs\\toolchains\\31f4403e35"
        }
      ],
      "connectedDevices": [],
      "deviceProvider": "nrfutil",
      "tools": {
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.16.5",
        "C:\\Program Files\\SEGGER\\JLink_V794e\\JLink.exe": "7.94e",
        "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.24.0",
        "nrfutil": "Not found",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\cmake.exe": "3.21.0",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\Scripts\\west.exe": "1.2.0",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\python.exe": "3.9.13",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\ninja.exe": "1.10.2",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\gperf.exe": "3.1",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\dtc.exe": "1.4.7",
        "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\gn.exe": "2154",
        "C:\\ncs\\toolchains\\cf2149caf2\\mingw64\\bin\\git.exe": "2.37.3.windows.1",
        "gdbPath": "c:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe"
      },
      "nrfutil": {
        "nrfutil-device": {
          "version": "2.0.0",
          "binPath": "c:\\Users\\Frax\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64\\platform\\nrfutil\\bin\\nrfutil-device"
        },
        "nrfutil-toolchain-manager": {
          "version": "0.14.1",
          "binPath": "c:\\Users\\Frax\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64\\platform\\nrfutil\\bin\\nrfutil-toolchain-manager"
        }
      },
      "environment": {
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\Frax",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\Frax",
          "PATH": "C:\\ncs\\toolchains\\cf2149caf2;C:\\ncs\\toolchains\\cf2149caf2\\mingw64\\bin;C:\\ncs\\toolchains\\cf2149caf2\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\Scripts;C:\\ncs\\toolchains\\cf2149caf2\\opt\\nanopb\\generator-bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\aarch64-zephyr-elf\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\x86_64-zephyr-elf\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\riscv64-zephyr-elf\\bin;c:\\Users\\Frax\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64\\platform\\nrfutil\\lib\\nrfutil-toolchain-manager;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;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:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\PuTTY\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Users\\Frax\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\Scripts;C:\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Frax\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\Program Files\\JetBrains\\PhpStorm 2019.3.3\\bin;;C:\\Program Files\\JetBrains\\PyCharm Community Edition 2021.2.3\\bin;;C:\\Program Files\\JetBrains\\IntelliJ IDEA Community Edition 2021.3\\bin;;C:\\Users\\Frax\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Frax\\go\\bin",
          "ZEPHYR_BASE": "c:\\ncs\\v2.6.0\\zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "C:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk",
          "PYTHONPATH": "C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin;C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\Lib;C:\\ncs\\toolchains\\cf2149caf2\\opt\\bin\\Lib\\site-packages"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\Frax",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\Frax",
          "Path": "C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;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:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\PuTTY\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Users\\Frax\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\Scripts;C:\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Frax\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\Program Files\\JetBrains\\PhpStorm 2019.3.3\\bin;;C:\\Program Files\\JetBrains\\PyCharm Community Edition 2021.2.3\\bin;;C:\\Program Files\\JetBrains\\IntelliJ IDEA Community Edition 2021.3\\bin;;C:\\Users\\Frax\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Frax\\go\\bin",
          "PATH": "C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;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:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\PuTTY\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Users\\Frax\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python310\\Scripts;C:\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\Frax\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\Program Files\\JetBrains\\PhpStorm 2019.3.3\\bin;;C:\\Program Files\\JetBrains\\PyCharm Community Edition 2021.2.3\\bin;;C:\\Program Files\\JetBrains\\IntelliJ IDEA Community Edition 2021.3\\bin;;C:\\Users\\Frax\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Frax\\go\\bin"
        },
        "toolchainPath": "c:\\ncs\\toolchains\\cf2149caf2",
        "toolchainBinPath": "c:\\ncs\\toolchains\\cf2149caf2\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
        "toolchainVersion": "2.6.0"
      },
      "terminal": {
        "defaultProfile": null
      },
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:2.6.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:2.6.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}\\Glass_firmware"
          ],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig"
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "taskBindings": {},
          "buildTerminal": {
            "condensedProgress": true
          },
          "debugging": {
            "flash": true,
            "bindings": {},
            "justMyCode": true
          },
          "activeAppFollowActiveEditor": true,
          "deviceProvider": "",
          "flash": {
            "softreset": false,
            "erase": false,
            "recover": false
          },
          "enableTelemetry": false,
          "thirdpartyIntegration": {},
          "toolchainManager": {
            "indexURL": null,
            "installDirectory": null
          },
          "nrfutil": {
            "home": null
          },
          "defaultOpenAction": "ask",
          "welcome": {
            "showOnStartup": true
          }
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        }
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2024.3.25",
            "path": "c:\\Users\\Frax\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2024.3.15",
            "path": "c:\\Users\\Frax\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2024.3.15",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2024.3.78",
            "path": "c:\\Users\\Frax\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2024.3.78",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2024.3.21",
            "path": "c:\\Users\\Frax\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2024.3.21",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": null,
          "ms-vscode.cpptools": "1.19.9",
          "ms-vscode.js-debug": "1.87.0",
          "ms-vscode.js-debug-companion": "1.1.2",
          "ms-vscode.vscode-js-profile-table": "1.0.8",
          "alexnesnes.teleplot": "1.1.3",
          "esbenp.prettier-vscode": "10.4.0",
          "GitHub.codespaces": "1.16.17",
          "GitHub.remotehub": "0.62.0",
          "Gruntfuggly.todo-tree": "0.0.226",
          "mintlify.document": "2.2.1",
          "MS-CEINTL.vscode-language-pack-it": "1.87.2024031309",
          "ms-vscode.azure-repos": "0.38.0",
          "ms-vscode.cpptools-extension-pack": "1.3.0",
          "ms-vscode.cpptools-themes": "2.0.0",
          "ms-vscode.remote-repositories": "0.40.0",
          "PKief.material-icon-theme": "4.34.0",
          "redhat.vscode-yaml": "1.14.0",
          "tomoki1207.pdf": "1.2.2",
          "trond-snekvik.gnu-mapfiles": "1.1.0"
        }
      }
    }

    No problem for the holydays, please enjoy them Slight smile

    It's important i solve the issue but i'm not in hurry.

    Thanks,

    Frax

  • Thanks for confirming. This means the SDK should be correctly installed. From the same terminal you ran 'west update' in, please run

    west forall -c "git reset --hard"
    for good measure. Note: this will revert any local changes in your SDK tree.

    Then, in C:/ncs/v2.6.0/zephyr/cmake/modules/version.cmake b/cmake/modules/version.cmake, add the following line to print the VERSION files used in the build:

    diff --git a/cmake/modules/version.cmake b/cmake/modules/version.cmake
    index 4c80c5fcdc..46c430f5a7 100644
    --- a/cmake/modules/version.cmake
    +++ b/cmake/modules/version.cmake
    @@ -43,6 +43,7 @@ if(NOT DEFINED VERSION_FILE AND NOT DEFINED VERSION_TYPE)
     endif()
     
     foreach(type file IN ZIP_LISTS VERSION_TYPE VERSION_FILE)
    +  message(ERROR ${VERSION_FILE})
       if(NOT EXISTS ${file})
         break()
       endif()
    
    

    After this, build one of the SDK samples that will fail and post the build log from terminal here.

    E.g., 

    /zephyr/samples/hello_world$ west build -b nrf5340dk_nrf5340_cpuapp -p

  • Ok. This is what i've done:

    1) west forall -c "git reset --hard" ---> No errors arose

    2) in "C:/ncs/v2.6.0/zephyr/cmake/modules/version.cmake" i added the line "message(ERROR ${VERSION_FILE})" just after the "foreach" line.

    3) in the "Nrf Connect" tab of VS code i selected the hello_world build config and in "Actions" i clicked on "Pristine Build"

    This is the output: (for some reason i can't "insert code")

    Building hello_world
    C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir c:/nrf5340dk_projects/PASTO/hello_world/build c:/nrf5340dk_projects/PASTO/hello_world --pristine --board nrf5340dk_nrf5340_cpuapp --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=c:/nrf5340_pasto -DCACHED_CONF_FILE=c:/nrf5340dk_projects/PASTO/hello_world/prj.conf"

    -- west build: generating a build system
    ERRORC:/ncs/v2.6.0/zephyr/VERSION/VERSION
    ERRORC:/ncs/v2.6.0/zephyr/VERSION/VERSION
    CMake Error at C:/ncs/v2.6.0/zephyr/cmake/modules/version.cmake:77 (math):
    math cannot parse the expression: "( << 16) + ( << 8) + ()": syntax error,
    unexpected exp_SHIFTLEFT (4).
    Call Stack (most recent call first):
    C:/ncs/v2.6.0/zephyr/share/zephyr-package/cmake/ZephyrConfigVersion.cmake:59 (include)
    CMakeLists.txt:5 (find_package)


    CMake Error at C:/ncs/v2.6.0/zephyr/cmake/modules/version.cmake:78 (math):
    math cannot parse the expression: "( << 24) + ( << 16) + ( << 8) + ()":
    syntax error, unexpected exp_SHIFTLEFT (4).
    Call Stack (most recent call first):
    C:/ncs/v2.6.0/zephyr/share/zephyr-package/cmake/ZephyrConfigVersion.cmake:59 (include)
    CMakeLists.txt:5 (find_package)


    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/nrf5340dk_projects/PASTO/hello_world
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.6.0/zephyr/.cache
    ERRORC:/ncs/v2.6.0/zephyr/VERSIONC:/nrf5340dk_projects/PASTO/hello_world/VERSION
    -- Zephyr version: 3.5.99 (C:/ncs/v2.6.0/zephyr)
    ERRORC:/ncs/v2.6.0/zephyr/VERSIONC:/nrf5340dk_projects/PASTO/hello_world/VERSION
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/cf2149caf2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.6.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/nrf5340dk_projects/PASTO/hello_world/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/nrf5340dk_projects/PASTO/hello_world/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/nrf5340dk_projects/PASTO/hello_world/build/zephyr/dts.cmake
    Parsing C:/ncs/v2.6.0/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.6.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'c:/nrf5340dk_projects/PASTO/hello_world/prj.conf'
    Configuration saved to 'C:/nrf5340dk_projects/PASTO/hello_world/build/zephyr/.config'
    Kconfig header saved to 'C:/nrf5340dk_projects/PASTO/hello_world/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring incomplete, errors occurred!
    See also "C:/nrf5340dk_projects/PASTO/hello_world/build/CMakeFiles/CMakeOutput.log".
    See also "C:/nrf5340dk_projects/PASTO/hello_world/build/CMakeFiles/CMakeError.log".
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\cf2149caf2\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe '-Bc:\nrf5340dk_projects\PASTO\hello_world\build' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=c:/nrf5340_pasto -DCACHED_CONF_FILE=c:/nrf5340dk_projects/PASTO/hello_world/prj.conf '-Sc:\nrf5340dk_projects\PASTO\hello_world'

    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

  • Hi,
    Just started to take a look.
    I wonder why there is a double `VERSION/VERSION` here:

    -- west build: generating a build system
    ERRORC:/ncs/v2.6.0/zephyr/VERSION/VERSION

    This indicates to me that the problem might be related to `VERSION` somehow being appended twice to that setting and therefore not found during build, which again causes values for the match operation to be empty and therefore fail.

    It would be a big help if you can provide a CMake trace file for further investigation as to what exactly happens.
    Run the `west build ...` command as printed in your last comment and then add:

    -- --trace-expand 2> cmake.trace

    and attach the cmake.trace file to this thread.

  • Reason for the `/VERSION/VERSION` printing is found.
    It happens because the VERSION_FILE variable is a CMake lists of two elements, which in CMake is separated by a `;`.

    But when you're printed the message, that list is concatenated into a single string, and the `;` disappears in that process, so this part actually looks correct.

    But a cmake.trace file is still valuable for further investigations.

  •  Would you by any chance have a stray `VERSION` file at the root of your system, like `c:\VERSION` ?

    If you do, can you try to remove it, and see if that is the cause of the error.

Reply Children
Related