Skip to content

Commit ca48a14

Browse files
pillo79kartben
authored andcommitted
boards: arduino: use shared QSPI partition configs
This commit introduces shared QSPI partition configurations for Arduino STM32H7 boards, using the factory partitioning scheme that is compatible with the Arduino IoT Cloud services. Signed-off-by: Luca Burelli <[email protected]>
1 parent 3c50822 commit ca48a14

10 files changed

+159
-134
lines changed

boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -173,31 +173,16 @@
173173
pinctrl-names = "default";
174174
status = "okay";
175175

176-
n25q128a1: qspi-nor-flash@0 {
176+
qspi_flash: n25q128a1: qspi-nor-flash@0 {
177177
compatible = "st,stm32-qspi-nor";
178178
reg = <0>;
179-
size = <DT_SIZE_M(128)>; /* 128 Mbits */
179+
size = <DT_SIZE_M(128)>; /* 128 Mbits (16 MB) */
180180
qspi-max-frequency = <72000000>;
181181
cs-high-time = <4>; /* >= 50 ns */
182182
status = "okay";
183-
184-
partitions {
185-
compatible = "fixed-partitions";
186-
#address-cells = <1>;
187-
#size-cells = <1>;
188-
189-
slot1_partition: partition@0 {
190-
label = "image-1";
191-
reg = <0x00000000 DT_SIZE_M(1)>;
192-
};
193-
194-
storage_partition: partition@100000 {
195-
label = "storage";
196-
reg = <0x00100000 DT_SIZE_M(15)>;
197-
};
198-
};
199183
};
200184
};
185+
#include <arduino/partitions_qspi_h7.dtsi>
201186

