Closed reibuehl closed 3 years ago
The settings are in flash memory with the firmware, because the SAMD21 has no special memory for settings like an EEPROM. The bootloader does not know about the settings and will erase the complete memory on an update and so the settings will not survive.
Does this also happen when the firmware is installed via the mass storage upload or is this just a Arduino IDE issue?
Its the same, both is handled by the bootloader: https://github.com/awatterott/uf2-samd21
I don't know the architecture and especially the way the build toolchain is integrated into the Arduino IDE, but maybe this link is helpfull: https://www.avrfreaks.net/comment/1937676#comment-1937676 Is such a option also available in the toolchain that is used by Arduino? Then it might be possible to expose such a flag in the board definition and users could select if they want to overwrite the flash or not.
The settings are in the flash memory and will be erased/overwritten by the new firmware data on an update. It can work, when the settings are put at the end of the flash, so that there is a separation between program data and settings data. The settings are stored/read through this library: https://github.com/cmaglie/FlashStorage
When I compile a new firmware version and install it via the Arduino IDE, all settings like wifi SSID and PW and MQTT server are reset to the defaults. Shouldn't they survive a firmware update?