Skip to content

Commit 813fd26

Browse files
markussmSTdanieldegrasse
authored andcommitted
board: st: stm32u5g9j-dk2: Add HSPI external flash
Add external HSPI flash on STM32U5G9J-DK2 Use external loader to flash it with STM32CubeProgrammer Signed-off-by: Mathias Markussen <[email protected]>
1 parent c9ba87f commit 813fd26

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

boards/st/stm32u5g9j_dk2/board.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
# keep first
55
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
6+
if(CONFIG_STM32_MEMMAP)
7+
board_runner_args(stm32cubeprogrammer "--extload=MX66LM1G45G_STM32U5G9J-DK2.stldr")
8+
endif()
69

710
board_runner_args(openocd "--tcl-port=6666")
811
board_runner_args(openocd --cmd-pre-init "gdb_report_data_abort enable")

boards/st/stm32u5g9j_dk2/stm32u5g9j_dk2.dts

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858
volt-sensor0 = &vref1;
5959
volt-sensor1 = &vbat4;
6060
};
61+
62+
ext_memory: memory@a0000000 {
63+
compatible = "zephyr,memory-region";
64+
reg = <0xa0000000 DT_SIZE_M(128)>;
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+
};
6169
};
6270

6371
&ltdc {
@@ -319,9 +327,45 @@ zephyr_udc0: &usbotg_hs {
319327
};
320328
};
321329

330+
&xspi1 {
331+
clocks = <&rcc STM32_CLOCK(AHB2_2, 12U)>,
332+
<&rcc STM32_SRC_PLL2_Q HSPI_SEL(2)>;
333+
334+
pinctrl-0 = <&hspi1_dqs0_pi2 &hspi1_ncs_ph9
335+
&hspi1_io0_ph10 &hspi1_io1_ph11
336+
&hspi1_io2_ph12 &hspi1_io3_ph13
337+
&hspi1_io4_ph14 &hspi1_io5_ph15
338+
&hspi1_io6_pi0 &hspi1_io7_pi1
339+
&hspi1_clk_pi3>;
340+
pinctrl-names = "default";
341+
status = "okay";
342+
343+
mx66lm1g45: xspi-nor-flash@0 {
344+
compatible = "st,stm32-xspi-nor";
345+
reg = <0>;
346+
size = <DT_SIZE_M(1024)>; /* 1 Gbits */
347+
ospi-max-frequency = <DT_FREQ_M(133)>;
348+
spi-bus-width = <XSPI_OCTO_MODE>;
349+
data-rate = <XSPI_DTR_TRANSFER>;
350+
four-byte-opcodes;
351+
status = "okay";
352+
353+
partitions {
354+
compatible = "fixed-partitions";
355+
#address-cells = <1>;
356+
#size-cells = <1>;
357+
358+
extflash_partition: partition@0 {
359+
label = "ext_storage";
360+
reg = <0 DT_SIZE_M(128)>;
361+
};
362+
};
363+
};
364+
};
365+
322366
&rtc {
323367
clocks = <&rcc STM32_CLOCK_BUS_APB3 0x00200000>,
324-
<&rcc STM32_SRC_LSE RTC_SEL(1)>;
368+
<&rcc STM32_SRC_LSE RTC_SEL(1)>;
325369
status = "okay";
326370
};
327371

0 commit comments

Comments
 (0)