Design Consideration
132
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
File System
•
Minimum file updates: invoking of file system functions, which triggers erase or write storage
commands, should be minimized. Such commands are triggered with each update of a file, and each
system function has documentation about whether it triggers a file update.
•
File allocation table: the file system allocation table resides on the SFLASH. New file creation and the
deletion of existing files involves updating the allocation table. TI recommends rewriting a file rather
than recreating (that is, deleting and creating) the file.
•
System configuration and user file creation: the system configuration is stored on the SFLASH, and
setting the system configuration triggers a file update operation. TI recommends setting the system
configuration and user file creation as part of the programming image, and then programming the
image. The programming method is working in an efficient way, to keep the number of SFLASH
accesses to the minimum. During the programming procedure, regardless the number of the
programmed files, the file system is written only twice.
•
The SFLASH storage type that the SimpleLink Wi-Fi device supports has a minimal block (=subsector)
size of 4096 bytes; this is the minimal unit with which the file system can work. Thus, the file system
software rounds the files sizes to a multiple of 4096 bytes. For example, creating a file with maximum
size of 20 bytes results in a file of 4096 bytes. For optimal consumption of the SFLASH, create files
where their maximum size is a multiple of 4096 minus 500 bytes (for each file the file system allocates
a header of 500 bytes).
•
The file system does not handle fragmentation; sometimes changing the order in which the files are
created may result in more space. Also, changing the order of user file creation in the programming
image may affect the SFLASH usage.
•
To reduce the SFLASH endurance, create a file which requires frequent updates with the FAILSAFE
flag; the number SFLASH writes is reduced in half because the system switches between the file
images.
8.15.3 Retrieving Info Regarding SFLASH Usage
The SimpleLink Wi-Fi device provides counters of the number of SFLASH write operations. The counters
can be obtained by:
•
Getting the storage info command returns the file allocation table writes counter. Though the file
allocation write counter is increased during the programming process, the actual count during the
programming is only two SFLASH write operations.
•
Getting the file info command returns the file write counter. For files created with the fail-safe flag, the
retrieved count should be divided in 2.
8.15.4 SFLASH Size
The SimpleLink Wi-Fi device file system supports an SFLASH size from 1MB up to 16MB.
The required storage size depends on the size of the vendor files, and the requirements of the target
system.
The minimum sizes recommended for the CC3220/R/S device is 2MB to 4MB, 4MB for the CC3220F, and
1MB to 2MB for the CC3120.
The following subsections describe the usage and the sizes that should be considered when determining
the required size of the SFLASH.
8.15.4.1 Restore to Factory is Disabled
If the implementation disables the restore-to-factory feature, the following storage units are allocated:
•
5 blocks, file system allocation table
•
32 blocks, reserved for system files
•
7 blocks, TI information file
•
66 blocks, service pack
•
Host size blocks, for the CC3220 device: storage for the host program.
•
Blocks for the vendor files