202187
&rng {
203188
status = "okay";

boards/arduino/nicla_vision/arduino_nicla_vision_stm32h747xx_m7.dts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -165,31 +165,16 @@ zephyr_i2c: &i2c1 {
165165
pinctrl-names = "default";
166166
status = "okay";
167167

168-
n25q128a1: qspi-nor-flash@0 {
168+
qspi_flash: n25q128a1: qspi-nor-flash@0 {
169169
compatible = "st,stm32-qspi-nor";
170170
reg = <0>;
171-
size = <DT_SIZE_M(128)>; /* 128 Mbits */
171+
size = <DT_SIZE_M(128)>; /* 128 Mbits (16 MB) */
172172
qspi-max-frequency = <72000000>;
173173
cs-high-time = <4>; /* >= 50 ns */
174174
status = "okay";
175-
176-
partitions {
177-
compatible = "fixed-partitions";
178-
#address-cells = <1>;
179-
#size-cells = <1>;
180-
181-
slot1_partition: partition@0 {
182-
label = "image-1";
183-
reg = <0x00000000 DT_SIZE_M(1)>;
184-
};
185-
186-
storage_partition: partition@100000 {
187-
label = "storage";
188-
reg = <0x00100000 DT_SIZE_M(15)>;
189-
};
190-
};
191175
};
192176
};
177+
#include <arduino/partitions_qspi_h7.dtsi>
193178

194179
&rng {
195180
status = "okay";

boards/arduino/opta/arduino_opta-external-flash-partitioning.dtsi

Lines changed: 0 additions & 42 deletions
This file was deleted.

boards/arduino/opta/arduino_opta_stm32h747xx_m7.dts

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -160,42 +160,11 @@ zephyr_udc0: &usbotg_fs {
160160
qspi_flash: qspi-nor-flash@0 {
161161
compatible = "st,stm32-qspi-nor";
162162
reg = <0>;
163-
size = <DT_SIZE_M(128)>; /* 128 MBits */
163+
size = <DT_SIZE_M(128)>; /* 128 Mbits (16 MB) */
164164
qspi-max-frequency = <80000000>;
165165
jedec-id = [01 1f 89];
166166
spi-bus-width = <2>;
167167
status = "okay";
168-
169-
/* The following partitions are valid only if the Opta external flash
170-
* has never been reformatted or repartitioned. Note the offset of the
171-
* first partition, due to the presence of the MBR.
172-
*/
173-
partitions {
174-
compatible = "fixed-partitions";
175-
#address-cells = <1>;
176-
#size-cells = <1>;
177-
178-
/* WiFi firmware and TLS certificates: 1MB - 4K for MBR using LBA */
179-
wlan_partition: partition@1000 {
180-
label = "wlan";
181-
reg = <0x001000 DT_SIZE_K(1020)>;
182-
};
183-
184-
/* Arduino OTA partition: 13MB */
185-
fs_partition: partition@100000 {
186-
label = "fs";
187-
reg = <0x100000 DT_SIZE_M(13)>;
188-
};
189-
190-
/* The final 2MB is used to keep a memory-mapped copy of the WiFi
191-
* firmware. The address of the firmware blob is 0xF80000 and the
192-
* size of the partition in the MBR is 0 but, given that we can't
193-
* specify a zero size in `reg` we just give the "correct" one.
194-
*/
195-
wifi_partition: partition@e00000 {
196-
label = "4343WA1";
197-
reg = <0xE00000 DT_SIZE_M(2)>;
198-
};
199-
};
200168
};
201169
};
170+
#include <arduino/partitions_qspi_h7.dtsi>

boards/arduino/opta/doc/index.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,9 @@ External flash
8484
==============
8585

8686
External flash (16MB on QSPI) access can be enabled by the ``CONFIG_FLASH``
87-
option. The ``partitions`` entry provided in the default device tree is meant
88-
as an example and is valid only if the Opta is fresh from the factory and the
89-
flash has not been repartitioned. As a second example, the partitioning scheme
90-
created by the new ``QSPIFormat.ino`` sketch from Arduino is available as a
91-
DTSI in ``arduino_opta-external-flash-partitioning.dtsi``.
87+
option. The default partition table tracks the one used by the latest Arduino
88+
IoT Cloud library. If you have any issues, re-run the ``QSPIFormat.ino``
89+
sketch to update the Flash contents.
9290

9391
Resources sharing
9492
=================

boards/arduino/portenta_h7/arduino_portenta_h7-common.dtsi

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ zephyr_i2c: &i2c1 {
184184
pinctrl-names = "default";
185185
status = "okay";
186186

187-
mx25l12833f: qspi-nor-flash@0 {
187+
qspi_flash: mx25l12833f: qspi-nor-flash@0 {
188188
compatible = "st,stm32-qspi-nor";
189189
reg = <0>;
190-
size = <DT_SIZE_M(128)>; /* 128 Mbits */
190+
size = <DT_SIZE_M(128)>; /* 128 Mbits (16 MB) */
191191
qspi-max-frequency = <40000000>;
192192
cs-high-time = <2>; /* >= 30 ns */
193193
sfdp-bfp = [e5 20 f1 ff ff ff ff 07 44 eb 08 6b 08 3b 04 bb
@@ -197,24 +197,9 @@ zephyr_i2c: &i2c1 {
197197
jedec-id = [66 66 20];
198198
spi-bus-width = <4>;
199199
status = "okay";
200-
201-
partitions {
202-
compatible = "fixed-partitions";
203-
#address-cells = <1>;
204-
#size-cells = <1>;
205-
206-
storage_partition: partition@0 {
207-
label = "storage";
208-
reg = <0x0 DT_SIZE_K(15872)>;
209-
};
210-
211-
wifi_firmware: partition@f80000 {
212-
label = "wifi-firmware";
213-
reg = <0xf80000 DT_SIZE_K(512)>;
214-
};
215-
};
216200
};
217201
};
202+
#include <arduino/partitions_qspi_h7.dtsi>
218203

219204
&rng {
220205
status = "okay";
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*
2+
* Copyright (c) 2025 Arduino SA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <arduino/partitions_qspi_h7_r3.dtsi>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* External QSPI Flash partition for Arduino IoT Cloud services, rev 1
3+
*
4+
* Copyright (c) 2025 Arduino SA
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*/
8+
9+
/*
10+
* Note: This is an obsolete partition table layout which does not support
11+
* some of the latest features of the Arduino IoT library.
12+
* Please update your board by running the most recent version of the
13+
* 'QSPIFormat' sketch.
14+
*/
15+
16+
&qspi_flash {
17+
partitions {
18+
compatible = "fixed-partitions";
19+
#address-cells = <1>;
20+
#size-cells = <1>;
21+
22+
/* Partition 1: WiFi firmware and certificates 1MB - 4kB */
23+
wlan_partition: partition@1000 {
24+
label = "wlan";
25+
reg = <0x001000 DT_SIZE_K(1020)>;
26+
};
27+
28+
/* Partition 2: User data 13MB */
29+
storage_partition: partition@100000 {
30+
label = "storage";
31+
reg = <0x100000 DT_SIZE_M(13)>;
32+
};
33+
34+
/* Partition 3: Binary FW image for the Airoc WLAN */
35+
airoc_firmware: partition@e80000 {
36+
label = "4343WA1.bin";
37+
reg = <0xe80000 DT_SIZE_K(512)>;
38+
};
39+
};
40+
};
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* External QSPI Flash partition for Arduino IoT Cloud services, rev 2
3+
*
4+
* Copyright (c) 2025 Arduino SA
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*/
8+
9+
/*
10+
* Note: This is an obsolete partition table layout which does not support
11+
* some of the latest features of the Arduino IoT library.
12+
* Please update your board by running the most recent version of the
13+
* 'QSPIFormat' sketch.
14+
*/
15+
16+
&qspi_flash {
17+
partitions {
18+
compatible = "fixed-partitions";
19+
#address-cells = <1>;
20+
#size-cells = <1>;
21+
22+
/* Partition 1: WiFi firmware and certificates 1MB - 4kB */
23+
wlan_partition: partition@1000 {
24+
label = "wlan";
25+
reg = <0x001000 DT_SIZE_K(1020)>;
26+
};
27+
28+
/* Partition 2: OTA 5MB */
29+
ota_partition: partition@100000 {
30+
label = "ota";
31+
reg = <0x100000 DT_SIZE_M(5)>;
32+
};
33+
34+
/* Partition 3: User data 8MB */
35+
storage_partition: partition@600000 {
36+
label = "storage";
37+
reg = <0x600000 DT_SIZE_M(8)>;
38+
};
39+
40+
/* Partition 4: Binary FW image for the Airoc WLAN */
41+
airoc_firmware: partition@e80000 {
42+
label = "4343WA1.bin";
43+
reg = <0xe80000 DT_SIZE_K(512)>;
44+
};
45+
};
46+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* External QSPI Flash partition for Arduino IoT Cloud services, rev 3
3+
*
4+
* Copyright (c) 2024 DNDG srl
5+
* Copyright (c) 2025 Arduino SA
6+
*
7+
* SPDX-License-Identifier: Apache-2.0
8+
*/
9+
10+
/*
11+
* This is the partition table layout used by the Arduino IoT Cloud
12+
* library to connect to the Arduino IoT Cloud services.
13+
* Please initialize your board by running the latest version of the
14+
* 'QSPIFormat' sketch.
15+
*/
16+
17+
&qspi_flash {
18+
partitions {
19+
compatible = "fixed-partitions";
20+
#address-cells = <1>;
21+
#size-cells = <1>;
22+
23+
/* Partition 1: WiFi firmware and certificates 1MB - 4kB */
24+
wlan_partition: partition@1000 {
25+
label = "wlan";
26+
reg = <0x001000 DT_SIZE_K(1020)>;
27+
};
28+
29+
/* Partition 2: OTA 5MB */
30+
ota_partition: partition@100000 {
31+
label = "ota";
32+
reg = <0x100000 DT_SIZE_M(5)>;
33+
};
34+
35+
/* Partition 3: Provisioning KVStore 1MB */
36+
kvs_partition: partition@600000 {
37+
label = "kvs";
38+
reg = <0x600000 DT_SIZE_M(1)>;
39+
};
40+
41+
/* Partition 4: User data 7MB */
42+
storage_partition: partition@700000 {
43+
label = "storage";
44+
reg = <0x700000 DT_SIZE_M(7)>;
45+
};
46+
47+
/* Partition 5: Binary FW image for the Airoc WLAN */
48+
airoc_firmware: partition@e80000 {
49+
label = "4343WA1.bin";
50+
reg = <0xe80000 DT_SIZE_K(512)>;
51+
};
52+
};
53+
};

0 commit comments

Comments
 (0)