From 2eaef86577d75cc032e7782eaf0d5b2c43af762e Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Wed, 23 Sep 2020 11:20:48 +0200 Subject: [PATCH] boards: nucleo_l552ze_q: do not offset the image by default by 0x400. We only need to offset the start of the non-secure image by 0x400, if TFM is built with BL2 support. In this case we use the ROM_START_OFFSET Kconfig switch and we set it to 0x400, which is the default BL2 Header size value in TF-M builds. This instructs the linker to offset the beginning of the ROM section by 0x400. In other words, we do not need to statically move the start of the image by 0x400 (using FLASH_BASE_ADDRESS or FLASH_LOAD_OFFSET) when building for nucleo_l552ze_q 'non-secure'. This fixes an issue that prevents from running Zephyr + TFM without BL2 support. Signed-off-by: Ioannis Glaropoulos --- boards/arm/nucleo_l552ze_q/CMakeLists.txt | 1 + boards/arm/nucleo_l552ze_q/nucleo_l552ze_q_ns_defconfig | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/boards/arm/nucleo_l552ze_q/CMakeLists.txt b/boards/arm/nucleo_l552ze_q/CMakeLists.txt index ea2a2793098..1aa45b8f214 100644 --- a/boards/arm/nucleo_l552ze_q/CMakeLists.txt +++ b/boards/arm/nucleo_l552ze_q/CMakeLists.txt @@ -51,6 +51,7 @@ if (CONFIG_BUILD_WITH_TFM) ${ADD_S_IMAGE_MIN_VER} ${ADD_SECURITY_COUNTER_NS} -H 0x400 + --included-header ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_BIN_NAME} ${CMAKE_BINARY_DIR}/zephyr_ns_signed.bin diff --git a/boards/arm/nucleo_l552ze_q/nucleo_l552ze_q_ns_defconfig b/boards/arm/nucleo_l552ze_q/nucleo_l552ze_q_ns_defconfig index f04d5caa0eb..230fbf5fb5d 100644 --- a/boards/arm/nucleo_l552ze_q/nucleo_l552ze_q_ns_defconfig +++ b/boards/arm/nucleo_l552ze_q/nucleo_l552ze_q_ns_defconfig @@ -50,5 +50,5 @@ CONFIG_CORTEX_M_SYSTICK=y CONFIG_RUNTIME_NMI=y CONFIG_TRUSTED_EXECUTION_NONSECURE=y # Flash configuration for TFM -CONFIG_FLASH_LOAD_OFFSET=0x51400 -CONFIG_FLASH_LOAD_SIZE=0x2E000 +CONFIG_FLASH_LOAD_OFFSET=0x51000 +CONFIG_FLASH_LOAD_SIZE=0x2E400