Error with compiling the nrf/samples/net/http_client sample

I have a Fanstel LEW40E5P, which has an nRF9160 and nRF5340. I'm currently trying to compile a project for the nRF9160 (just build/compile, not load onto the module). Compiling on Windows 11 Pro with nRF Connect version 2.5.0, installed to C:\ncs\v2.5.0. This is a fresh install of the SDK/CLI/Extensions.

I created a new application from the nrf/samples/net/http_client sample and set the build target as the "nrf9160dk_nrf9160_ns" board (it's not identical to this Fanstel board, but close enough that the functionality should work since I'm not using any GPIOs for anything, and note that this shouldn't be relevant to the issue because the error occurs while building, not loading/running). My build configuration looks like this:

When I build this, I get the following error:

...
[53/208] Building C object secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/CMakeFiles/crypto_service_mbedcrypto.dir/C_/ncs/v2.5.0/nrf/ext/oberon/psa/core/library/psa_crypto_slot_management.o
FAILED: secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/CMakeFiles/crypto_service_mbedcrypto.dir/C_/ncs/v2.5.0/nrf/ext/oberon/psa/core/library/psa_crypto_slot_management.o
C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DBL1_HEADER_SIZE=0x000 -DBL1_TRAILER_SIZE=0x000 -DBL2_HEADER_SIZE=0x000 -DBL2_TRAILER_SIZE=0x000 -DCONFIG_HW_UNIQUE_KEY -DCONFIG_HW_UNIQUE_KEY_RANDOM -DCONFIG_TFM_FLOAT_ABI=0 -DCONFIG_TFM_PARTITION_META -DCONFIG_TFM_USE_TRUSTZONE -DCRYPTO_HW_ACCELERATOR -DDAUTH_CHIP_DEFAULT -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_BUILTIN_KEYS -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"C:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/lib/ext/mbedcrypto/mbedcrypto_config/crypto_config_default.h\" -DMBEDTLS_PSA_CRYPTO_DRIVERS -DMBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF91_SERIES -DNRF_ALLOW_NON_SECURE_RESET -DNRF_NS_STORAGE -DNRF_SECURE_UART_INSTANCE=1 -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DPLATFORM_DEFAULT_BL1 -DPLATFORM_DEFAULT_NV_SEED -DPLATFORM_DEFAULT_OTP -DPLATFORM_NS_NV_COUNTERS=0 -DPROJECT_CONFIG_HEADER_FILE=\"C:/Users/mypath/https_client/build/modules/nrf/modules/tfm/zephyr/tfm_config.h\" -DPSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER -DPSA_CRYPTO_SECURE -DPS_CRYPTO_AEAD_ALG_CCM -DPS_ENCRYPTION -DSECURE_UART1 -DTFM_FIH_PROFILE_OFF -DTFM_LVL=1 -DTFM_PARTITION_CRYPTO -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE -DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_INFO -DTFM_PARTITION_NS_AGENT_TZ -DTFM_PARTITION_PLATFORM -DTFM_PARTITION_PROTECTED_STORAGE -DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_INFO -DTFM_SPM_LOG_RAW_ENABLED -DTFM_SP_LOG_RAW_ENABLED -D__NRF_TFM__ -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/crypto -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/crypto/psa_driver_api -Isecure_fw/partitions/crypto/mbedcrypto/nrf_security_src/include/generated -IC:/ncs/v2.5.0/nrf/subsys/nrf_security/tfm/../include -IC:/ncs/v2.5.0/nrf/ext/oberon/psa/core/include -IC:/ncs/v2.5.0/nrf/ext/oberon/psa/core/library -IC:/ncs/v2.5.0/modules/crypto/mbedtls/include -IC:/ncs/v2.5.0/modules/crypto/mbedtls/library -IC:/ncs/v2.5.0/nrf/subsys/nrf_security/src/drivers/nrf_cc3xx/include -IC:/ncs/v2.5.0/nrfxlib/crypto/nrf_cc310_mbedcrypto/include -IC:/ncs/v2.5.0/nrfxlib/crypto/nrf_cc310_mbedcrypto/include/mbedtls -IC:/ncs/v2.5.0/nrf/subsys/nrf_security/tfm/../../../../nrfxlib/crypto/nrf_oberon/include -IC:/ncs/v2.5.0/nrf/subsys/nrf_security/tfm/../../../../nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/ncs/v2.5.0/nrf/ext/oberon/psa/drivers -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/interface/include -Igenerated/interface/include -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/config -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/include -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/firmware_update -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/initial_attestation -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/internal_trusted_storage -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/platform -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/protected_storage -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/include -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/. -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/native_drivers -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.5.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/common -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/.. -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/services/include -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf91/. -IC:/ncs/v2.5.0/nrf/modules/tfm/tfm/boards/include -IC:/ncs/v2.5.0/nrf/modules/tfm/tfm/boards/partition -I../zephyr/include/generated -IC:/ncs/v2.5.0/nrf/modules/tfm/tfm/boards/board -I../zephyr/misc/generated/syscalls_links/include -IC:/ncs/v2.5.0/zephyr/include -IC:/ncs/v2.5.0/nrf/modules/tfm/tfm/boards/services/include -IC:/ncs/v2.5.0/nrf/include -IC:/ncs/v2.5.0/nrf/include/tfm -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/ext/accelerator/interface -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/./ext -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/./ext/cmsis -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/./ext/common -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/./ext/driver -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/./include -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/ext/common -IC:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/lib/fih/inc -isystem C:/ncs/v2.5.0/nrfxlib/crypto/nrf_cc310_platform/include -isystem C:/ncs/v2.5.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -isystem C:/ncs/v2.5.0/nrfxlib/crypto/nrf_oberon/include -mcpu=cortex-m33+nodsp+nofp -Os -DNDEBUG -fmacro-prefix-map=C:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/../tf-m-tests=TFM_TEST_REPO_PATH -specs=nano.specs -Wall -Wno-format -Wno-return-type -Wno-unused-but-set-variable -c -fdata-sections -ffunction-sections -fno-builtin -fshort-enums -funsigned-char -mthumb -nostdlib -std=c99 -gdwarf-4 -g -imacros C:/Users/mypath/https_client/build/zephyr/include/generated/autoconf.h -Wno-unused-function -Wno-unused-variable -Wno-stringop-overflow -Wno-stringop-overread -Wno-strict-aliasing -Wno-unused-const-variable -Wno-unused-parameter -mfloat-abi=soft -mcmse -Wno-unused-value -include C:/ncs/v2.5.0/modules/tee/tf-m/trusted-firmware-m/platform/include/cmsis_override.h -MD -MT secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/CMakeFiles/crypto_service_mbedcrypto.dir/C_/ncs/v2.5.0/nrf/ext/oberon/psa/core/library/psa_crypto_slot_management.o -MF secure_fw\partitions\crypto\mbedcrypto\nrf_security_src\CMakeFiles\crypto_service_mbedcrypto.dir\C_\ncs\v2.5.0\nrf\ext\oberon\psa\core\library\psa_crypto_slot_management.o.d -o secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/CMakeFiles/crypto_service_mbedcrypto.dir/C_/ncs/v2.5.0/nrf/ext/oberon/psa/core/library/psa_crypto_slot_management.o -c C:/ncs/v2.5.0/nrf/ext/oberon/psa/core/library/psa_crypto_slot_management.c
C:\ncs\v2.5.0\nrf\ext\oberon\psa\core\library\psa_crypto_slot_management.c:577:1: fatal error: opening dependency file secure_fw\partitions\crypto\mbedcrypto\nrf_security_src\CMakeFiles\crypto_service_mbedcrypto.dir\C_\ncs\v2.5.0\nrf\ext\oberon\psa\core\library\psa_crypto_slot_management.o.d: No such file or directory
577 | }
| ^
compilation terminated.
ninja: build stopped: subcommand failed.
FAILED: modules/trusted-firmware-m/tfm-prefix/src/tfm-stamp/tfm-build tfm/secure_fw/s_veneers.o tfm/tf-m-tests/app/libtfm_api_ns.a tfm/generated/interface/include/psa_manifest/sid.h tfm/platform/ns/libplatform_ns.a tfm/bin/tfm_s.elf tfm/bin/tfm_s.bin tfm/bin/tfm_s.hex tfm/bin/tfm_ns.bin tfm/bin/tfm_ns.hex tfm/bin/tfm_s_signed.bin tfm/bin/tfm_ns_signed.bin tfm/bin/tfm_s_ns_signed.bin tfm/install/interface/src/tfm_attest_api.c tfm/install/interface/src/tfm_crypto_api.c tfm/install/interface/src/tfm_fwu_api.c tfm/install/interface/src/tfm_its_api.c tfm/install/interface/src/tfm_platform_api.c tfm/install/interface/src/tfm_ps_api.c tfm/install/interface/src/tfm_psa_ns_api.c tfm/install/interface/src/tfm_ioctl_core_ns_api.c
cmd.exe /C "cd /D C:\Users\mypath\https_client\build\tfm && C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.exe --build . -j 1"
[10/315] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\Users\mypath\https_client\build'

