Bundle Protection
123
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
File System
Table 8-5. Bundle States
Bundle State
Possible Files State
STOPPED
All files are in normal state
STARTED
• Normal
• BUNDLE_FILE
• PENDING_BUNDLE_COMMIT
PENDING_COMMIT
• Normal
• PENDING_BUNDLE_COMMIT
8.9.2 Bundle States
The bundle can be in one of three states:
•
STOPPED
•
STARTED
•
PENDING_COMMIT
The following subsections describe the various bundle states.
8.9.2.1
STOPPED
No bundle exists.
8.9.2.2
STARTED
The bundle changes its state to STARTED when the first bundle file is opened for write.
In this state, the host is writing the bundle files and keeps the order of the files updated (a certificate
should be written before the file that uses it is closed). Opening the files that belong to a bundle in the
STARTED state for read results in the content of the old file copy.
Transition from this state to the PENDING_COMMIT state is executed if all the following conditions are
fulfilled:
•
sl_Stop (x > 0) and sl_Start() is called.
•
All the bundle files are in the PENDING_BUNDLE_COMMIT state.
Transition from this state to the STOPPED state is executed if the following condition is fulfilled:
•
sl_Start() is called without calling sl_Stop (x > 0). In this scenario, the bundle is automatically rolled
back by the device, or the rollback function was invoked by the host.
8.9.2.3
PENDING_COMMIT
This state is used to enable the host to run test code to decide if the downloaded bundle files are working
as expected.
While in this state, open files for read returns the content of the new files copy.
While in this state, files cannot be opened for write with the bundle flags; in such cases, the device returns
an error: SL_ERROR_FS_BUNDLE_NOT_IN_CORRECT_STATE.
Transition from this state to the STOPPED state is executed if one of the following scenarios is fulfilled:
•
On a successful host test, the host invokes the commit bundle function: sl_FsCtl
(SL_FS_CTL_COMMIT...).
•
On a failed host test, the host resets the device (hibernate or POR) or invokes the rollback bundle:
sl_FsCtl (SL_FS_CTL_ROLLBACK...), after calling the command reboot is required.
•
The sl_Start() function is called; automatic rollback is triggered by the device.