Skip to content

Commit 78fb231

Browse files
FRASTMdleach02
authored andcommitted
boards: arm: stm32u585 disco with external memory region for XiP
Declare a sub-region of the whole ext_memory with attributes ATTR_MPU_IO so that XiP becomes possible on this external octo- NOR flash. Use the STM32CubeProgrammer runner with the external loader for flashing. Signed-off-by: Francois Ramu <[email protected]>
1 parent 7b73a34 commit 78fb231

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

boards/st/b_u585i_iot02a/b_u585i_iot02a.dts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/dts-v1/;
88
#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>
911

1012
/ {
1113
model = "STMicroelectronics B-U585I-IOT02A discovery kit";
@@ -25,6 +27,14 @@
2527
led1 = &red_led_1;
2628
sw0 = &user_button;
2729
};
30+
31+
octo_nor: memory@70000000 {
32+
compatible = "zephyr,memory-region";
33+
reg = <0x70000000 DT_SIZE_M(64)>;
34+
zephyr,memory-region = "EXTMEM";
35+
/* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */
36+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO) )>;
37+
};
2838
};
2939

3040
&flash0 {

boards/st/b_u585i_iot02a/board.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ if(CONFIG_BUILD_WITH_TFM)
1212
endif()
1313
endif()
1414

15-
board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw")
15+
if(CONFIG_STM32_MEMMAP)
1616
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
17+
board_runner_args(stm32cubeprogrammer "--hex-file=${ZEPHYR_BASE}/build/zephyr/zephyr.hex")
18+
board_runner_args(stm32cubeprogrammer "--extload=MX25LM51245G_STM32U585I-IOT02A.stldr")
19+
else()
20+
board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw")
21+
endif()
1722

1823
board_runner_args(openocd "--tcl-port=6666")
1924
board_runner_args(openocd --cmd-pre-init "gdb_report_data_abort enable")

0 commit comments

Comments
 (0)