Dear all:
I am trying to change the partition table
from the default as defined in the board file inside Zephyr to
a slightly different configuration. Obviously I could do this
by editing the file in the zephyr tree but this has the
disadvantage that I have to redo the change each time I
upgrade the kernel. Hence I would like to make the change in
the overlay. Here is what I did in the overlay:
&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 0x000075800>;
};
slot1_partition: partition@81800 {
label = "image-1";
reg = <0x00081800 0x000075800>;
};
/*
* 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>;
};
};
};
As you can see I commented out the
definitions of slot0, slot1 and scratch, then I added in new
definitions for slot0 and slot1. When I attempt to compile
this I get a fatal error:
nrf52840_mdk.dts.pre.tmp:546.50-549.19:
ERROR (duplicate_label):
/soc/flash-controller@4001e000/flash@0/partitions/partition@81800:
Duplicate label 'slot1_partition' on
/soc/flash-controller@4001e000/flash@0/partitions/partition@81800
and
/soc/flash-controller@4001e000/flash@0/partitions/partition@73000
ERROR:
Input tree has errors, aborting (use -f to force output)
The device tree compile didn’t mind
changing the size of the slot0 partition, but it hated
changing the base address of the slot1 partition.
I tried leaving the partition address at
73000, it compiles, but the device tree compiler complains
“warning: unit-address and first reg (0x81800) don't match for
partition@73000” and mcuboot complains “<wrn> mcuboot:
Cannot upgrade: slots don't have same amount of sectors”.
I also tried many variations on adding
/delete-node/ and /delete-property/ in front of the
definitions but this just gave me other errors.
Obviously I am going about this
incorrectly. What is the right way to change the partition
table in a device tree overlay?
Lawrence King
Principal Developer
Connected Transport Market Unit
https://www.Irdeto.com
+1(416)627-7302

CONFIDENTIAL:
This e-mail and any attachments are confidential and
intended solely for the use of the individual(s) to whom it
is addressed. It can contain proprietary confidential
information and be subject to legal privilege and/or subject
to a non-disclosure Agreement. Unauthorized use, disclosure
or copying is strictly prohibited. If you are not the/an
addressee and are in possession of this e-mail, please
delete the message and notify us immediately. Please consider the environment before printing
this e-mail. Thank you.