OTA Storage Simple EEPROM#

API and Callbacks for the OTA Storage Simple EEPROM Component.

This is a driver for the Over-the-Air simple storage module component. It uses an EEPROM as the underlying storage device. It provides a means to record data being read or written, as well as metadata with information about how far along a client download is. It can be used either by an OTA Client or an OTA Server. Note that this component assumes that the flash storage does not have read-modify-write support. Users should ensure this value matches the flash storage device used by the application. A mismatch between the project-configured value and the actual flash storage support value will result in an application that asserts upon startup.

API#

uint32_t

Returns the OTA Storage EEPROM starting address. This is determined by either ::SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_START or the slot start address, if using slots.

uint32_t

Returns the OTA Storage EEPROM end address. This is determined by either ::SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_END or the slot end address, if using slots.

uint32_t

Returns the OTA Storage EEPROM image information start address.

Callbacks#

void

Function callback after an EEPROM erase operation completes.

Macros#

#define
SOC_BOOTLOADING_SUPPORT_ENABLED false

This is configured by SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_SOC_BOOTLOADING_SUPPORT in ota-storage-simple-eeprom-config.h.

#define
SOC_BOOTLOADING_SUPPORT_TEXT "no"
#define
READ_MODIFY_WRITE_SUPPORT_TEXT "no"

SOC Read-Modify-Write Support which is configured by: SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_READ_MODIFY_WRITE_SUPPORT in ota-storage-simple-eeprom-config.h.

#define
EEPROM_START SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_START

The begining of the OTA Storage slot.

#define
EEPROM_END SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_END

This is the last offset for where the OTA image may be stored in the EEPROM.

#define
SAVE_RATE SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_DOWNLOAD_OFFSET_SAVE_RATE

Frequency for Saving Download Offset to EEPROM in bytes.

#define
SLOT_STRATEGY SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_GECKO_BOOTLOADER_STORAGE_SUPPORT

The SLOT_STRATEGY defines if the Gecko Bootloader Storage Support.

#define
MAGIC_NUMBER 0x01, 0x09, 0x05, 0x01, 0x00, 0x02, 0x00, 0x00

Magic number to indicate that the stored download meta-data is valid.

#define
VERSION_NUMBER 0x00, 0x00, 0x00, 0x03

Version number information:
0x00000001 - Addition of the Page-erase required support
0x00000002 - Support for 2-byte word sizes (previously-previously 1-byte was assumed)
0X00000003 - Support for 4-byte word sizes (previously 2-byte was assumed)
We changed the size of the bytemask to 512 to support Local Storage which means bumping the version number.

#define
EBL_START_OFFSET_INDEX (VERSION_NUMBER_INDEX + VERSION_NUMBER_SIZE)

The Offset within the OTA file (relative to offset 0) where the GBL data starts.

#define
EBL_START_OFFSET_SIZE 4
#define
SAVED_DOWNLOAD_OFFSET_INDEX (EBL_START_OFFSET_INDEX + EBL_START_OFFSET_SIZE)

The last recorded offset we downloaded.

#define
MAX_BYTEMASK_LENGTH 1024

Limits the maximum size of the download image because it determines how many pages we can record as "fully downloaded".

#define
OTA_HEADER_INDEX (SAVED_DOWNLOAD_OFFSET_INDEX + MAX_BYTEMASK_LENGTH)

The OTA header index.

#define
MAX_IMAGE_INFO_AND_OTA_HEADER_SIZE (MAX_BYTEMASK_LENGTH + 1024)

The maximum image information and OTA header size.

#define
MINIMUM_FILE_SIZE_TO_STORE_OFFSET (OTA_MINIMUM_HEADER_LENGTH)

The minimum offset we will write that determines if we store the current download offset persistently.

API Documentation#

otaStorageEepromGetStorageStartAddress#

uint32_t otaStorageEepromGetStorageStartAddress ()

Returns the OTA Storage EEPROM starting address. This is determined by either ::SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_START or the slot start address, if using slots.

Returns

  • A ::uint32_t value indicating the starting address


otaStorageEepromGetStorageEndAddress#

uint32_t otaStorageEepromGetStorageEndAddress ()

Returns the OTA Storage EEPROM end address. This is determined by either ::SL_ZIGBEE_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_END or the slot end address, if using slots.

Returns

  • A ::uint32_t value indicating the end address.


otaStorageEepromGetImageInfoStartAddress#

uint32_t otaStorageEepromGetImageInfoStartAddress ()

Returns the OTA Storage EEPROM image information start address.

Returns

  • A ::uint32_t value indicating the image information start address


Callbacks Documentation#

sl_zigbee_af_ota_storage_simple_eeprom_erase_complete_cb#

void sl_zigbee_af_ota_storage_simple_eeprom_erase_complete_cb (bool success)

Function callback after an EEPROM erase operation completes.

Parameters
TypeDirectionArgument NameDescription
bool[out]success

The result of the erase operation. Ver.: always

The input parameter will be set to true if the EEPROM erase returned :EEPROM_SUCCESS.