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 <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2020-09-23 11:20:48 +02:00
parent 407ebf8132
commit 2eaef86577
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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