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.

Callbacks#

Functions#

void
emAfOtaStorageWriteInt32uToEeprom(uint32_t value, uint32_t realOffset)
uint32_t
void
emAfStorageEepromUpdateDownloadOffset(uint32_t offset, bool finalOffset)
bool
emAfOtaStorageDriverGetRealOffset(uint32_t *offset, uint32_t *length)

Macros#

#define
EEPROM_START EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_START
#define
EEPROM_END EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_END
#define
SAVE_RATE EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_DOWNLOAD_OFFSET_SAVE_RATE
#define
#define
#define
SLOT_STRATEGY EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_GECKO_BOOTLOADER_STORAGE_SUPPORT
#define
#define
VERSION_NUMBER_INDEX (MAGIC_NUMBER_INDEX + MAGIC_NUMBER_SIZE)
#define
MAGIC_NUMBER 0x01, 0x09, 0x05, 0x01, 0x00, 0x02, 0x00, 0x00
#define
VERSION_NUMBER 0x00, 0x00, 0x00, 0x03
#define
EBL_START_OFFSET_INDEX (VERSION_NUMBER_INDEX + VERSION_NUMBER_SIZE)
#define
SAVED_DOWNLOAD_OFFSET_INDEX (EBL_START_OFFSET_INDEX + EBL_START_OFFSET_SIZE)
#define
OTA_HEADER_INDEX (SAVED_DOWNLOAD_OFFSET_INDEX + MAX_BYTEMASK_LENGTH)
#define
MINIMUM_FILE_SIZE_TO_STORE_OFFSET (OTA_MINIMUM_HEADER_LENGTH)

API Documentation#

otaStorageEepromGetStorageStartAddress#

uint32_t otaStorageEepromGetStorageStartAddress ()

otaStorageEepromGetStorageEndAddress#

uint32_t otaStorageEepromGetStorageEndAddress ()

otaStorageEepromGetImageInfoStartAddress#

uint32_t otaStorageEepromGetImageInfoStartAddress ()

Callbacks Documentation#

emberAfPluginOtaStorageSimpleEepromEraseCompleteCallback#

void emberAfPluginOtaStorageSimpleEepromEraseCompleteCallback (bool success)

Erase complete.

Parameters
TypeDirectionArgument NameDescription
boolN/Asuccess

The result of the erase operation. Ver.: always

Called when an EEPROM erase operation has completed.


Function Documentation#

emAfOtaStorageWriteInt32uToEeprom#

void emAfOtaStorageWriteInt32uToEeprom (uint32_t value, uint32_t realOffset)
Parameters
TypeDirectionArgument NameDescription
uint32_tN/Avalue
uint32_tN/ArealOffset

emAfOtaStorageReadInt32uFromEeprom#

uint32_t emAfOtaStorageReadInt32uFromEeprom (uint32_t realOffset)
Parameters
TypeDirectionArgument NameDescription
uint32_tN/ArealOffset

emAfStorageEepromUpdateDownloadOffset#

void emAfStorageEepromUpdateDownloadOffset (uint32_t offset, bool finalOffset)
Parameters
TypeDirectionArgument NameDescription
uint32_tN/Aoffset
boolN/AfinalOffset

emAfOtaStorageDriverGetRealOffset#

bool emAfOtaStorageDriverGetRealOffset (uint32_t * offset, uint32_t * length)
Parameters
TypeDirectionArgument NameDescription
uint32_t *N/Aoffset
uint32_t *N/Alength

Macro Definition Documentation#

SOC_BOOTLOADING_SUPPORT_ENABLED#

#define SOC_BOOTLOADING_SUPPORT_ENABLED
Value:
false

SOC_BOOTLOADING_SUPPORT_TEXT#

#define SOC_BOOTLOADING_SUPPORT_TEXT
Value:
"no"

READ_MODIFY_WRITE_SUPPORT_TEXT#

#define READ_MODIFY_WRITE_SUPPORT_TEXT
Value:
"no"

EEPROM_START#

#define EEPROM_START
Value:
EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_START

EEPROM_END#

#define EEPROM_END
Value:
EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_STORAGE_END

SAVE_RATE#

#define SAVE_RATE
Value:
EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_DOWNLOAD_OFFSET_SAVE_RATE

DEFAULT_SLOT#

#define DEFAULT_SLOT
Value:
0

USE_FIRST_SLOT#

#define USE_FIRST_SLOT
Value:
0

USE_LAST_SLOT#

#define USE_LAST_SLOT
Value:
1

USE_SPECIFIC_SLOT#

#define USE_SPECIFIC_SLOT
Value:
2

DO_NOT_USE_SLOTS#

#define DO_NOT_USE_SLOTS
Value:
3

SLOT_STRATEGY#

#define SLOT_STRATEGY
Value:
EMBER_AF_PLUGIN_OTA_STORAGE_SIMPLE_EEPROM_GECKO_BOOTLOADER_STORAGE_SUPPORT

MAX_IMAGE_INFO_AND_OTA_HEADER_SIZE#

#define MAX_IMAGE_INFO_AND_OTA_HEADER_SIZE
Value:
2048

MAX_WORD_SIZE#

#define MAX_WORD_SIZE
Value:
4

MAGIC_NUMBER_INDEX#

#define MAGIC_NUMBER_INDEX
Value:
0

MAGIC_NUMBER_SIZE#

#define MAGIC_NUMBER_SIZE
Value:
8

VERSION_NUMBER_INDEX#

#define VERSION_NUMBER_INDEX
Value:
(MAGIC_NUMBER_INDEX + MAGIC_NUMBER_SIZE)

VERSION_NUMBER_SIZE#

#define VERSION_NUMBER_SIZE
Value:
4

MAGIC_NUMBER#

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

VERSION_NUMBER#

#define VERSION_NUMBER
Value:
0x00, 0x00, 0x00, 0x03

EBL_START_OFFSET_INDEX#

#define EBL_START_OFFSET_INDEX
Value:
(VERSION_NUMBER_INDEX + VERSION_NUMBER_SIZE)

EBL_START_OFFSET_SIZE#

#define EBL_START_OFFSET_SIZE
Value:
4

SAVED_DOWNLOAD_OFFSET_INDEX#

#define SAVED_DOWNLOAD_OFFSET_INDEX
Value:
(EBL_START_OFFSET_INDEX + EBL_START_OFFSET_SIZE)

MAX_BYTEMASK_LENGTH#

#define MAX_BYTEMASK_LENGTH
Value:
1024

OTA_HEADER_INDEX#

#define OTA_HEADER_INDEX
Value:
(SAVED_DOWNLOAD_OFFSET_INDEX + MAX_BYTEMASK_LENGTH)

MINIMUM_FILE_SIZE_TO_STORE_OFFSET#

#define MINIMUM_FILE_SIZE_TO_STORE_OFFSET
Value:
(OTA_MINIMUM_HEADER_LENGTH)