boards: nrf52840 common uf2 partition

Common uf2 partition configurations to avoid duplication in boards.

There appears to be a bit of confusion about exactly what a proper
UF2 partition map looks like for the nrf52840, so common dts
configurations should help to avoid confusion.

Configuration for SoftDevice v6 and v7 provided as thats what was
fouond in use in tree already.

Signed-off-by: Jacob Winther <jacob@9.nz>
This commit is contained in:
Jacob Winther 2024-09-23 21:04:16 +12:00 committed by Anas Nashif
parent 0d95e2e9e8
commit dcc1d0e49c
7 changed files with 110 additions and 131 deletions

View file

@ -1,53 +0,0 @@
/*
* Copyright (c) 2024 Jacob Winther
*
* SPDX-License-Identifier: Apache-2.0
*
* Default flash layout for nrf52840 using UF2
*/
/ {
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* To enable flashing with UF2 bootloader, we
* must reserve a partition for SoftDevice.
* See https://learn.adafruit.com/
* introducing-the-adafruit-nrf52840-feather?view=all#hathach-memory-map
*/
reserved_partition_0: partition@0 {
label = "SoftDevice";
read-only;
reg = <0x000000000 DT_SIZE_K(152)>;
};
code_partition: partition@26000 {
label = "Application";
reg = <0x00026000 DT_SIZE_K(796)>;
};
/*
* The flash starting at 0x000ed000 and ending at
* 0x000f4000 is reserved for use by the application.
*/
storage_partition: partition@ed000 {
label = "storage";
reg = <0x0000ed000 DT_SIZE_K(28)>;
};
boot_partition: partition@f4000 {
label = "UF2";
read-only;
reg = <0x000f4000 DT_SIZE_K(48)>;
};
};
};

View file

@ -7,7 +7,7 @@
/dts-v1/;
#include "adafruit_feather_nrf52840_common.dtsi"
#include "adafruit_feather_nrf52840_flash_uf2.dtsi"
#include <nordic/nrf52840_partition_uf2_sdv6.dtsi>
/ {
model = "Adafruit Feather nRF52840 Sense";

View file

@ -6,7 +6,7 @@
/dts-v1/;
#include "adafruit_feather_nrf52840_common.dtsi"
#include "adafruit_feather_nrf52840_flash_uf2.dtsi"
#include <nordic/nrf52840_partition_uf2_sdv6.dtsi>
/ {
model = "Adafruit Feather nRF52840 Express";

View file

@ -6,6 +6,7 @@
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <nordic/nrf52840_partition_uf2_sdv6.dtsi>
#include "adafruit_itsybitsy_nrf52840-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/led/led.h>
@ -20,9 +21,6 @@
zephyr,uart-mcumgr = &cdc_acm_uart0;
zephyr,bt-mon-uart = &cdc_acm_uart0;
zephyr,bt-c2h-uart = &cdc_acm_uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
zephyr,ieee802154 = &ieee802154;
};
@ -142,41 +140,6 @@
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* To enable flashing with UF2 bootloader, we
* must reserve a partition for SoftDevice.
* See https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather?view=all#hathach-memory-map
*/
reserved_partition_0: partition@0 {
label = "SoftDevice";
reg = <0x000000000 DT_SIZE_K(152)>;
};
code_partition: partition@26000 {
label = "Application";
reg = <0x00026000 DT_SIZE_K(796)>;
};
/*
* The flash starting at 0x000ed000 and ending at
* 0x000f4000 is reserved for use by the application.
*/
storage_partition: partition@ed000 {
label = "storage";
reg = <0x0000ed000 DT_SIZE_K(28)>;
};
boot_partition: partition@f4000 {
label = "UF2";
reg = <0x000f4000 DT_SIZE_K(48)>;
};
};
};
&gd25q16 {
partitions {
compatible = "fixed-partitions";

View file

@ -6,6 +6,7 @@
*/
#include <nordic/nrf52840_qiaa.dtsi>
#include <nordic/nrf52840_partition_uf2_sdv7.dtsi>
#include "xiao_ble-pinctrl.dtsi"
#include "seeed_xiao_connector.dtsi"
@ -16,9 +17,6 @@
zephyr,uart-mcumgr = &usb_cdc_acm_uart;
zephyr,bt-mon-uart = &usb_cdc_acm_uart;
zephyr,bt-c2h-uart = &usb_cdc_acm_uart;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
zephyr,ieee802154 = &ieee802154;
};
@ -145,41 +143,6 @@
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
sd_partition: partition@0 {
label = "softdevice";
reg = <0x00000000 0x00027000>;
};
code_partition: partition@27000 {
label = "code_partition";
reg = <0x00027000 0x000c5000>;
};
/*
* The flash starting at 0x000ec000 and ending at
* 0x000f3fff is reserved for use by the application.
*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@ec000 {
label = "storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "adafruit_boot";
reg = <0x000f4000 0x0000c000>;
};
};
};
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";

View file

@ -0,0 +1,54 @@
/*
* Copyright (c) 2024 Jacob Winther
*
* SPDX-License-Identifier: Apache-2.0
*
*/
/ {
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};
};
&flash0 {
/*
* Default flash layout for nrf52840 using UF2 and SoftDevice s140 v6
*
* 0x00000000 SoftDevice s140 v6 (152 kB)
* 0x00026000 Application partition (792 kB)
* 0x000ec000 Storage partition (32 kB)
* 0x000f4000 UF2 boot partition (48 kB)
*
* See https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/hathach-memory-map
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
reserved_partition_0: partition@0 {
label = "SoftDevice";
read-only;
reg = <0x00000000 0x00026000>;
};
code_partition: partition@26000 {
label = "Application";
reg = <0x00026000 0x000C6000>;
};
storage_partition: partition@ec000 {
label = "Storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "UF2";
read-only;
reg = <0x000f4000 0x0000c000>;
};
};
};

View file

@ -0,0 +1,52 @@
/*
* Copyright (c) 2024 Jacob Winther
*
* SPDX-License-Identifier: Apache-2.0
*
*/
/ {
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};
};
&flash0 {
/*
* Default flash layout for nrf52840 using UF2 and SoftDevice s140 v7
*
* 0x00000000 SoftDevice s140 v7 (156 kB)
* 0x00027000 Application partition (788 kB)
* 0x000ec000 Storage partition (32 kB)
* 0x000f4000 UF2 boot partition (48 kB)
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
reserved_partition_0: partition@0 {
label = "SoftDevice";
read-only;
reg = <0x00000000 0x00027000>;
};
code_partition: partition@27000 {
label = "Application";
reg = <0x00027000 0x000C5000>;
};
storage_partition: partition@ec000 {
label = "Storage";
reg = <0x000ec000 0x00008000>;
};
boot_partition: partition@f4000 {
label = "UF2";
read-only;
reg = <0x000f4000 0x0000c000>;
};
};
};