Skip to content

Commit ae06f92

Browse files
FRASTMdleach02
authored andcommitted
boards: arm: stm32h7b3 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 78fb231 commit ae06f92

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

boards/st/stm32h7b3i_dk/board.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,14 @@
44
board_runner_args(jlink "--device=STM32H7B3LI" "--speed=4000")
55
board_runner_args(openocd --target-handle=_CHIPNAME.cpu0)
66

7+
if(CONFIG_STM32_MEMMAP)
8+
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
9+
board_runner_args(stm32cubeprogrammer "--hex-file=${ZEPHYR_BASE}/build/zephyr/zephyr.hex")
10+
board_runner_args(stm32cubeprogrammer "--extload=MX25LM51245G_STM32H7B3I-DISCO.stldr")
11+
else()
12+
board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw" )
13+
endif()
14+
15+
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
716
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
817
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/st/stm32h7b3i_dk/stm32h7b3i_dk.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) )>;
6060
};
6161

62+
octo_nor: memory@90000000 {
63+
compatible = "zephyr,memory-region";
64+
reg = <0x90000000 DT_SIZE_M(64)>;
65+
zephyr,memory-region = "EXTMEM";
66+
/* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */
67+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO) )>;
68+
};
69+
6270
transceiver0: can-phy0 {
6371
compatible = "microchip,mcp2562fd", "can-transceiver-gpio";
6472
standby-gpios = <&gpioh 8 GPIO_ACTIVE_HIGH>;

0 commit comments

Comments
 (0)