Bundle Protection
124
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
File System
8.9.3 Commit a Bundle
Committing the bundle approves all the files which belong to the bundle. At the end of the process, all the
bundle files are in the standard file state, and the bundle state is in STOPPED state. In addition, the newly
downloaded content of the files becomes the active one.
The commit process is fail-safe; that is, if the device has been shut down during the bundle commit
procedure, on power-up the device automatically continues the bundle commit process.
8.9.4 Rollback a Bundle
Rolling back the bundle rejects all the new bundle file content. At the end of the process, all the bundle
files are in the standard file state, and the bundle state is in STOPPED state. In addition, the newly
downloaded content of the files is ignored, and the old copy becomes the active one.
The rollback process is fail-safe; that is, if the device has been shut down during the bundle rollback
procedure, on powerup the device automatically continues the bundle rollback process.
8.9.5 Retrieve the Bundle and Files State
To view the current state of the bundle, use the function sl_FsCtl (SL_FS_CTL_GET_STORAGE_INFO...).
To retrieve the bundle state of a specific file, use the sl_FsGetFileList() function or the sl_FsGetInfo()
function.
8.9.6 CC3220 Bundle Aspects
The M4 program can be created as a bundle file.
When the bundle is in the PENDING_COMMIT state, hardware WDT is automatically activated (if
configured in the mcubootinfo.bin). If the WDT expires, automatic reboot is triggered and the bundle files
are automatically rolled back.
When invoking the commit function, there are two options:
•
Continue the session as it is. In this case, there is no need to stop the WDT. Use
PRCMPeripheralReset(PRCM_WDT).
•
Do a clean reboot. In this case, the recommended way is to use PRCMHibernateCycleTrigger(). This
also stops the WDT (this method should be also used after rollback).
When invoking rollback (when the bundle is in the pending commit state), a clean reboot is required
(PRCMHibernateCycleTrigger()).
NOTE:
To configure the WDT, set the mcubootinfo file.
The WDT resets (hibernate-reset) the system after two time-out events.
BootInfo.ulStartWdtTime is a 32-bit field that contains the number of clock ticks; because the
WDT runs at 80 MHz, the maximum time-out possible is approximately (53 sec × 2)
Example of how to set the WDT for the CC3220 device:
#
define
APPS_WDT_START_KEY
0xAE42DB15
typedef struct
sBootInfo
{
_u8
ucActiveImg;
_u32
ulImgStatus;
_u32
ulStartWdtKey;
_u32
ulStartWdtTime;
}sBootInfo_t;
_sBootInfo_t
sBootInfo;
_u32
MasterToken = 1234;
i32
FileHdl;
_i32
Status;