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
  • Hi, I will be looking into your issue

    Can you post your version file? 

    Regards

    Runar

  • Here you go. The file is named "VERSION" (no file extension) and it is placed in the same path of prj.conf file

    VERSION_MAJOR = 0
    VERSION_MINOR = 5
    PATCHLEVEL = 0
    VERSION_TWEAK = 0
    EXTRAVERSION = unstable

    Please note that the generation of this file is the only thing i modified in my project. No other modifications in prj.conf, in source code or whatever.

  • it looks to me like your major and patch version is not set and therefor gives you the error. How is your ncs version/zephyr/version looking? You could try to do a west update to see if it fixes things. you should not need to have a version file in the project folder. 

    Regards

    Runar

  • 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

Reply
  • 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

Children
Related