Compiler says auto-generated .h-file for custom secure partition doesn't exist, but it does exist in the filesystem (fatal error: "No such file or directory")

I'm trying to build a custom secure partition, but get the following error when building:

/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.c:26:10: fatal error: psa_manifest/tfm_custompartitiontest.h: No such file or directory
   26 | #include "psa_manifest/tfm_custompartitiontest.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.


However when navigating in files to the directory the file "tfm_custompartitiontest.h" exists and is in the correct "psa_manifest" directory.
According to its timestamp it also was auto-generated just before the "load_info_tfm_custompartitiontest.c"-file was generated (that is read by the compiler and references the .h file, leading to the error No such file or directory) so the .h file definitely already exists at the moment it should exist.

EDIT: The error is possibly because the compiler ("arm-zephyr-eabi-gcc" from the toolchain) doesn't add the generated directory to the directories to be searched for headers using the I flag. (The full, very long compiler command as outputted by the terminal is pasted below in a reply.)
It does add the directory of the original source code of custom partition itself to the directories to be searched using the I flag ("-I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/custompartitiontest").
But i think it doesn't add the directory of the auto-generated files of the custom-partition to the directories to be searched.

For other partitions a flag like the following exists (this is for protected_storage, but also exists for many other partitions):

"-I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/protected_storage"

However for custompartitiontest it doesn't seem to have been included.

However I don't know how to add it/what file needs to be modified so that the compiler adds the I flag for the generated directory.
Does anybody know how the error might be fixed?

(Just for completeness here the full file-structure in the folder under /home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/custompartitiontest/ with timestamps is:
-auto_generated (folder)
--intermedia_tfm_custompartitiontest.c (Timestamp: 2024-06-10 11:40:26.323433245 +0200)
--load_info_tfm_custompartitiontest.c (Timestamp: 2024-06-10 11:40:26.327433245 +0200)
-psa_manifest (folder)
--tfm_custompartitiontest.h (Timestamp: 2024-06-10 11:40:26.323433245 +0200)
)

Thanks in advance for any help

Parents


  • Heres the full, very-long compiler-command from the VS-Code Terminal.
    (As one can see the compiler ("arm-zephyr-eabi-gcc") from the toolchain is called with extermely many arguments.)

    [...]
    [14/230] Building C object secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/internal_trusted_storage/auto_generated/load_info_tfm_internal_trusted_storage.o
    [15/230] Building C object secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o
    FAILED: secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o
    /home/usern/ncs/toolchains/2be090971e/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -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_CONNECTION_POOL_ENABLE -DCONFIG_TFM_FLOAT_ABI=0 -DCONFIG_TFM_PARTITION_META -DCONFIG_TFM_USE_TRUSTZONE -DCRYPTO_HW_ACCELERATOR -DDAUTH_CHIP_DEFAULT -DENABLE_HEAP -DMBEDTLS_PSA_CRYPTO_BUILTIN_KEYS -DMBEDTLS_PSA_CRYPTO_DRIVERS -DNRF9120_XXAA -DNRF91_SERIES -DNRF_ALLOW_NON_SECURE_FAULT_HANDLING -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_COUNTERS -DPLATFORM_DEFAULT_OTP -DPLATFORM_NS_NV_COUNTERS=0 -DPROJECT_CONFIG_HEADER_FILE=\"/home/usern/testapplicationone/build_1/modules/nrf/modules/trusted-firmware-m/tfm_config.h\" -DPSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY -DPS_CRYPTO_AEAD_ALG=PSA_ALG_CCM -DPS_CRYPTO_AEAD_ALG_CCM -DPS_ENCRYPTION -DSECURE_UART1 -DTFM_EXCEPTION_INFO_DUMP -DTFM_FIH_PROFILE_OFF -DTFM_ISOLATION_LEVEL=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__ -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/core -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/core/arch -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/include/boot -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/include/interface -I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/crypto -I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/protected_storage -I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/internal_trusted_storage -I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/platform -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/protected_storage -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/internal_trusted_storage/../protected_storage -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/. -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/native_drivers -I/home/usern/ncs/modules/hal/nordic/nrfx -I/home/usern/ncs/modules/hal/nordic/nrfx/mdk -I/home/usern/ncs/modules/hal/nordic/nrfx/drivers/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/common -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/.. -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/services/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf91/. -I/home/usern/ncs/nrf/modules/trusted-firmware-m/tfm_boards/include -I/home/usern/ncs/nrf/modules/trusted-firmware-m/tfm_boards/partition -I/home/usern/testapplicationone/build_1/tfm/../zephyr/include/generated -I/home/usern/ncs/nrf/modules/trusted-firmware-m/tfm_boards/board -I/home/usern/testapplicationone/build_1/tfm/../zephyr/misc/generated/syscalls_links/include -I/home/usern/ncs/zephyr/include -I/home/usern/ncs/nrf/modules/trusted-firmware-m/tfm_boards/services/include -I/home/usern/ncs/nrf/include -I/home/usern/ncs/nrf/include/tfm -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/accelerator/interface -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/cmsis -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/common -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/driver -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/config -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/crypto -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/firmware_update -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/initial_attestation -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/internal_trusted_storage -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/platform -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/custompartitiontest -I/home/usern/testapplicationone/build_1/tfm/generated/interface/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/lib/fih/inc -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/interface/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/lib/runtime/include -mcpu=cortex-m33+nofp -g -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 -mfloat-abi=soft -mcmse -Wno-unused-value -include /home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/include/cmsis_override.h -MD -MT secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o -MF secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o.d -o secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o -c /home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.c
    /home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.c:26:10: fatal error: psa_manifest/tfm_custompartitiontest.h: No such file or directory
       26 | #include "psa_manifest/tfm_custompartitiontest.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    [...]

