Hi Roman,
The patch has increased the TARGET_CONFIG priority over PROJECT_CONFIG, and added #ifndef to the profile configuration files.
But this #undef/#define approach is not safe
#undef/#define approach is not needed as we use #ifndef for all default values.
It means that project developer need to #undef ITS_STACK_SIZE
The default ITS_STACK_SIZE is defined by a profile configuration.
If needed, any parameter defined in a profile or in the default configuration can be changed in TARGET_CONFIG without #undef.
Best regards,
Andrej
From: Roman.Mazurak@infineon.com Roman.Mazurak@infineon.com Sent: Friday, June 30, 2023 1:12 PM To: tf-m@lists.trustedfirmware.org Cc: Andrej Butok andrey.butok@nxp.com; Kevin.Peng@arm.com Subject: Configuration order
Hi Andrey,
Patch 21339 https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freview.tr ustedfirmware.org%2Fc%2FTF-M%2Ftrusted-firmware-m%2F%2B%2F21339&data=05%7C01 %7Candrey.butok%40nxp.com%7Cf7d7e96c5f5e48a9c18d08db795adb9e%7C686ea1d3bc2b4 c6fa92cd99c5c301635%7C0%7C0%7C638237203364270586%7CUnknown%7CTWFpbGZsb3d8eyJ WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C %7C&sdata=H%2FKzCsu%2Fq8diNNzufHNFwMq834uHejp88LHYufnifRY%3D&reserved=0 introduced changes of configuration order:
1. Platform configuration via TARGET_CONFIG_HEADER_FILE. 2. Project configuration via PROJECT_CONFIG_HEADER_FILE 3. config_base.h
It means that target can't change configuration that is expected to be changed by project. Example:
a. Platform must redefine ITS_STACK_SIZE to satisfy driver requirements. The good way for this is to set ITS_STACK_SIZE in config_tfm_target.h. b. Project developer need to perform some additional debugging or profiling of the product, so the TF-M must be built with extra code that require additional stack size. It means that project developer need to #undef ITS_STACK_SIZE and then redefine it using #define ITS_STACK_SIZE. But this #undef/#define approach is not safe, because it's possible to calculate some other settings using configuration variable in config_tfm_target.h or perform additional configuration validation by config_tfm_target.h.
It looks like the new changes created another bunch of problems for TF-M configuration.
Regards,
Roman.