partition in board overlay file (for nrf52840-dk)


Nikos Karamolegkos
 

Hello,

I have create a board overlay file inside my zephyr sample where I create my partition in flash. However, if I use FLASH_AREA_ID(image_0) I can see that this ID exists which means that the partition exists too. How can I remove all these default partitions and keep only the desired ones set to my .overlay file in my project?

Thank you,

--
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Lawrence King
 

Hi Nikos:

Here is an example of changing the partition table in an overlay file you can see the old partitions deleted, then commented out, and the new partitions:

/delete-node/ &slot0_partition;
/delete-node/ &slot1_partition;
/delete-node/ &scratch_partition;
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x000000000 0x0000C000>;
};
/*
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x000067000>;
};
slot1_partition: partition@73000 {
label = "image-1";
reg = <0x00073000 0x000067000>;
};
scratch_partition: partition@da000 {
label = "image-scratch";
reg = <0x000da000 0x0001c000>;
};
*/
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x000075000>;
};
slot1_partition: partition@81000 {
label = "image-1";
reg = <0x00081000 0x000075000>;
};

blob_partition: partition@f7f00 {
label = "image-blob";
reg = <0x000f7f00 0x00000100>;
};

/*
* The flash starting at 0x000f8000 and ending at (32kB)
* 0x000fffff is reserved for use by the application.
*/

/* Storage partition will be used by FCB/NFFS/NVS if enabled. */
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};


Lawrence King
Principal Developer
+1(416)627-7302

-----Original Message-----
From: users@... <users@...> On Behalf Of Nikos Karamolegkos
Sent: Wednesday, May 12, 2021 6:55 AM
To: users@...
Subject: [Zephyr-users] partition in board overlay file (for nrf52840-dk)

Hello,

I have create a board overlay file inside my zephyr sample where I create my partition in flash. However, if I use FLASH_AREA_ID(image_0) I can see that this ID exists which means that the partition exists too.
How can I remove all these default partitions and keep only the desired ones set to my .overlay file in my project?

Thank you,

--
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Nikos Karamolegkos
 

Thank you. What happens if there is reference in the code to deleted labels? I can not pass the compilation

On 12/5/21 2:27 μ.μ., Lawrence King wrote:
Hi Nikos:

Here is an example of changing the partition table in an overlay file you can see the old partitions deleted, then commented out, and the new partitions:

/delete-node/ &slot0_partition;
/delete-node/ &slot1_partition;
/delete-node/ &scratch_partition;
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x000000000 0x0000C000>;
};
/*
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x000067000>;
};
slot1_partition: partition@73000 {
label = "image-1";
reg = <0x00073000 0x000067000>;
};
scratch_partition: partition@da000 {
label = "image-scratch";
reg = <0x000da000 0x0001c000>;
};
*/
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x000075000>;
};
slot1_partition: partition@81000 {
label = "image-1";
reg = <0x00081000 0x000075000>;
};

blob_partition: partition@f7f00 {
label = "image-blob";
reg = <0x000f7f00 0x00000100>;
};

/*
* The flash starting at 0x000f8000 and ending at (32kB)
* 0x000fffff is reserved for use by the application.
*/

/* Storage partition will be used by FCB/NFFS/NVS if enabled. */
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};


Lawrence King
Principal Developer
+1(416)627-7302

-----Original Message-----
From: users@... <users@...> On Behalf Of Nikos Karamolegkos
Sent: Wednesday, May 12, 2021 6:55 AM
To: users@...
Subject: [Zephyr-users] partition in board overlay file (for nrf52840-dk)

Hello,

I have create a board overlay file inside my zephyr sample where I create my partition in flash. However, if I use FLASH_AREA_ID(image_0) I can see that this ID exists which means that the partition exists too.
How can I remove all these default partitions and keep only the desired ones set to my .overlay file in my project?

Thank you,

--
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)




--
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)