From f960476b308bde723ce2bf5f92bcd1bff347b4cb Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Mon, 18 Nov 2024 16:56:48 +0100 Subject: [PATCH] boards: st: stm32h7s3l8 nucleo board for XiP on external flash Add the memory attributes to XiP in MemoryMapped mode on the external octo-flash of the nucleo_h7s3l8 board. Use the STM32Cube programmer to flash with the corresponding external loader for XiP mode. Signed-off-by: Francois Ramu --- boards/st/nucleo_h7s3l8/board.cmake | 3 +++ boards/st/nucleo_h7s3l8/nucleo_h7s3l8.dts | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/boards/st/nucleo_h7s3l8/board.cmake b/boards/st/nucleo_h7s3l8/board.cmake index e0005d1dc82..e8e3426630b 100644 --- a/boards/st/nucleo_h7s3l8/board.cmake +++ b/boards/st/nucleo_h7s3l8/board.cmake @@ -2,6 +2,9 @@ # keep first board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") +if(CONFIG_XIP AND (CONFIG_STM32_MEMMAP OR CONFIG_BOOTLOADER_MCUBOOT)) + board_runner_args(stm32cubeprogrammer "--extload=MX25UW25645G_NUCLEO-H7S3L8.stldr") +endif() board_runner_args(openocd --target-handle=_CHIPNAME.cpu0) diff --git a/boards/st/nucleo_h7s3l8/nucleo_h7s3l8.dts b/boards/st/nucleo_h7s3l8/nucleo_h7s3l8.dts index 2e7435bb95c..cdccc442c2c 100644 --- a/boards/st/nucleo_h7s3l8/nucleo_h7s3l8.dts +++ b/boards/st/nucleo_h7s3l8/nucleo_h7s3l8.dts @@ -57,6 +57,15 @@ led2 = &red_led; sw0 = &user_button; watchdog0 = &iwdg; + spi-flash0 = &mx25uw25645; + }; + + ext_memory: memory@70000000 { + compatible = "zephyr,memory-region"; + reg = <0x70000000 DT_SIZE_M(64)>; + zephyr,memory-region = "EXTMEM"; + /* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */ + zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO) )>; }; }; @@ -189,6 +198,7 @@ ospi-max-frequency = ; spi-bus-width = ; data-rate = ; + four-byte-opcodes; status = "okay"; partitions {