Skip to content

Commit c58c975

Browse files
degjorvaadeaarm
authored andcommitted
platform: nordic_nrf: Fix failing builds for 54L series
54L series was failing to build due to two different issues. First was incorrectly selected SECURE_UART for some devices. Updated so both uart20 and uart30 can be selected. Secondly was missing SHARED_BOOT_MEASURMENT_BASE. it is not used so set to 0 for relevant devices. Change-Id: I4c72bd5300eb58fd2bf95976f9f8cb9fd4d76b41 Signed-off-by: Dag Erik Gjørvad <dag.erik.gjorvad@nordicsemi.no>
1 parent bfa790f commit c58c975

File tree

13 files changed

+42
-10
lines changed

13 files changed

+42
-10
lines changed

platform/ext/target/nordic_nrf/common/core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ if(TFM_SPM_LOG_RAW_ENABLED)
151151
cmsis_drivers/Driver_USART.c
152152
${HAL_NORDIC_PATH}/nrfx/drivers/src/nrfx_uarte.c
153153
)
154+
endif()
154155

156+
if(TFM_SPM_LOG_RAW_ENABLED OR SECURE_UART1)
155157
target_compile_definitions(platform_s
156158
PUBLIC
157159
NRF_SECURE_UART_INSTANCE=${NRF_SECURE_UART_INSTANCE}

platform/ext/target/nordic_nrf/common/core/target_cfg_54l.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,19 @@ void peripheral_configuration(void)
288288
{
289289
#if SECURE_UART1
290290
/* Configure TF-M's UART peripheral to be secure */
291+
uint32_t uart_periph_start;
291292
#if NRF_SECURE_UART_INSTANCE == 00
292-
uint32_t uart_periph_start = tfm_peripheral_uarte00.periph_start;
293+
uart_periph_start = tfm_peripheral_uarte00.periph_start;
293294
#elif NRF_SECURE_UART_INSTANCE == 20
294-
uint32_t uart_periph_start = tfm_peripheral_uarte20.periph_start;
295+
uart_periph_start = tfm_peripheral_uarte20.periph_start;
295296
#elif NRF_SECURE_UART_INSTANCE == 21
296-
uint32_t uart_periph_start = tfm_peripheral_uarte21.periph_start;
297+
uart_periph_start = tfm_peripheral_uarte21.periph_start;
297298
#elif NRF_SECURE_UART_INSTANCE == 22
298-
uint32_t uart_periph_start = tfm_peripheral_uarte22.periph_start;
299+
uart_periph_start = tfm_peripheral_uarte22.periph_start;
299300
#elif NRF_SECURE_UART_INSTANCE == 30
300-
uint32_t uart_periph_start = tfm_peripheral_uarte30.periph_start;
301+
uart_periph_start = tfm_peripheral_uarte30.periph_start;
302+
#else
303+
#error "Unsupported NRF_SECURE_UART_INSTANCE for nrf54l series. Supported instances: 00, 20, 21, 22, 30"
301304
#endif
302305
spu_peripheral_config_secure(uart_periph_start, SPU_LOCK_CONF_LOCKED);
303306
#endif /* SECURE_UART1 */

platform/ext/target/nordic_nrf/common/nrf54l/config.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88

99
include(${PLATFORM_PATH}/common/core/config.cmake)
1010

11-
set(SECURE_UART20 ON CACHE BOOL "Enable secure UART")
1211
set(BL2 OFF CACHE BOOL "Whether to build BL2" FORCE)
1312
set(NRF_NS_SECONDARY OFF CACHE BOOL "Enable non-secure secondary partition" FORCE)
14-
set(NRF_SECURE_UART_INSTANCE 20 CACHE STRING "The UART instance number to use for secure UART")

platform/ext/target/nordic_nrf/common/nrf54l10/config.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88

99
include(${PLATFORM_PATH}/common/nrf54l/config.cmake)
1010

11+
set(NRF_SECURE_UART_INSTANCE 30 CACHE STRING "The UART instance number to use for secure UART" FORCE)

platform/ext/target/nordic_nrf/common/nrf54l10/partition/region_defs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@
9797
#define PSA_TEST_SCRATCH_AREA_SIZE (0x400)
9898

9999
/* Even though BL2 is not supported now this needs to be defined becaused it is used by scatter files */
100+
#define BOOT_TFM_SHARED_DATA_BASE S_RAM_ALIAS_BASE
100101
#define BOOT_TFM_SHARED_DATA_SIZE (0x0)
102+
#define BOOT_TFM_SHARED_DATA_LIMIT (BOOT_TFM_SHARED_DATA_BASE + BOOT_TFM_SHARED_DATA_SIZE - 1)
103+
#define SHARED_BOOT_MEASUREMENT_BASE BOOT_TFM_SHARED_DATA_BASE
104+
#define SHARED_BOOT_MEASUREMENT_SIZE BOOT_TFM_SHARED_DATA_SIZE
105+
#define SHARED_BOOT_MEASUREMENT_LIMIT BOOT_TFM_SHARED_DATA_LIMIT
101106

102107
#ifdef PSA_API_TEST_IPC
103108
/* Firmware Framework test suites */

platform/ext/target/nordic_nrf/common/nrf54l15/config.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88

99
include(${PLATFORM_PATH}/common/nrf54l/config.cmake)
1010

11+
sset(NRF_SECURE_UART_INSTANCE 30 CACHE STRING "The UART instance number to use for secure UART" FORCE)

platform/ext/target/nordic_nrf/common/nrf54l15/partition/region_defs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@
9797
#define PSA_TEST_SCRATCH_AREA_SIZE (0x400)
9898

9999
/* Even though BL2 is not supported now this needs to be defined becaused it is used by scatter files */
100+
#define BOOT_TFM_SHARED_DATA_BASE S_RAM_ALIAS_BASE
100101
#define BOOT_TFM_SHARED_DATA_SIZE (0x0)
102+
#define BOOT_TFM_SHARED_DATA_LIMIT (BOOT_TFM_SHARED_DATA_BASE + BOOT_TFM_SHARED_DATA_SIZE - 1)
103+
#define SHARED_BOOT_MEASUREMENT_BASE BOOT_TFM_SHARED_DATA_BASE
104+
#define SHARED_BOOT_MEASUREMENT_SIZE BOOT_TFM_SHARED_DATA_SIZE
105+
#define SHARED_BOOT_MEASUREMENT_LIMIT BOOT_TFM_SHARED_DATA_LIMIT
101106

102107
#ifdef PSA_API_TEST_IPC
103108
/* Firmware Framework test suites */

platform/ext/target/nordic_nrf/common/nrf54lm20a/config.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88

99
include(${PLATFORM_PATH}/common/nrf54l/config.cmake)
1010

11+
# Override UART instance for nRF54LM20A - it uses UART30, not UART20
12+
set(NRF_SECURE_UART_INSTANCE 30 CACHE STRING "The UART instance number to use for secure UART" FORCE)

platform/ext/target/nordic_nrf/common/nrf54lm20a/partition/region_defs.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#define S_DATA_LIMIT (S_DATA_START + S_DATA_SIZE - 1)
5555

5656
/* Copied from the CONFIG_TFM_S_CODE_VECTOR_TABLE_SIZE in sdk-nrf */
57-
#define S_CODE_VECTOR_TABLE_SIZE (0x47C)
57+
#define S_CODE_VECTOR_TABLE_SIZE (0x4D0)
5858

5959
#if defined(NULL_POINTER_EXCEPTION_DETECTION) && S_CODE_START == 0
6060
/* If this image is placed at the beginning of flash make sure we
@@ -97,7 +97,12 @@
9797
#define PSA_TEST_SCRATCH_AREA_SIZE (0x400)
9898

9999
/* Even though BL2 is not supported now this needs to be defined becaused it is used by scatter files */
100+
#define BOOT_TFM_SHARED_DATA_BASE S_RAM_ALIAS_BASE
100101
#define BOOT_TFM_SHARED_DATA_SIZE (0x0)
102+
#define BOOT_TFM_SHARED_DATA_LIMIT (BOOT_TFM_SHARED_DATA_BASE + BOOT_TFM_SHARED_DATA_SIZE - 1)
103+
#define SHARED_BOOT_MEASUREMENT_BASE BOOT_TFM_SHARED_DATA_BASE
104+
#define SHARED_BOOT_MEASUREMENT_SIZE BOOT_TFM_SHARED_DATA_SIZE
105+
#define SHARED_BOOT_MEASUREMENT_LIMIT BOOT_TFM_SHARED_DATA_LIMIT
101106

102107
#ifdef PSA_API_TEST_IPC
103108
/* Firmware Framework test suites */

platform/ext/target/nordic_nrf/common/nrf54lv10a/config.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88

99
include(${PLATFORM_PATH}/common/nrf54l/config.cmake)
1010

11+
set(NRF_SECURE_UART_INSTANCE 20 CACHE STRING "The UART instance number to use for secure UART" FORCE)

0 commit comments

Comments
 (0)