Skip to content

Commit 5528b7a

Browse files
committed
boards: st: b_u585i disco kit variant "ext_flash_app" for XIP
Create a new variant to execute in place on the external octoSPI flash NOR of the b_u585i_iot02a disco kit The flash size in the yaml corresponds to the the slot0 of that external NOR memory. Signed-off-by: Francois Ramu <[email protected]>
1 parent 727c15a commit 5528b7a

6 files changed

+137
-5
lines changed

boards/st/b_u585i_iot02a/b_u585i_iot02a-common.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ stm32_lp_tick_source: &lptim1 {
176176
data-rate = <OSPI_DTR_TRANSFER>;
177177
four-byte-opcodes;
178178
status = "okay";
179+
180+
/* The partition of the external NOR is defined in each board variant. */
179181
};
180182
};
181183

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include "b_u585i_iot02a-common.dtsi"
9+
#include <zephyr/dt-bindings/memory-attr/memory-attr.h>
10+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
11+
12+
/ {
13+
model = "STMicroelectronics B-U585I-IOT02A discovery kit";
14+
compatible = "st,b-u585i-iot02a";
15+
16+
chosen {
17+
zephyr,console = &usart1;
18+
zephyr,shell-uart = &usart1;
19+
zephyr,sram = &sram0;
20+
zephyr,flash = &flash0;
21+
zephyr,code-partition = &slot0_partition;
22+
zephyr,bt-hci = &bt_hci_uart;
23+
};
24+
25+
aliases {
26+
led0 = &green_led_1;
27+
led1 = &red_led_1;
28+
sw0 = &user_button;
29+
die-temp0 = &die_temp;
30+
};
31+
32+
octo_nor: memory@70000000 {
33+
compatible = "zephyr,memory-region";
34+
reg = <0x70000000 DT_SIZE_M(64)>;
35+
zephyr,memory-region = "EXTMEM";
36+
/* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */
37+
zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_IO)>;
38+
};
39+
};
40+
41+
&flash0 {
42+
partitions {
43+
compatible = "fixed-partitions";
44+
#address-cells = <1>;
45+
#size-cells = <1>;
46+
47+
/*
48+
* Following flash partition is dedicated to the use of b_u585i_iot02a
49+
* with TZEN=0 (so w/o TFM).
50+
* Set the partitions with first MB to make use of the whole Bank1
51+
*/
52+
boot_partition: partition@0 {
53+
label = "mcuboot";
54+
reg = <0x00000000 DT_SIZE_K(64)>;
55+
};
56+
57+
storage_partition: partition@f0000 {
58+
label = "storage";
59+
reg = <0x000f0000 DT_SIZE_K(64)>;
60+
};
61+
};
62+
};
63+
64+
&gpdma1 {
65+
status = "okay";
66+
};
67+
68+
&uart4 {
69+
pinctrl-0 = <&uart4_tx_pc10 &uart4_rx_pc11>;
70+
pinctrl-names = "default";
71+
current-speed = <100000>;
72+
status = "okay";
73+
74+
bt_hci_uart: bt_hci_uart {
75+
compatible = "zephyr,bt-hci-uart";
76+
status = "okay";
77+
};
78+
};
79+
80+
&die_temp {
81+
status = "okay";
82+
};
83+
84+
&adc1 {
85+
st,adc-prescaler = <4>;
86+
status = "okay";
87+
};
88+
89+
&mx25lm51245 {
90+
partitions {
91+
compatible = "fixed-partitions";
92+
#address-cells = <1>;
93+
#size-cells = <1>;
94+
95+
slot0_partition: partition@0 {
96+
label = "image-0";
97+
reg = <0x00000000 DT_SIZE_K(416)>;
98+
};
99+
100+
slot1_partition: partition@68000 {
101+
label = "image-1";
102+
reg = <0x00068000 DT_SIZE_K(416)>;
103+
};
104+
105+
scratch_partition: partition@d0000 {
106+
label = "image-scratch";
107+
reg = <0x000d0000 DT_SIZE_K(192)>;
108+
};
109+
};
110+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: b_u585i_iot02a/stm32u585xx/ext_flash_app
2+
name: ST B_U585I_IOT02A Discovery kit ext_flash_app target
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 786
9+
flash: 416
10+
vendor: st
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# enable uart driver
4+
CONFIG_SERIAL=y
5+
6+
# enable GPIO
7+
CONFIG_GPIO=y
8+
9+
# console
10+
CONFIG_CONSOLE=y
11+
CONFIG_UART_CONSOLE=y

boards/st/b_u585i_iot02a/board.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@ if(CONFIG_BUILD_WITH_TFM)
55
# Flash merged TF-M + Zephyr binary
66
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
77

8-
if (CONFIG_HAS_FLASH_LOAD_OFFSET)
8+
if(CONFIG_HAS_FLASH_LOAD_OFFSET)
99
MATH(EXPR TFM_HEX_BASE_ADDRESS_NS "${TFM_FLASH_BASE_ADDRESS}+${CONFIG_FLASH_LOAD_OFFSET}")
1010
else()
1111
set(TFM_HEX_BASE_ADDRESS_NS ${TFM_TFM_FLASH_BASE_ADDRESS})
1212
endif()
1313
endif()
1414

1515
# keep first
16-
if(CONFIG_STM32_MEMMAP)
1716
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
18-
board_runner_args(stm32cubeprogrammer "--extload=MX25LM51245G_STM32U585I-IOT02A.stldr")
19-
else()
20-
board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw")
17+
if(CONFIG_STM32_MEMMAP OR (CONFIG_XIP AND CONFIG_BOOTLOADER_MCUBOOT))
18+
board_runner_args(stm32cubeprogrammer "--extload=MX25LM51245G_STM32U585I-IOT02A.stldr")
2119
endif()
2220

2321
board_runner_args(openocd "--tcl-port=6666")

boards/st/b_u585i_iot02a/board.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ board:
66
- name: stm32u585xx
77
variants:
88
- name: ns
9+
- name: ext_flash_app

0 commit comments

Comments
 (0)