diff --git a/boards/st/b_u585i_iot02a/b_u585i_iot02a-common.dtsi b/boards/st/b_u585i_iot02a/b_u585i_iot02a-common.dtsi index d6f4ebfe7e7db..9c0dc5e26616b 100644 --- a/boards/st/b_u585i_iot02a/b_u585i_iot02a-common.dtsi +++ b/boards/st/b_u585i_iot02a/b_u585i_iot02a-common.dtsi @@ -152,8 +152,19 @@ stm32_lp_tick_source: &lptim1 { #address-cells = <1>; #size-cells = <1>; - partition@0 { - reg = <0x00000000 DT_SIZE_M(64)>; + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x00000000 DT_SIZE_K(256)>; + }; + + slot1_partition: partition@40000 { + label = "image-1"; + reg = <0x00040000 DT_SIZE_K(256)>; + }; + + scratch_partition: partition@e0000 { + label = "image-scratch"; + reg = <0x000e0000 DT_SIZE_K(64)>; }; }; }; diff --git a/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts b/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts index fc824417d2050..6347cfad85f8f 100644 --- a/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts +++ b/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts @@ -54,21 +54,6 @@ reg = <0x00000000 DT_SIZE_K(64)>; }; - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x00010000 DT_SIZE_K(416)>; - }; - - slot1_partition: partition@78000 { - label = "image-1"; - reg = <0x00078000 DT_SIZE_K(416)>; - }; - - scratch_partition: partition@e0000 { - label = "image-scratch"; - reg = <0x000e0000 DT_SIZE_K(64)>; - }; - storage_partition: partition@f0000 { label = "storage"; reg = <0x000f0000 DT_SIZE_K(64)>; diff --git a/boards/st/b_u585i_iot02a/b_u585i_iot02a.yaml b/boards/st/b_u585i_iot02a/b_u585i_iot02a.yaml index 621e455720497..93ff03bda277f 100644 --- a/boards/st/b_u585i_iot02a/b_u585i_iot02a.yaml +++ b/boards/st/b_u585i_iot02a/b_u585i_iot02a.yaml @@ -12,7 +12,6 @@ supported: - arduino_spi - hts221 - dma - - usb_device - spi - dac - adc diff --git a/boards/st/b_u585i_iot02a/board.cmake b/boards/st/b_u585i_iot02a/board.cmake index bb801eaae547d..5764f61791382 100644 --- a/boards/st/b_u585i_iot02a/board.cmake +++ b/boards/st/b_u585i_iot02a/board.cmake @@ -13,11 +13,9 @@ if(CONFIG_BUILD_WITH_TFM) endif() # keep first -if(CONFIG_STM32_MEMMAP) board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") -board_runner_args(stm32cubeprogrammer "--extload=MX25LM51245G_STM32U585I-IOT02A.stldr") -else() -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw") +if(CONFIG_STM32_MEMMAP OR (CONFIG_XIP AND CONFIG_BOOTLOADER_MCUBOOT)) + board_runner_args(stm32cubeprogrammer "--extload=MX25LM51245G_STM32U585I-IOT02A.stldr") endif() board_runner_args(openocd "--tcl-port=6666") diff --git a/samples/sysbuild/with_mcuboot/boards/b_u585i_iot02a.overlay b/samples/sysbuild/with_mcuboot/boards/b_u585i_iot02a.overlay new file mode 100644 index 0000000000000..f109c447c637e --- /dev/null +++ b/samples/sysbuild/with_mcuboot/boards/b_u585i_iot02a.overlay @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2025 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Define the device, controller and partition to be the external memory + * for running the application in external NOR from MCUboot + */ + +/ { + chosen { + zephyr,flash = &mx25lm51245; + zephyr,flash-controller = &mx25lm51245; + }; +}; diff --git a/samples/sysbuild/with_mcuboot/sample.yaml b/samples/sysbuild/with_mcuboot/sample.yaml index a2e53a4fbecb0..ec72ef4e2f8bd 100644 --- a/samples/sysbuild/with_mcuboot/sample.yaml +++ b/samples/sysbuild/with_mcuboot/sample.yaml @@ -17,6 +17,7 @@ tests: - nucleo_h7s3l8 - nucleo_u385rg_q - stm32h7s78_dk + - b_u585i_iot02a integration_platforms: - nrf52840dk/nrf52840 - esp32_devkitc/esp32/procpu diff --git a/soc/st/stm32/Kconfig.defconfig b/soc/st/stm32/Kconfig.defconfig index aafb321151a46..e18bc5d5bbadb 100644 --- a/soc/st/stm32/Kconfig.defconfig +++ b/soc/st/stm32/Kconfig.defconfig @@ -28,10 +28,12 @@ DT_STM32_LPTIM_PATH := $(dt_nodelabel_path,stm32_lp_tick_source) DT_CHOSEN_Z_FLASH := zephyr,flash DT_COMPAT_XSPI := st,stm32-xspi +DT_COMPAT_OSPI := st,stm32-ospi DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) DT_FLASH_PARENT_IS_XSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_XSPI)) +DT_FLASH_PARENT_IS_OSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_OSPI)) config SYS_CLOCK_HW_CYCLES_PER_SEC default "$(DT_STM32_RCC_CLOCK_FREQ)" if "$(dt_nodelabel_enabled,rcc)" @@ -82,7 +84,7 @@ config BUILD_WITH_TFM config FLASH_BASE_ADDRESS default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \ - if $(DT_FLASH_PARENT_IS_XSPI) + if $(DT_FLASH_PARENT_IS_XSPI) || $(DT_FLASH_PARENT_IS_OSPI) default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) # The XSPI PSRAM driver creates a SMH region with attribute SMH_REG_ATTR_EXTERNAL (2)