Babblesim fails to compile with CONFIG_NRF_SECURITY

I am trying to compile my custom BLE application into Babblesim using the nrf5340bsim/nrf5340/cpuapp board in nRF Connect SDK v3.1.0. The application uses PSA Cryptography and includes NRF_SECURITY, however this is the Kconfig warning I get and subsequent psa/crypto.h include errors.

warning: NRF_SECURITY (defined at
/home/jai/Projects/Repositories/mono/firmware/external-3.1.0/nrf/subsys/nrf_security/Kconfig:32) was
assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies:
SOC_FAMILY_NORDIC_NRF (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NRF_SECURITY and/or look up NRF_SECURITY in
the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.

This is my build command:

west build -b nrf5340bsim/nrf5340/cpuapp --sysbuild

Header file include error:

fatal error: psa/crypto.h: No such file or directory
   17 | #include <psa/crypto.h>
      |          ^~~~~~~~~~~~~~

Let me know if anyone has tried to include NRF_SECURITY into a BabbleSim application or seen this before. Thank you!

I can also try to open an issue into the BabbleSim github if that is more appropriate

  • Hi Jaideep,
    NRF_SECURITY requires nRF hardware and is not available on BabbleSim.

    From a recent ticket that may also be relevant:

    The nrf52_bsim and nrf5340bsim simulation models are provided by Zephyr but are not officially supported by Nordic. The BabbleSim environment offers useful benefits, but the models are imperfect. You may miss real-world issues or see false positives due to simulation limitations. For this reason, I generally wouldn’t recommend BabbleSim as a primary test tool for most projects. It also requires using Zephyr’s Link Layer (LL) instead of the SoftDevice Controller, which is used in actual products. This further increases the gap between simulated behavior and real-world performance.

    Best regards,
    Benjamin
Related