Skip to content

Commit bb701d5

Browse files
ahmadstmd3zd3z
authored andcommitted
platform: stm32wba65i_dk: Fix install for STM32_FLASH_LAYOUT_BEGIN_OFFSET
Install a flash_layout.h header file that consider the value of build directive STM32_FLASH_LAYOUT_BEGIN_OFFSET passed when building TF-M. Without this change, generic code building non-secure application, like when Zephyr builds TF-M regression test non-secure application, do not consider this directive and use flash_layout.h as if STM32_FLASH_LAYOUT_BEGIN_OFFSET was 0. Signed-off-by: Ahmad EL JOUAID <[email protected]> Change-Id: Icc20b09041f7bcb0287c932e6a2a13f6fa73e268 (cherry picked from commit eed47eff0e5ab8cac2126e24cb4e84e1148a9f68)
1 parent e35253f commit bb701d5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

platform/ext/target/stm/stm32wba65i_dk/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,22 @@ install(DIRECTORY ${STM_COMMON_DIR}/hal/accelerator/
6363
FILES_MATCHING PATTERN "*.h")
6464

6565
install(FILES
66-
${STM32WBA65I_DK_DIR}/partition/flash_layout.h
6766
${STM32WBA65I_DK_DIR}/partition/region_defs.h
6867
DESTINATION ${INSTALL_PLATFORM_NS_DIR}/partition
6968
)
7069

70+
# Install a flash_layout.h header file that consider STM32_FLASH_LAYOUT_BEGIN_OFFSET
71+
# TF-M was built with.
72+
install(FILES
73+
${STM32WBA65I_DK_DIR}/partition/flash_layout.h
74+
DESTINATION ${INSTALL_PLATFORM_NS_DIR}/partition/gen_layout
75+
)
76+
77+
file(WRITE ${INSTALL_PLATFORM_NS_DIR}/partition/flash_layout.h
78+
"#define STM32_FLASH_LAYOUT_BEGIN_OFFSET ${STM32_FLASH_LAYOUT_BEGIN_OFFSET}\n"
79+
"#include \"gen_layout/flash_layout.h\"\n"
80+
)
81+
7182
install(DIRECTORY ${PLATFORM_DIR}/ext/common
7283
${PLATFORM_DIR}/ext/driver
7384
DESTINATION ${INSTALL_PLATFORM_NS_DIR}/ext)

0 commit comments

Comments
 (0)