Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions boards/arm/b_u585i_iot02a/b_u585i_iot02a-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@

status = "okay";

mx25lm51245: ospi-nor-flash@0 {
mx25lm51245: ospi-nor-flash@70000000 {
compatible = "st,stm32-ospi-nor";
reg = <0>;
reg = <0x70000000 DT_SIZE_M(64)>; /* 512 Mbits */
ospi-max-frequency = <DT_FREQ_M(50)>;
size = <DT_SIZE_M(512)>; /* 64 MBytes */
spi-bus-width = <OSPI_OPI_MODE>;
data-rate = <OSPI_DTR_TRANSFER>;
four-byte-opcodes;
Expand All @@ -146,8 +145,10 @@
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
reg = <0x00000000 DT_SIZE_M(64)>;
/* put image at offset 0 in slot1 */
slot1_partition:partition@0 {
label = "nor";
reg = <0x00000000 DT_SIZE_M(32)>;
};
};
};
Expand Down
8 changes: 3 additions & 5 deletions boards/arm/b_u585i_iot02a/b_u585i_iot02a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
zephyr,shell-uart = &usart1;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,code-partition = &slot1_partition;
zephyr,flash-controller = &mx25lm51245;
};

aliases {
Expand Down Expand Up @@ -45,10 +46,7 @@
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)>;
Expand Down
1 change: 0 additions & 1 deletion boards/arm/b_u585i_iot02a/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if(CONFIG_BUILD_WITH_TFM)
endif()
endif()

board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw")
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")

board_runner_args(openocd "--tcl-port=6666")
Expand Down
33 changes: 29 additions & 4 deletions boards/arm/stm32h735g_disco/stm32h735g_disco.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
zephyr,shell-uart = &usart3;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,flash-controller = &mx25lm51245;
zephyr,code-partition = &slot1_partition;

};

leds {
Expand Down Expand Up @@ -143,6 +146,28 @@
cd-gpios = <&gpiof 5 GPIO_ACTIVE_LOW>;
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 DT_SIZE_K(64)>;
};
/* Set 2KB of storage at the end of first 1MB flash */
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 DT_SIZE_K(416)>;
};
storage_partition: partition@ff800 {
label = "storage";
reg = <0x000ff800 DT_SIZE_K(2)>;
};
};
};

&octospi1 {
pinctrl-0 = <&octospim_p1_clk_pf10 &octospim_p1_ncs_pg6
&octospim_p1_io0_pd11 &octospim_p1_io1_pd12
Expand All @@ -156,9 +181,8 @@

mx25lm51245: ospi-nor-flash@0 {
compatible = "st,stm32-ospi-nor";
reg = <0>;
reg = <0x90000000 DT_SIZE_M(64)>; /* 512 Mbits */
ospi-max-frequency = <DT_FREQ_M(50)>;
size = <DT_SIZE_M(512)>; /* 64 MBytes */
spi-bus-width = <OSPI_OPI_MODE>;
data-rate = <OSPI_DTR_TRANSFER>;
status = "okay";
Expand All @@ -168,9 +192,10 @@
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
/* put image at offset 0 in slot1 */
slot1_partition:partition@0 {
label = "nor";
reg = <0x00000000 DT_SIZE_M(4)>;
reg = <0x00000000 DT_SIZE_M(32)>;
};
};
};
Expand Down
50 changes: 37 additions & 13 deletions boards/arm/stm32h7b3i_dk/stm32h7b3i_dk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
zephyr,flash = &flash0;
zephyr,display = &ltdc;
zephyr,canbus = &fdcan1;
zephyr,flash-controller = &mx25lm51245;
zephyr,code-partition = &slot1_partition;
};

leds {
Expand Down Expand Up @@ -239,6 +241,35 @@
def-back-color-blue = <0xFF>;
};

&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 DT_SIZE_K(64)>;
read-only;
};

/*
* The flash starting at offset 0x10000 and ending at
* offset 0x1ffff is reserved for use by the application.
*/

slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 DT_SIZE_K(864)>;
};

scratch_partition: partition@f8000 {
label = "image-scratch";
reg = <0x000F8000 DT_SIZE_K(16)>;
};
};
};

&octospi1 {
pinctrl-0 = <&octospim_p1_clk_pb2 &octospim_p1_ncs_pg6
&octospim_p1_io0_pd11 &octospim_p1_io1_pf9
Expand All @@ -250,31 +281,24 @@

status = "okay";

mx25lm51245: ospi-nor-flash@0 {
mx25lm51245: ospi-nor-flash@90000000 {
compatible = "st,stm32-ospi-nor";
reg = <0>;
reg = <0x90000000 DT_SIZE_M(64)>; /* 512 Megabits */
ospi-max-frequency = <DT_FREQ_M(50)>;
size = <DT_SIZE_M(512)>; /* 512 Megabits */
spi-bus-width = <OSPI_OPI_MODE>;
data-rate = <OSPI_DTR_TRANSFER>;
status = "okay";
sfdp-bfp = [
53 46 44 50 06 01 02 ff
00 06 01 10 30 00 00 ff
C2 00 01 04 10 01 00 ff
84 00 01 02 C0 00 00 ff
00 00 00 00
];

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
/* put image at offset 0 in slot1 */
slot1_partition:partition@0 {
label = "nor";
reg = <0x00000000 DT_SIZE_M(4)>;
};
reg = <0x00000000 DT_SIZE_M(32)>;
};
};
};
};
7 changes: 7 additions & 0 deletions boards/arm/stm32h7b3i_dk/support/openocd.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ set CORE_RESET 0

source [find target/stm32h7x.cfg]

# Due to the use of connect_assert_srst, running gdb requires
# to reset halt just after openocd init.
rename init old_init
proc init {} {
old_init
reset halt
}
7 changes: 7 additions & 0 deletions drivers/flash/Kconfig.stm32
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@ config FLASH_STM32_BLOCK_REGISTERS
registers improves system security, because flash content (or
protection settings) can't be changed even when exploit was found.

config STM32_XIP
bool "NOR Flash in MemoryMapped for XiP"
depends on XIP
help
This option enables the XIP mode for the external NOR flash
mounted on STM32 boards.

endif # SOC_FLASH_STM32
1 change: 1 addition & 0 deletions drivers/flash/Kconfig.stm32_ospi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ config FLASH_STM32_OSPI
select FLASH_JESD216
select FLASH_PAGE_LAYOUT
select FLASH_HAS_PAGE_LAYOUT
select STM32_XIP
select DMA if $(DT_STM32_OCTOSPI_1_HAS_DMA) || $(DT_STM32_OCTOSPI_2_HAS_DMA)
select USE_STM32_HAL_DMA if $(DT_STM32_OCTOSPI_1_HAS_DMA) || \
$(DT_STM32_OCTOSPI_2_HAS_DMA)
Expand Down
Loading