Any ideas as to what might be going on here? I have also tried:

  • Reversing the order of the Kconfig fragments (board before "overlay-tfm_mbedtls.conf")
  • Not including "overlay-tfm_mbedtls.conf" fragment at all

Both of which fail with the same error.

Thanks!

  • Hi,

     

    We have recently found an issue with the project generation in vscode, where it overwrites the prj.conf in cases where it is selected and additional kconfig fragments are selected.

    Could you try leaving the "Configuration" field as default? Like this:

     

    My apologies for the inconvenience, and I hope you have a great weekend!

     

    PS: I also did this in my above example, but you do not strictly need to add $BOARD.conf and $BOARD.overlay explicitly. These will be added automatic by the build-system.

     

    Kind regards,

    Håkon

  • Hi Hakon,

    After recalling that I had a similar issue on a previous project, I figured this may be an issue with path lengths. I was building from a project in the default Windows GitHub path of C:\Users\{USERNAME}\Documents\GitHub\{REPO}, so I created a symlink of that to C:\{REPO} and built from there, and it works without error.

    This path length issue is brutal and comes up often, and having to symlink or clone repos to the drive root is a workaround we shouldn't be dealing with in 2023. I respectfully request that Nordic take a closer look at this issue and try to find an alternative, such as not naming build files with the entire absolute path to the associated source file in the output filename, that allows us to use default (reasonable) source directory paths.

  • Yes, ofcourse, sorry for not spotting this earlier..

    Path length on windows can be a pain to debug so I fully understand your comment. I will forward your comment to our tools department.

     

    Hope you have a wonderful weekend when that time comes!

     

    Kind regards,

    Håkon

Related