1.8.1.6 Storage

The storage application file:
  • Generates the Extended Address (EUI64).
  • Manages non-volatile data storage. The G3 stack needs to store in non-volatile memory some counters.
There are some functions that are called from G3 management application:
  • APP_STORAGE_GetExtendedAddress(): Returns the generated Extended Address (EUI64)
  • APP_STORAGE_GetNonVolatileData(): Returns the non-volatile data, read at initialization
  • APP_STORAGE_UpdateNonVolatileData(): Updates the non-volatile data

The implementation is different depending on the MCU device.

For PIC32CXMT devices (app_storage_pic32cxmt.c):
  • Extended Address (EUI64) is generated using the UniqueID.
  • Non-volatile data is stored in User Signature. When non-volatile data is updated (APP_STORAGE_UpdateNonVolatileData() function) it is stored in GPBR (volatile, but faster write access). SUPC power-down detection is used to store non-volatile data in User Signature (non-volatile, but slower write access) just before the power is down (_SUPC_PowerDownCallback() function).
For SAMD20 devices (app_storage_samd20.c):
  • Extended Address (EUI64) is generated using the UniqueID
  • Non-volatile data is stored in an EEPROM emulation area that SAMD20 Drivers provide