Hello everyone,
I am working on device based on an nRF52832 that is close to pre-production phase and runs on Zephyr. I have a question because I would like to retain information between two different firmware.
1. Testing firmware. Does not use a bootloader and stores values using the settings API. Does other things for testing the custom board but that is not important.
2. Production firmware. This uses a bootloader (MCUboot) and the default memory map on zephyr for an nRF52832. I would like to use the settings API to load the information from the previous firmware.
For example, using the settings API with NVS API from Zephyr, I would write "TEST" on "device/param/one" using the testing firmware. And the production firmware would use the same implementation:
/* Static subtree handler */
SETTINGS_STATIC_HANDLER_DEFINE(param, "device/param", NULL,
NULL, NULL,
param_handle_export);
int param_handle_export(int (*cb)(const char *name,
const void *value, size_t val_len))
{
(void)cb("device/param/one", "TEST", strlen(TEST));
return 0;
}
The idea would be that using "settings_load()" on the second firmware would fetch the value that was saved on the first firmware.
When testing this, it did not work. So I am wondering if both firmware need to use the same memory map and bootloader? Is there an alternative?
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0xc000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x32000>;
};
slot1_partition: partition@3e000 {
label = "image-1";
reg = <0x0003E000 0x32000>;
};
scratch_partition: partition@70000 {
label = "image-scratch";
reg = <0x00070000 0xa000>;
};
storage_partition: partition@7a000 {
label = "storage";
reg = <0x0007a000 0x00006000>;
};
};
};
Thank you very much in advance for any help.
Best regards,
