Dear all,
For our project we want to store information on the device in an additional flash partition.
We have created a new flash partition, called factory_settings_partition, by defining it in our custom board files as follows:
&flash0 {
/*
* For more information, see:
* https://docs.zephyrproject.org/latest/guides/dts/legacy-macros.html#legacy-flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x10000>;
};
slot0_partition: partition@10000 {
label = "image-0";
};
slot0_ns_partition: partition@50000 {
label = "image-0-nonsecure";
};
slot1_partition: partition@80000 {
label = "image-1";
};
slot1_ns_partition: partition@c0000 {
label = "image-1-nonsecure";
};
scratch_partition: partition@f0000 {
label = "image-scratch";
reg = <0x000f0000 0xa000>;
};
storage_partition: partition@fa000 {
label = "storage";
reg = <0x000fa000 0x00006000>;
};
factory_settings_partition: partition@100000 {
label = "factory_settings";
reg = <0x00100000 0x000007d0>;
};
};
};Now when trying to read and write to the flash we get an error from the FLASH_AREA_OFFSET(factory_settings):
error: 'PM_PM_PM_factory_settings_ID_LABEL_ADDRESS' undeclared (first use in this function) UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), _ADDRESS))
I also tried getting my code to work with an already existing flash partition, namely storage_partition, and that worked fine, I got no errors.
My issue is the same as the issue in this post; for us the first solution offered is not an option and the second solution is a bit unclear to me.
Can you give me guidance to how I can implement and use my own flash partition?
Kind regards,
Maaike