SWRA657 June   2020 CC3100 , CC3200

 

  1.   SimpleLink Wi-Fi CC3100, CC3200 Serial Flash
    1.     Trademarks
    2. Introduction
    3. How File System Content Gets to the Serial Flash
    4. File System Guidelines
    5. User File Mathematics
    6. System and Configuration Files
      1. 5.1 Description
      2. 5.2 Memory Consumption
        1. 5.2.1 CC3200 Use Case
        2. 5.2.2 Host Driver Mapping
        3. 5.2.3 Minimum Flash Size
    7. Implementing File System Features From Host Processor
      1. 6.1 Overview
      2. 6.2 File Listing
        1. 6.2.1 Requirements
        2. 6.2.2 Procedure
      3. 6.3 Free/Occupied Space
        1. 6.3.1 Requirements
        2. 6.3.2 Procedure
      4. 6.4 File Appending
        1. 6.4.1 Requirements
        2. 6.4.2 Procedure
    8. Factors to Consider in Designing With Serial Flash
      1. 7.1 Serial Flash Vendor and Part Number Selection
      2. 7.2 Supported Flash Types
      3. 7.3 Frequent Write Operations
        1. 7.3.1 Serial Flash Access by the Wi-Fi System"
        2. 7.3.2 Seral Flash Access by the WiFi System
          1. 7.3.2.1 System Files
          2. 7.3.2.2 User Files
      4. 7.4 Sudden Power Off (power removal during a write/erase phase)
        1. 7.4.1 Battery Powered Systems
        2. 7.4.2 Line Powered Systems
    9. Design Recommendations for Ensuring the Integrity of the Power Supply to the Serial Flash
      1. 8.1 Overview
      2. 8.2 Key Points
      3. 8.3 Brown-Out Mitigation Techniques for New Self-Hosted CC3200 Designs
    10. Recommended Best Practices
    11. 10 Implications of Data Integrity Compromise to CC3100/CC3200
      1. 10.1 Recovery
    12. 11 References

Procedure

The procedure for calculating free/occupied space is as follows:

  1. Initialize the free space to the size of the flash (as formatted by Uniflash) and the occupied space to 0. Units are blocks (of 4KB)
  2. Account for FAT and the reserved blocks:
    1. Decrease free space by 5 blocks
    2. Increase occupied space by 5 blocks
  3. Calculate the allocated size for every user file created. For more information, see Section 4.
  4. Loop over all user files and for every file apply:
    1. Decrease free space by the allocated size in blocks
    2. Increase occupied space by the allocated size in blocks
  5. Loop over all system/configuration files, invoke fsGetInfo() API and conclude:
    1. If return value is SL_FS_ERR_FILE_NOT_EXISTS, file does not exist and thus counters should remain, else, if no error is returned, followings should be updated:
      1. Decrease free space by the allocated size in blocks
      2. Increase occupied space by the allocated size in blocks
    2. If return value is SL_FS_ERR_TOKEN_IS_NOT_VALID, it means the file is secured but exists. This return value applies to the following three files:
      1. /tmp/fcon.frm
      2. /sys/pref.net
      3. /sys/smartconfigkeys.cfg

In this case, the file exists and followings should be updated:

  • Decrease free space by the allocated size in blocks
  • Increase occupied space by the allocated size in blocks

Figure 3 illustrates the procedure.

swra657-free-space-and-occupied-space-calculation.gifFigure 3. Free Space and Occupied Space Calculation