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 Reply Children
  • I tried to generate the VERSION file trying to debug. By the way, i set the path .../ncs/v.2.5.2 on the terminal and run west update. After a lot of time, it started looping endlessly with this:

    warning: unable to unlink '.git/objects/pack/pack-2614ff1bb8a3df13ffb24d04ac2c0f7393e7012c.idx': Invalid argument
    warning: unable to unlink '.git/objects/pack/pack-47dfc7b07a36eac6e49c8189bbc38ea46648b935.idx': Invalid argument
    warning: unable to unlink '.git/objects/pack/pack-b5484cc90f0ffb23eaa284e4521f6aa69eb61fea.idx': Invalid argument
    remote: Enumerating objects: 2020, done.
    remote: Counting objects: 100% (329/329), done.
    remote: Compressing objects: 100% (327/327), done.
    remote: Total 2020 (delta 3), reused 2 (delta 2), pack-reused 1691
    Receiving objects: 100% (2020/2020), 455.98 KiB | 5.30 MiB/s, done.
    Resolving deltas: 100% (18/18), done.
    Auto packing the repository in background for optimum performance.
    See "git help gc" for manual housekeeping.
    Enumerating objects: 33167, done.
    Counting objects: 100% (31151/31151), done.
    Delta compression using up to 8 threads
    Compressing objects: 100% (24103/24103), done.
    Writing objects: 100% (31151/31151), done.
    Total 31151 (delta 6015), reused 31128 (delta 5992), pack-reused 0

    It's more than half an hour now, so i suppose something is not good...

    EDIT:

    I noticed that ncs 2.5.2 folder is HUGE (4+GB). I investigated and i found that the issue is related to this path: ..\ncs\v2.5.2\modules\lib\matter\.git\objects\pack

    where the files of the above loop are saved. What it actually happens is that every iteration those three pack files are downloaded again and again.

    I uninstalled v.2.5.2 and re-download it again (using Vs Code GUI). Nothing changed and the issue is still there

    Regards,

    frax

  • When you changed SDK, did you change toolchain also? 

    4GB + sounds a bit to much, my installs are around 1.7GB. 

    Also how is your ncs version/zephyr/version looking? 

    Regards

    Runar

  • Yes, of course. Both SDK and Toolchain are at version 2.5.2. This is the content of the zephyr version file you required:

    VERSION_MAJOR = 3
    VERSION_MINOR = 4
    PATCHLEVEL = 99
    VERSION_TWEAK = 0
    EXTRAVERSION =

  • Hm that looks fine. A collauge of mine where able to reproduce the error you reported by adding a white space in the generated version file. Could it be a whitespace where added there?

    Regards

    Runar

  • Hi,

    can you be more specific on the action you suggest to do? More precisely, can you provide me the path where i should find the "generated version file" and where i need to add a whitespace?

    I'm asking because the build fails, i'm not sure to have correctly understood what you mean with the term "generated".

    Thank you

Related