Hi,
we are developing a way to define through code a zigbee device composed of multiple endpoints, based on nRF5 SDK for Thread and Zigbee v4.1.0.
The program can be flashed to the board by an operator. We would like to call zigbee_erase_persistent_storage() when the board starts for the first time a new program after it has been flashed. We should do so because the data stored by ZBOSS in flash memory could be inconsistent since the address of some variables could be different.
Unfortunately, the flash area used by ZBOSS is not cleared when a new program is flashed (please note that we are not using Nordic bootloader).
At the moment, we have tested two possibilities to detect when a program changes:
- using the registers NRF_UICR registers to store a build timestamp that identifies the program
- using a sector of the Flash to store a build timestamp that identifies the program.
Both approaches seem to work, but we wonder if there is a better solution that does not involve a change to the bootloader.
Thank you,
Valerio
