Skip to content

Commit f80eefa

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 Signed-off-by: Francois Ramu <[email protected]>
1 parent 20efb9e commit f80eefa

7 files changed

+147
-13
lines changed

boards/st/b_u585i_iot02a/b_u585i_iot02a-common.dtsi

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,7 @@ stm32_lp_tick_source: &lptim1 {
147147
four-byte-opcodes;
148148
status = "okay";
149149

150-
partitions {
151-
compatible = "fixed-partitions";
152-
#address-cells = <1>;
153-
#size-cells = <1>;
154-
155-
partition@0 {
156-
reg = <0x00000000 DT_SIZE_M(64)>;
157-
};
158-
};
150+
/* Partition of the external NOR is defined in each variant. */
159151
};
160152
};
161153

boards/st/b_u585i_iot02a/b_u585i_iot02a.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,15 @@
100100
st,adc-prescaler = <4>;
101101
status = "okay";
102102
};
103+
104+
&mx25lm51245 {
105+
partitions {
106+
compatible = "fixed-partitions";
107+
#address-cells = <1>;
108+
#size-cells = <1>;
109+
110+
partition@0 {
111+
reg = <0x00000000 DT_SIZE_M(64)>;
112+
};
113+
};
114+
};
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/xip
2+
name: ST B_U585I_IOT02A Discovery kit xip target
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 786
9+
flash: 512
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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ if(CONFIG_BUILD_WITH_TFM)
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)