Reply


  • Heres the full, very-long compiler-command from the VS-Code Terminal.
    (As one can see the compiler ("arm-zephyr-eabi-gcc") from the toolchain is called with extermely many arguments.)

    [...]
    [14/230] Building C object secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/internal_trusted_storage/auto_generated/load_info_tfm_internal_trusted_storage.o
    [15/230] Building C object secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o
    FAILED: secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o
    /home/usern/ncs/toolchains/2be090971e/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -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_CONNECTION_POOL_ENABLE -DCONFIG_TFM_FLOAT_ABI=0 -DCONFIG_TFM_PARTITION_META -DCONFIG_TFM_USE_TRUSTZONE -DCRYPTO_HW_ACCELERATOR -DDAUTH_CHIP_DEFAULT -DENABLE_HEAP -DMBEDTLS_PSA_CRYPTO_BUILTIN_KEYS -DMBEDTLS_PSA_CRYPTO_DRIVERS -DNRF9120_XXAA -DNRF91_SERIES -DNRF_ALLOW_NON_SECURE_FAULT_HANDLING -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_COUNTERS -DPLATFORM_DEFAULT_OTP -DPLATFORM_NS_NV_COUNTERS=0 -DPROJECT_CONFIG_HEADER_FILE=\"/home/usern/testapplicationone/build_1/modules/nrf/modules/trusted-firmware-m/tfm_config.h\" -DPSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY -DPS_CRYPTO_AEAD_ALG=PSA_ALG_CCM -DPS_CRYPTO_AEAD_ALG_CCM -DPS_ENCRYPTION -DSECURE_UART1 -DTFM_EXCEPTION_INFO_DUMP -DTFM_FIH_PROFILE_OFF -DTFM_ISOLATION_LEVEL=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__ -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/core -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/core/arch -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/include/boot -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/spm/include/interface -I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/crypto -I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/protected_storage -I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/internal_trusted_storage -I/home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/platform -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/protected_storage -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/internal_trusted_storage/../protected_storage -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/. -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/native_drivers -I/home/usern/ncs/modules/hal/nordic/nrfx -I/home/usern/ncs/modules/hal/nordic/nrfx/mdk -I/home/usern/ncs/modules/hal/nordic/nrfx/drivers/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/common -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/.. -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/services/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf91/. -I/home/usern/ncs/nrf/modules/trusted-firmware-m/tfm_boards/include -I/home/usern/ncs/nrf/modules/trusted-firmware-m/tfm_boards/partition -I/home/usern/testapplicationone/build_1/tfm/../zephyr/include/generated -I/home/usern/ncs/nrf/modules/trusted-firmware-m/tfm_boards/board -I/home/usern/testapplicationone/build_1/tfm/../zephyr/misc/generated/syscalls_links/include -I/home/usern/ncs/zephyr/include -I/home/usern/ncs/nrf/modules/trusted-firmware-m/tfm_boards/services/include -I/home/usern/ncs/nrf/include -I/home/usern/ncs/nrf/include/tfm -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/accelerator/interface -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/cmsis -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/common -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/driver -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/config -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/crypto -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/firmware_update -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/initial_attestation -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/internal_trusted_storage -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/platform -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/custompartitiontest -I/home/usern/testapplicationone/build_1/tfm/generated/interface/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/lib/fih/inc -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/interface/include -I/home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/secure_fw/partitions/lib/runtime/include -mcpu=cortex-m33+nofp -g -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 -mfloat-abi=soft -mcmse -Wno-unused-value -include /home/usern/ncs/modules/tee/tf-m/trusted-firmware-m/platform/include/cmsis_override.h -MD -MT secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o -MF secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o.d -o secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.o -c /home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.c
    /home/usern/testapplicationone/build_1/tfm/generated/secure_fw/partitions/custompartitiontest/auto_generated/load_info_tfm_custompartitiontest.c:26:10: fatal error: psa_manifest/tfm_custompartitiontest.h: No such file or directory
       26 | #include "psa_manifest/tfm_custompartitiontest.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    [...]

Children
No Data
Related