
SARA-R42 - Application note
UBX-20050829 - R02
EFS backup & restore
Page 48 of 58
C1-Public
13.1.1
EFS backup
The EFS backup can be initiated with the
+UBKUPDATA
AT command and will automatically trigger a
backup process upon receiving the command. After this procedure is completed, the device will store
status information that can be queried with an AT command. After the backup completion, no further
action is required.
The host can issue backup on an infrequent & rare basis that justifies for such a need to perform a
backup. This could be when some important and significant information in the file system has
changed or been added via AT commands, e.g. regarding the personalization data for security. One
likely point of needing a backup is after the host application factory initial "production", which may
include the module configuration to a specific use case requirement related to the security
functionalities. The backup command can also provide some information about the last backup.
The command's query response contains the number of backups and restores for each file system.
☞
There are not multiple backup “versions” stored; only a single copy of the latest backup is kept.
☞
To avoid excessive flash wear, the backup should be performed on a limited basis such as after
host application production and initialization.
☞
It can take up to 15 s for a backup to execute.
To detect when the backup function is complete, and the AT interface is available here is the following
option:
•
Wait for
+UUBKUPDATA
URC
o
Example for backup successful:
+UUBKUPDATA: 1,1
13.1.2
EFS restore
When an automatic restore is triggered, the device will immediately reset/restore the file system (this
may interrupt any currently running processes). The device will then reset, and store status
information that can be queried with an AT command. After the restore procedure is completed, no
further action is required, although some settings may need to be restored manually by the user, if
they were modified since the last backup.
If the restore process is interrupted (e.g. through power pull), the process will start from the beginning
again at the next module boot-up.
There is no available indication to the host processor that a restore is taking place during boot-up; it
would just appear as if boot-up is taking longer than typical. If a restore should take place, then the
host processor would need to allow more time for the device to handle the restore, until the AT
interface is made available.
☞
It can take up to 15 s for a restore to execute. This time includes the boot-up time.
The host can detect when a restore has taken place by a URC notification. Example: the
+UUBKUPDATA: 2,1
URC indicates the restore has taken place and is successful.
A manual restore can be triggered when one of the following conditions is detected by the host:
•
Lost of IMEI, which can be checked and detected with the
+CGSN
AT command, where:
o
+CSGN
would return the "+CME ERROR: memory failure" error result code
•
MNO profiles lost or duplicated, which can be checked and detected with
+UMNOPROF
AT command