Skip to content

Commit a2e3510

Browse files
committed
boards: st: nucleo_u5a5zj_q: Add support to TF-M
Introduce the TF-M support for the stm32u5a5xx SoC. Signed-off-by: BUDKE Gerson Fernando <[email protected]>
1 parent ed157a7 commit a2e3510

8 files changed

+200
-1
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2025
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_NUCLEO_U5A5ZJ_Q
5+
6+
config TFM_BOARD
7+
default "${ZEPHYR_BASE}/boards/st/nucleo_u5a5zj_q/tfm"
8+
9+
if BUILD_WITH_TFM
10+
11+
config USE_DT_CODE_PARTITION
12+
default y if TRUSTED_EXECUTION_NONSECURE
13+
14+
config TFM_INITIAL_ATTESTATION_KEY
15+
default y
16+
17+
# Disabled to show how to define custom keys,
18+
# see nucleo_u5a5zj_q_stm32u5a5xx_ns_defconfig
19+
config TFM_DUMMY_PROVISIONING
20+
default n
21+
22+
endif # BUILD_WITH_TFM
23+
24+
endif # BOARD_NUCLEO_U5A5ZJ_Q

boards/st/nucleo_u5a5zj_q/Kconfig.nucleo_u5a5zj_q

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023 STMicroelectronics
1+
# Copyright (c) 2025 STMicroelectronics
22
# SPDX-License-Identifier: Apache-2.0
33

44
config BOARD_NUCLEO_U5A5ZJ_Q

boards/st/nucleo_u5a5zj_q/board.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(CONFIG_BUILD_WITH_TFM)
4+
set(TFM_FLASH_BASE_ADDRESS 0x0C000000)
5+
6+
# Flash merged TF-M + Zephyr binary
7+
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
8+
9+
if (CONFIG_HAS_FLASH_LOAD_OFFSET)
10+
MATH(EXPR TFM_HEX_BASE_ADDRESS_NS "${TFM_FLASH_BASE_ADDRESS}+${CONFIG_FLASH_LOAD_OFFSET}")
11+
else()
12+
set(TFM_HEX_BASE_ADDRESS_NS ${TFM_TFM_FLASH_BASE_ADDRESS})
13+
endif()
14+
endif()
15+
116
# keep first
217
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
318

boards/st/nucleo_u5a5zj_q/board.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ board:
44
vendor: st
55
socs:
66
- name: stm32u5a5xx
7+
variants:
8+
- name: ns

boards/st/nucleo_u5a5zj_q/nucleo_u5a5zj_q.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
zephyr,flash = &flash0;
2222
zephyr,canbus = &fdcan1;
2323
zephyr,code-partition = &slot0_partition;
24+
zephyr,entropy = &rng;
2425
};
2526

2627
aliases {
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* Copyright (c) 2025 Leica Geosystems AG
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include "nucleo_u5a5zj_q-common.dtsi"
9+
10+
/ {
11+
model = "STMicroelectronics STM32U5A5ZJ-NUCLEO-Q board";
12+
compatible = "st,stm32u5a5zj-nucleo-q";
13+
14+
#address-cells = <1>;
15+
#size-cells = <1>;
16+
17+
chosen {
18+
zephyr,console = &usart1;
19+
zephyr,shell-uart = &usart1;
20+
zephyr,sram = &sram0;
21+
zephyr,flash = &flash0;
22+
zephyr,code-partition = &slot0_ns_partition;
23+
zephyr,entropy = &psa_rng;
24+
};
25+
26+
aliases {
27+
led0 = &blue_led_1;
28+
sw0 = &user_button;
29+
};
30+
31+
/* SRAM3 + SRAM5 (832 kiB + 832kiB)*/
32+
/delete-node/ memory@20000000;
33+
sram0: memory@200d0000 {
34+
compatible = "mmio-sram";
35+
reg = <0x200d0000 DT_SIZE_K(1664)>;
36+
};
37+
38+
psa_rng: psa-rng {
39+
compatible = "zephyr,psa-crypto-rng";
40+
status = "okay";
41+
};
42+
};
43+
44+
&flash0 {
45+
partitions {
46+
compatible = "fixed-partitions";
47+
#address-cells = <1>;
48+
#size-cells = <1>;
49+
50+
/*
51+
* Following flash partition is compatible with requirements
52+
* given in TFM configuration given for current board.
53+
* It might require adjustment depending on evolutions on TFM.
54+
*/
55+
boot_partition: partition@0 {
56+
label = "mcuboot";
57+
reg = <0x00000000 DT_SIZE_K(384)>;
58+
read-only;
59+
};
60+
61+
/* Secure image primary slot */
62+
slot0_partition: partition@60000 {
63+
label = "image-0";
64+
reg = <0x00060000 DT_SIZE_K(512)>;
65+
};
66+
67+
/* Non-secure image primary slot */
68+
slot0_ns_partition: partition@e0000 {
69+
label = "image-0-nonsecure";
70+
reg = <0x000e0000 DT_SIZE_K(1280)>;
71+
};
72+
73+
/* Secure image secondary slot */
74+
slot1_partition: partition@220000 {
75+
label = "image-1";
76+
reg = <0x00220000 DT_SIZE_K(512)>;
77+
};
78+
79+
/* Non-secure image secondary slot */
80+
slot1_ns_partition: partition@2a0000 {
81+
label = "image-1-nonsecure";
82+
reg = <0x002a0000 DT_SIZE_K(1280)>;
83+
};
84+
85+
/* Applicative Non Volatile Storage */
86+
storage_partition: partition@3e0000 {
87+
label = "storage";
88+
reg = <0x003e0000 DT_SIZE_K(128)>;
89+
};
90+
};
91+
};
92+
93+
&usart1 {
94+
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
95+
pinctrl-names = "default";
96+
current-speed = <115200>;
97+
status = "okay";
98+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Copyright (c) 2025 Leica Geosystems AG
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
identifier: nucleo_u5a5zj_q/stm32u5a5xx/ns
8+
name: ST Nucleo U5A5ZJ Q
9+
type: mcu
10+
arch: arm
11+
toolchain:
12+
- zephyr
13+
supported:
14+
- adc
15+
- backup_sram
16+
- can
17+
- dac
18+
- dma
19+
- gpio
20+
- i2c
21+
- rtc
22+
- spi
23+
- trusted-firmware-m
24+
- usart
25+
- usb_device
26+
- watchdog
27+
ram: 1664
28+
flash: 1280
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# Copyright (c) 2025 Leica Geosystems AG
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
# enable uart driver
8+
CONFIG_SERIAL=y
9+
10+
# enable GPIO
11+
CONFIG_GPIO=y
12+
13+
# console
14+
CONFIG_CONSOLE=y
15+
CONFIG_UART_CONSOLE=y
16+
17+
# Enable MPU
18+
CONFIG_ARM_MPU=y
19+
20+
# Enable HW stack protection
21+
CONFIG_HW_STACK_PROTECTION=y
22+
23+
# TF-M
24+
CONFIG_ARM_TRUSTZONE_M=y
25+
CONFIG_RUNTIME_NMI=y
26+
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
27+
28+
# Keys - These are for development purposes only and should be changed.
29+
CONFIG_TFM_MCUBOOT_SIGNATURE_TYPE="RSA-3072"
30+
CONFIG_TFM_KEY_FILE_S="${BOARD_DIR}/tfm/keys/rsa-3072-private-s.pem"
31+
CONFIG_TFM_KEY_FILE_NS="${BOARD_DIR}/tfm/keys/rsa-3072-private-ns.pem"

0 commit comments

Comments
 (0)