This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Activating CONFIG_NORDIC_SECURITY_BACKEND to use nrf_oberon library does not work

I'm trying to activate 

CONFIG_NORDIC_SECURITY_BACKEND
 because I want to use the HKDF of the nrf_oberon library.
But when I try to compile with CMake and the target zephyr_final I get the following error:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/USER/.local/lib/python3.8/site-packages/west/manifest.py", line 1102, in from_file
    topdir = util.west_topdir()
  File "/home/USER/.local/lib/python3.8/site-packages/west/util.py", line 79, in west_topdir
    return west_topdir(os.environ['ZEPHYR_BASE'],
  File "/home/USER/.local/lib/python3.8/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
-- PYTHON EXECUTABLE /usr/bin/python3.8
-- WEST_PROJECT_OUTPUT 
-- RESULT 1
CMake Error at /home/morten/nordic/ncs/v1.5.1/nrfxlib/common.cmake:61 (message):
  Failed to find mbedtls, cannot build security libraries
Call Stack (most recent call first):
  /home/USER/nordic/ncs/v1.5.1/nrfxlib/nrf_security/CMakeLists.txt:29 (get_mbedtls_dir)

So apparently the path to mbedtls is not found via the command that is issued.
But when I issue the command in the console it works as I believe it should and gives the path to the library.
When I view it is there and the files needed also seem to be there.

$ /usr/bin/python3.8 -c "from west.manifest import Manifest; manifest = Manifest.from_file(); print(manifest.get_projects(['mbedtls-nrf'])[0].posixpath)"                                                                                                   dev_branch
/home/morten/nordic/ncs/v1.5.1/mbedtls 

Also I'm using CLion on Linux and followed this (blog.jetbrains.com/.../) tutorial to setup the project.
Any tips what I could do to fix this problem are really appreciated.

Regards,
Mort

Here is the complete CMake Output:

/home/USER/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/211.6693.114/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=ZDebug -DCMAKE_C_COMPILER=/home/USER/gnuarmemb/bin/arm-none-eabi-gcc -DCMAKE_CXX_COMPILER=/home/USER/gnuarmemb/bin/arm-none-eabi-g++ -G Ninja /home/USER/git/PROJECT-nrf52
Including boilerplate (Zephyr base): /home/USER/nordic/ncs/v1.5.1/zephyr/cmake/app/boilerplate.cmake
-- Application: /home/USER/git/PROJECT-nrf52
-- Zephyr version: 2.4.99 (/home/USER/nordic/ncs/v1.5.1/zephyr)
-- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.5") found components: Interpreter 
-- Found west (found suitable version "0.10.1", minimum required is "0.7.1")
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: /home/USER/.cache/zephyr
-- Found toolchain: gnuarmemb (/home/USER/gnuarmemb)
-- Found BOARD.dts: /home/USER/nordic/ncs/v1.5.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Generated zephyr.dts: /home/USER/git/PROJECT-nrf52/cmake-build-zdebug-nrf-connect-sdk-v151/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/USER/git/PROJECT-nrf52/cmake-build-zdebug-nrf-connect-sdk-v151/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/USER/git/PROJECT-nrf52/cmake-build-zdebug-nrf-connect-sdk-v151/zephyr/include/generated/device_extern.h
Parsing /home/USER/git/PROJECT-nrf52/Kconfig
/home/USER/nordic/ncs/v1.5.1/zephyr/scripts/kconfig/kconfig.py: [Errno 21] Is a directory: '/home/USER/git/PROJECT-nrf52/Kconfig'
CMake Error at /home/USER/nordic/ncs/v1.5.1/zephyr/cmake/kconfig.cmake:262 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /home/USER/nordic/ncs/v1.5.1/zephyr/cmake/app/boilerplate.cmake:534 (include)
  /home/USER/nordic/ncs/v1.5.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/USER/nordic/ncs/v1.5.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:30 (find_package)

And here are the contents of the mbedtls folder:

[~/nordic/ncs/v1.5.1/mbedtls] $ ls -a             tags/mbedtls-2.24.0
.            CMakeLists.txt         docs        .globalrc  programs   .travis.yml
..           configs                doxygen     include    .pylintrc  visualc
3rdparty     CONTRIBUTING.md        .git        library    README.md
ChangeLog    DartConfiguration.tcl  .github     LICENSE    scripts
ChangeLog.d  dco.txt                .gitignore  Makefile   tests

Related