Skip to content

Commit 2341814

Browse files
committed
boards: arm: stm32h7b3 disco kit for XiP on external octoflash
Define the Device tree of the stm32h7b3i_dk disco board to access the external NOR octo-flash in MemoryMapped mode for XiP Set openocd runner for debugging. Signed-off-by: Francois Ramu <[email protected]>
1 parent 4d5ce43 commit 2341814

File tree

2 files changed

+44
-13
lines changed

2 files changed

+44
-13
lines changed

boards/arm/stm32h7b3i_dk/stm32h7b3i_dk.dts

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
zephyr,flash = &flash0;
2222
zephyr,display = &ltdc;
2323
zephyr,canbus = &fdcan1;
24+
zephyr,flash-controller = &mx25lm51245;
25+
zephyr,code-partition = &slot1_partition;
2426
};
2527

2628
leds {
@@ -239,6 +241,35 @@
239241
def-back-color-blue = <0xFF>;
240242
};
241243

244+
&flash0 {
245+
partitions {
246+
compatible = "fixed-partitions";
247+
#address-cells = <1>;
248+
#size-cells = <1>;
249+
250+
boot_partition: partition@0 {
251+
label = "mcuboot";
252+
reg = <0x00000000 DT_SIZE_K(64)>;
253+
read-only;
254+
};
255+
256+
/*
257+
* The flash starting at offset 0x10000 and ending at
258+
* offset 0x1ffff is reserved for use by the application.
259+
*/
260+
261+
slot0_partition: partition@10000 {
262+
label = "image-0";
263+
reg = <0x00010000 DT_SIZE_K(864)>;
264+
};
265+
266+
scratch_partition: partition@f8000 {
267+
label = "image-scratch";
268+
reg = <0x000F8000 DT_SIZE_K(16)>;
269+
};
270+
};
271+
};
272+
242273
&octospi1 {
243274
pinctrl-0 = <&octospim_p1_clk_pb2 &octospim_p1_ncs_pg6
244275
&octospim_p1_io0_pd11 &octospim_p1_io1_pf9
@@ -250,31 +281,24 @@
250281

251282
status = "okay";
252283

253-
mx25lm51245: ospi-nor-flash@0 {
284+
mx25lm51245: ospi-nor-flash@90000000 {
254285
compatible = "st,stm32-ospi-nor";
255-
reg = <0>;
286+
reg = <0x90000000 DT_SIZE_M(64)>; /* 512 Megabits */
256287
ospi-max-frequency = <DT_FREQ_M(50)>;
257-
size = <DT_SIZE_M(512)>; /* 512 Megabits */
258288
spi-bus-width = <OSPI_OPI_MODE>;
259289
data-rate = <OSPI_DTR_TRANSFER>;
260290
status = "okay";
261-
sfdp-bfp = [
262-
53 46 44 50 06 01 02 ff
263-
00 06 01 10 30 00 00 ff
264-
C2 00 01 04 10 01 00 ff
265-
84 00 01 02 C0 00 00 ff
266-
00 00 00 00
267-
];
268291

269292
partitions {
270293
compatible = "fixed-partitions";
271294
#address-cells = <1>;
272295
#size-cells = <1>;
273296

274-
partition@0 {
297+
/* put image at offset 0 in slot1 */
298+
slot1_partition:partition@0 {
275299
label = "nor";
276-
reg = <0x00000000 DT_SIZE_M(4)>;
277-
};
300+
reg = <0x00000000 DT_SIZE_M(32)>;
301+
};
278302
};
279303
};
280304
};

boards/arm/stm32h7b3i_dk/support/openocd.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ set CORE_RESET 0
2020

2121
source [find target/stm32h7x.cfg]
2222

23+
# Due to the use of connect_assert_srst, running gdb requires
24+
# to reset halt just after openocd init.
25+
rename init old_init
26+
proc init {} {
27+
old_init
28+
reset halt
29+
}

0 commit comments

Comments
 (0)