This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Run Cmake fails often in Segger Embedded Studio for same Project

Hello,

first I have to say that I'm new with nRF5340, Segger Embedded Studio and Cmake.

I have a working project with CMakeList.txt. So I include it into Segger Embedded Studio (SES) through File / Open nRF Connect SDK Project. After selecting the right toolchain, processor and my directory where CMakeList.txt is lokated it creates the project in SES. The from my side unlucky situation is that there are absolute pathes in the created build files. But I thought with a press on the Project / Run CMake menu the build files are created new.

So when I press Run CMake in the this new created project it fails mostly. Sometimes it works, but most not. The error message I usually see is:

  File "C:\ncs\v1.7.1\toolchain\opt\bin\Lib\site-packages\west\util.py", line 82, in west_topdir
    raise WestNotFound('Could not find a West workspace '
west.util.WestNotFound: Could not find a West workspace in this or any parent directory
CMake Error at C:/ncs/v1.7.1/nrfxlib/common.cmake:58 (message):
  Failed to find mbedtls, cannot build security libraries
Call Stack (most recent call first):
  C:/ncs/v1.7.1/nrfxlib/nrf_security/CMakeLists.txt:173 (get_mbedtls_dir)

error: cmake failed
create_nordic_project.py failed (1)

Looking into the mentioned python script it, beneath others, checks the ZEPHY_BASE environment variable, which is set in my envornment.

So why does it mostly fail but sometimes work? Even for a newly created project?

BTW: I'm using Windows 10.

Is even my understanding right, that I can copy all my stuff to a different location on my machine (where the relative pathes beneath my files are still the same) and just have to click on run CMake to get new build (and other) files that contain now the new absolute path to my source items (not to SDK as this location is of course not changed and correctly included as full path).

Regards

Erwin

  • Hi,

    When you re-run CMake, it will still use some cached information from earlier builds, including file paths.

    Therefore, when you move the project to a new location, you need to do a pristine build. You can do that by selecting the "Clean build directory" checkbox, or by deleting the build folder manually (or selecting a new one).

    Best regards,

    Didrik

  • That makes sense, but doesn't work when I re-run CMake without having anything changed. My observation was: I create the project new, it then compiles and then I press CMake in the run Menu. And this CMake then fails.

    Strange.

  • ErwinCes said:
    My observation was: I create the project new, it then compiles and then I press CMake in the run Menu. And this CMake then fails.

    That is strange. I tried to reproduce it, but wasn't able.

    Do you get the error when using unmodified (other than moving them) samples?

    Where do you move them from, and where do you move them to?

    Do you open SES from the Toolchain Manager?

    Do you see the same error if you build with West on the command line?

  • I changed to a different browser (now edge) as with firefox a logout was not possible. It ended in an endless weblink loop. Now with the new browswer.

    I have to say, that I haven't seen this error since two days anymore. So maybe we close this issue. For my other problems I will create different tickets.

Related