I am facing a similar problem. I defined the following struct, based on this example https://forum.electro-smith.com/t/saving-values-to-flash-memory-using-persistentstorage-class-on-daisy-pod/4306/10:
struct Settings {
int p1;
int p2;
Applet::appletParam *ParamArray;
Applet::appletParam testParam;
//Overloading the != operator
//This is necessary as this operator is used in the PersistentStorage source code
bool operator!=(const Settings& a) const {
return !(a.p1==p1 && a.p2==p2);
}
};
Applet::appletParam DSY_SDRAM_BSS appletParamArray[6400];
PersistentStorage<Settings> storage(patch.qspi);
*ParamArray points to an array of structs (Applet::appletParam) in SDRAM. When I update the parameters and save to QSPI with storage.Save() everything is correctly updated. After a reboot, the paramters in the *ParamArray are reset to the default values. All the other ones like testParam are reloaded correctly.
I am sure it is not related to the overloaded operator, since it is working fine for the variable testParam.
The problem seems to be somehow related to the pointer to the array. The thing is, I can’t define an array, since it is too big to fit into DTCMRAM (I am using the bootloader mode).
Thanks for your help.