name=OTA Simple Storage EEPROM Driver
category=ZigBee OTA Bootloading

# Any string is allowable here.  Generally it is either: Production Ready, Test Tool, or Requires Extending
qualityString=Production Ready
# This must be one of the following:  productionReady, testTool, extensionNeeded
quality=production

introducedIn=

description=This is a driver for the Over-the-air simple storage module plugin.  It uses an EEPROM as the underlying storage device.  It provides a means to record the actual data being read or written, as well as meta-data with information about how far along a client download is.  It can be used either by an OTA Client or an OTA Server.

sourceFiles=ota-storage-eeprom.c, ota-storage-eeprom-page-erase.c, ota-storage-eeprom-read-modify-write.c

implementedCallbacks=emberAfOtaStorageDriverInitCallback, emberAfOtaStorageDriverReadCallback, emberAfOtaStorageDriverWriteCallback, emberAfOtaStorageDriverDownloadFinishCallback, emberAfOtaStorageDriverInvalidateImageCallback, emberAfOtaStorageDriverRetrieveLastStoredOffsetCallback, emberAfOtaStorageDriverPrepareToResumeDownloadCallback

requiredPlugins=ota-storage-simple, eeprom

options=socBootloadingSupport, enableSocAppBootloaderCompatibilityMode, geckoBootloaderStorageSupport, slotToUse, storageStart, storageEnd, readModifyWriteSupport, downloadOffsetSaveRate
conditions=slotManagerNeeded,readModifyWriteSupportSelected

socBootloadingSupport.name=SOC Bootloading Support
socBootloadingSupport.description=This option enables bootloading support for SOC devices.  When enabled, it will re-map the OTA image file so that the EBL data is at the top of the EEPROM and therefore can be accessed by all existing Ember bootloaders.  It requires that the EBL portion of the image is the first TAG in the file.  The OTA storage starting offset should be 0 when this is enabled.
socBootloadingSupport.type=BOOLEAN
socBootloadingSupport.default=true

enableSocAppBootloaderCompatibilityMode.name=EM35x SOC Only:  Enable 4.2 Application Bootloader Compatibility Mode
enableSocAppBootloaderCompatibilityMode.description=For 35x SOC chips that are running an EmberZNet 4.2 application bootloader they must enable this compatibility mode and include a copy of a newer EEPROM driver (EmberZNet 4.3 or later version) in the application.  Normally the 35x has the ability to use EEPROM driver code shared by both the application and bootloader.  However that EEPROM driver must have support for arbitrary page writes.  The Ember drivers included with the EmberZNet 4.2 EM35x application bootloaders did NOT have this support.  Therefore this plugin cannot use them and a copy of the driver must be added in the application.
enableSocAppBootloaderCompatibilityMode.type=BOOLEAN
enableSocAppBootloaderCompatibilityMode.default=false

downloadOffsetSaveRate.name=Frequency for Saving Download Offset to EEPROM (bytes)
downloadOffsetSaveRate.description=How often the current download offset is stored to EEPROM, in bytes.  If set to 0 it will always be written to EEPROM.  This is only used for "read-modify-write" drivers.
downloadOffsetSaveRate.type=NUMBER
downloadOffsetSaveRate.default=1024

geckoBootloaderStorageSupport.name=Gecko Bootloader Storage Support
geckoBootloaderStorageSupport.description=This option dictates the method for saving OTA images to slots. This is only applicable if a Gecko storage bootloader is running on the chip. The Slot Manager plugin must be selected in order for slots to be used. If a Gecko storage bootloader is not present on the chip, the offsets entered below will be used. If "Do not use slots" is selected, then the offsets entered below will be used to determine where to save the image. This is not recommended, as using set offsets to addresses with a Gecko storage bootloader requires knowledge of storage slot addresses and boundaries. A mismatch in addresses will cause OTA to not work.
geckoBootloaderStorageSupport.type=LIST:Do not use slots, Use first slot, Use last slot, Use specific slot
geckoBootloaderStorageSupport.default=Do not use slots

# If using slots, slot-manager must be included
slotManagerNeeded.expression=!(!(geckoBootloaderStorageSupport.equals("Do not use slots")) @and !(slot_manager_enabled))
slotManagerNeeded.message=Using Gecko Bootloader storage support requires the Slot Manager plugin

slotToUse.name=Storage Slot To Save Images To
slotToUse.description=If the user selects "Use specific slot" for Gecko Bootloader Storage Support, then this value dicatates the slot to use.
slotToUse.type=NUMBER
slotToUse.default=0

storageStart.name=OTA Storage Start Offset
storageStart.description=This is the starting offset for where the OTA image will be stored in the EERPOM.
storageStart.type=NUMBER
storageStart.default=0

storageEnd.name=OTA Storage End Offset
storageEnd.description=This is the last offset for where the OTA image may be stored in the EEPROM.
storageEnd.type=NUMBER
# 0x40000 limit chosen for default (EMAPPFWKV2-1712)
storageEnd.default=262144

readModifyWriteSupport.name=EEPROM Device Read-modify-write Support
readModifyWriteSupport.description=This indicates to the OTA code whether the underlying EEPROM driver has support for 'read-modify-write'.  Read-modify-write assumes a page erase is not required prior to writing, and any location or length of data can be re-written.  If not present, then the OTA code will note each full page of data downloaded and must erase entire pages before downloading a chunk of data.
readModifyWriteSupport.type=LIST:true,false,unspecified
readModifyWriteSupport.default=unspecified

readModifyWriteSupportSelected.expression=!readModifyWriteSupport.equals("unspecified")
readModifyWriteSupportSelected.message=Select "EEPROM Device Read-modify-write Support" option, based on the underlying EEPROM Driver

events=PageErase