Zigbee persistent data management and non-volatile memory

Revision as of 11:09, 6 March 2023 by Registered User
Under construction.png Coming soon

1. Introduction

Zigbee network node can be Off (power shutdown) for any reason. If network data are stored only in RAM, they will be lost. For that, we need to store some type of data, that we call Persistent Data, in a Non-Volatile Memory (NVM). These data might be stack context or cluster attributes .frame counters dynamic keys
The STM32WB storage in Flash memory is done by the mean of dedicated persistent data APIs that we will describe in this wiki.

Memory Mapping
Connectivity NVM MemoryMapping.png

stack notification each time persistent data change, the stack notify the application. To do that, the application must enable stack notification by calling ZbPersistNotifyRegister and implement the associated callback

static void APP_ZIGBEE_persist_notify_cb

when ZbPersistNotifyRegister API is called with NULL arguments, the stack notification is disabled. ZbPersistGet API is provided by the stack to get the persistent data from RAM. cluster attributes can be persistent data if it is declared with ZCL_ATTR_FLAG_PERSISTABLE user must declare the flash memory range in the scatter file for NVM EEPROM Emulator the NVM implementation emulates an EEPROM. This impact the real size available for the persistent data. basically, as shown in the figure below, we have EE header for each record that sizes 2032 bytes. so it remains 2032 bytes for data. So this only half of the memory is used.

Flash memory example with EEPROM Emulator
Connectivity NVM EE.png

Persistent data NVM application example An example is provided in STM32CubeWB MCU Package[1]. to do: figure qui explique le use case ce que montre le use case

2. References