Skip to content

Commit 49ef52e

Browse files
committed
boards : rpi_pico : Add persistent partition for Pico and Pico_w
Add a 16 KB 'storage' partition at the end of the Pico flash. That size is sufficient to hold the two test files created by the 'littlefs' sample. The sample 'subsys/USB/mass' uses an overlay to add the same partition and it was changed to delete the one defined by this DTSI file before doing that. Signed-off-by: Andreas Wolf <awolf002@gmail.com>
1 parent 6857dca commit 49ef52e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

boards/raspberrypi/rpi_pico/rpi_pico-common.dtsi

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,24 @@
7979

8080
/*
8181
* Usable flash. Starts at 0x100, after the bootloader. The partition
82-
* size is 2MB minus the 0x100 bytes taken by the bootloader.
82+
* size is 2MB minus the 0x100 bytes taken by the bootloader, and minus
83+
* the size of the storage partition, set to 16 KB (see below).
8384
*/
8485
code_partition: partition@100 {
8586
label = "code-partition";
86-
reg = <0x100 (DT_SIZE_M(2) - 0x100)>;
87+
reg = <0x100 (DT_SIZE_M(2) - 0x100 - DT_SIZE_K(16))>;
8788
read-only;
8889
};
90+
91+
/*
92+
* Area for placing a file system for persistent storage. Starts at the end
93+
* of the code partition. The size of 16 KB is chosen to have the capacity for
94+
* a minimal 'littlefs' file system with 4 blocks.
95+
*/
96+
storage_partition: partition@1fc000 {
97+
label = "storage-partition";
98+
reg = <(DT_SIZE_M(2) - DT_SIZE_K(16)) (DT_SIZE_K(16))>;
99+
};
89100
};
90101
};
91102

samples/subsys/usb/mass/boards/rpi_pico.overlay

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
/delete-node/ &code_partition;
8+
/delete-node/ &storage_partition;
89

910
&flash0 {
1011
partitions {

0 commit comments

Comments
 (0)