SWRU455M February   2017  – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF

 

  1. Overview
    1. 1.1 Trademarks
  2. Introduction
    1. 1.1 Features
    2. 1.2 Key Features
    3. 1.3 Block Diagram
    4. 1.4 Host Driver Overview
      1. 1.4.1 Host Interface
      2. 1.4.2 OS versus Non-OS
      3. 1.4.3 Quick Reference
      4. 1.4.4 Porting to Different Platforms
    5. 1.5 Acronyms and Terminologies
  3. Networking Application
    1. 2.1 Introduction
      1. 2.1.1 Wi-Fi Connectivity
      2. 2.1.2 Traffic Types
      3. 2.1.3 Security
      4. 2.1.4 User Experience
      5. 2.1.5 Power Consumption
      6. 2.1.6 Provisioning
    2. 2.2 Basic Examples
      1. 2.2.1 Wi-Fi Doorbell
        1. 2.2.1.1 Description
        2. 2.2.1.2 Design Considerations
      2. 2.2.2 Power Socket
        1. 2.2.2.1 Description
        2. 2.2.2.2 Design Constraints
      3. 2.2.3 Wi-Fi Tag
        1. 2.2.3.1 Description
        2. 2.2.3.2 Design Consideration
  4. Device
    1. 3.1  Introduction
    2. 3.2  Key Features
    3. 3.3  Start and Stop
      1. 3.3.1 Start
      2. 3.3.2 Stop
      3. 3.3.3 Hibernate and Shutdown
      4. 3.3.4 Lock State
      5. 3.3.5 Initialization Sequence
    4. 3.4  Host Interface
      1. 3.4.1 SPI Interface
      2. 3.4.2 UART Interface
        1. 3.4.2.1 Change UART Baud Rate
    5. 3.5  Version
    6. 3.6  Event Mask
    7. 3.7  Time and Date
    8. 3.8  MAC Address
    9. 3.9  Device Name
    10. 3.10 Domain Name
    11. 3.11 Device Status
    12. 3.12 Persistent Configuration
    13. 3.13 Device Statistics
    14. 3.14 Errors
  5. WLAN
    1. 4.1  Introduction
    2. 4.2  Key Features
    3. 4.3  Station (STA)
      1. 4.3.1 General Description
      2. 4.3.2 Configurations and Settings
        1. 4.3.2.1 Set Mode
        2. 4.3.2.2 Set General STA Parameters
      3. 4.3.3 Connection
        1. 4.3.3.1 Connection Policies
        2. 4.3.3.2 Preferred Networks (Profiles)
        3. 4.3.3.3 Manual Connection
      4. 4.3.4 Events and Errors
      5. 4.3.5 RSSI Trigger
      6. 4.3.6 Soft-Roaming
      7. 4.3.7 Beacon Interval and DTIM Period
      8. 4.3.8 Agile Multiband
      9. 4.3.9 Triggered Roaming
    4. 4.4  Access Point
      1. 4.4.1 General Description
      2. 4.4.2 Configurations and Settings
        1. 4.4.2.1 Set Mode
        2. 4.4.2.2 Set General AP Parameters
        3. 4.4.2.3 Get General AP Parameters
        4. 4.4.2.4 Black List
      3. 4.4.3 Set Network Configuration
        1. 4.4.3.1 Set AP IP Parameters
      4. 4.4.4 Station Management
        1. 4.4.4.1 Get Connected Stations
        2. 4.4.4.2 Disconnect a Station
      5. 4.4.5 Events and Errors
      6. 4.4.6 Limitations
    5. 4.5  Wi-Fi Direct
      1. 4.5.1 General Description
      2. 4.5.2 Supported Features
      3. 4.5.3 Configurations and Settings
        1. 4.5.3.1 Configuring Wi-Fi Direct General Parameters
        2. 4.5.3.2 Set Wi-Fi Direct Policy
        3. 4.5.3.3 Configure Connection Policy
      4. 4.5.4 Connection
      5. 4.5.5 Events and Errors
      6. 4.5.6 Limitations
    6. 4.6  WLAN Security
      1. 4.6.1 Personal Security
      2. 4.6.2 Enterprise Security
      3. 4.6.3 WPS
    7. 4.7  Scan
      1. 4.7.1 General Description
      2. 4.7.2 Connection Scan
      3. 4.7.3 Configuration (AP/STA)
      4. 4.7.4 Usage
      5. 4.7.5 Miscellaneous
    8. 4.8  Antenna Diversity
      1. 4.8.1 Overview
      2. 4.8.2 Configuration
      3. 4.8.3 Pad Selection
    9. 4.9  Calibrations
      1. 4.9.1 2.4-GHz Wi-Fi Calibration Modes
      2. 4.9.2 5-GHz Wi-Fi Calibration Modes
        1. 4.9.2.1 Serving Channel Calibrations
        2. 4.9.2.2 Non-Serving Channel Calibrations
        3. 4.9.2.3 Storing Calibration Data
        4. 4.9.2.4 Transceiver Socket
    10. 4.10 BLE / 2.4-GHz Radio Coexistence
      1. 4.10.1 Key Features
      2. 4.10.2 Configuration and Settings
      3. 4.10.3 Operation
        1. 4.10.3.1 Calibration
  6. Network Addresses
    1. 5.1 Introduction
    2. 5.2 Key Features
    3. 5.3 Addressing
      1. 5.3.1 IPv4 Addresses
      2. 5.3.2 IPv6 Addresses
        1. 5.3.2.1 Local Link
        2. 5.3.2.2 Link-Global
      3. 5.3.3 DNS Addresses
    4. 5.4 DHCPv4 Client
      1. 5.4.1 Modes
      2. 5.4.2 Address Release
    5. 5.5 DHCPv4 Server
      1. 5.5.1 Enable and Disable the DHCP Server
      2. 5.5.2 Set DHCP Server Parameters
    6. 5.6 DNS Server
    7. 5.7 Errors and Asynchronous Events
  7. Socket
    1. 6.1 Introduction
    2. 6.2 Key Features
    3. 6.3 Socket Types
    4. 6.4 BSD API
    5. 6.5 Socket Working Flow
      1. 6.5.1 TCP
        1. 6.5.1.1 Client Side
        2. 6.5.1.2 Server Side
        3. 6.5.1.3 TCP Keep Alive
      2. 6.5.2 UDP
        1. 6.5.2.1 Multicast
        2. 6.5.2.2 Packet Boundary
      3. 6.5.3 RAW
        1. 6.5.3.1 Layer 4: Transport
        2. 6.5.3.2 Layer 3: Network
        3. 6.5.3.3 Layer 2: Data Link (Transceiver Mode, Not Connected)
      4. 6.5.4 Network Bypass Mode
    6. 6.6 DNS
    7. 6.7 Operation Modes
      1. 6.7.1 Nonblocking Mode
      2. 6.7.2 Trigger Mode
        1. 6.7.2.1 Trigger Mode for Accept
        2. 6.7.2.2 Trigger Mode for Data Reception
      3. 6.7.3 Multiple Select
    8. 6.8 IP Fragmentation
    9. 6.9 Errors
  8. Secure Socket
    1. 7.1 Introduction
    2. 7.2 Key Features
    3. 7.3 Opening a Secure Socket
    4. 7.4 Trusted Root-Certificate Catalog
    5. 7.5 Options and Features Use
      1. 7.5.1 Set TLS Version
      2. 7.5.2 Set Cipher Suites
      3. 7.5.3 Set Certificates, Root CA, Private Key, and DH Files
      4. 7.5.4 Disable the Use of the Trusted Root-Certificate Catalog
      5. 7.5.5 Set ALPN List
        1. 7.5.5.1 ALPN Fixed List
        2. 7.5.5.2 ALPN Generic
      6. 7.5.6 Set Domain Name for Verification and SNI
      7. 7.5.7 Enable OCSP Check
      8. 7.5.8 Upgrade Nonsecured Socket to Secured
      9. 7.5.9 Get Connection Parameters
    6. 7.6 Supported Cryptographic Algorithms
    7. 7.7 Common Errors and Asynchronous Events
      1. 7.7.1 Using Socket Asynchronous Events in TLS
      2. 7.7.2 Common Errors
  9. File System
    1. 8.1  Introduction
    2. 8.2  Key Features
    3. 8.3  File System Characteristics
    4. 8.4  Write a File
      1. 8.4.1 Introduction
      2. 8.4.2 Create a File versus Open for Write
      3. 8.4.3 Create a File
        1. 8.4.3.1 Secure File Creation Notes
        2. 8.4.3.2 Forced Creation Flags
      4. 8.4.4 Open a File for Write
      5. 8.4.5 Write an Opened File
      6. 8.4.6 Close an Opened File (for Write)
      7. 8.4.7 Close an Opened Secure-Signed File (for Write)
    5. 8.5  Read a File
      1. 8.5.1 Open a File for Read
      2. 8.5.2 Read an Opened File
      3. 8.5.3 Close an Opened File (for Read)
    6. 8.6  Delete a File
    7. 8.7  Rename a File
    8. 8.8  File System Helper Functions
      1. 8.8.1 Get File Information
      2. 8.8.2 Get Storage Information
      3. 8.8.3 Get List of Files
    9. 8.9  Bundle Protection
      1. 8.9.1 Bundle File States
      2. 8.9.2 Bundle States
        1. 8.9.2.1 STOPPED
        2. 8.9.2.2 STARTED
        3. 8.9.2.3 PENDING_COMMIT
      3. 8.9.3 Commit a Bundle
      4. 8.9.4 Rollback a Bundle
      5. 8.9.5 Retrieve the Bundle and Files State
      6. 8.9.6 M4 Host Application Bundle Aspects
    10. 8.10 File Commit Feature
      1. 8.10.1 File Commit Process
    11. 8.11 File Rollback Process
    12. 8.12 Programming
      1. 8.12.1 Creation of the Programming Image
        1. 8.12.1.1 Programming Image Types
        2. 8.12.1.2 Program the Device
          1. 8.12.1.2.1 Image Creator Tool (UART) Programming
          2. 8.12.1.2.2 Host Programming
          3. 8.12.1.2.3 External Tool Programming
    13. 8.13 Restore to Factory
      1. 8.13.1 Restore to Factory by the Host
      2. 8.13.2 Restore to Factory by Using the SOP
        1. 8.13.2.1 CC31xx
        2. 8.13.2.2 CC32xx
    14. 8.14 Security Alerts
    15. 8.15 Design Consideration
      1. 8.15.1 Choosing SFLASH Type
      2. 8.15.2 Software Design Consideration
      3. 8.15.3 Retrieving Info Regarding SFLASH Usage
      4. 8.15.4 SFLASH Size
        1. 8.15.4.1 Restore to Factory is Disabled
        2. 8.15.4.2 Restore to Factory is Enabled
      5. 8.15.5 Storage Usage Information
  10. HTTP Server
    1. 9.1 Introduction
      1. 9.1.1 Built-in Configuration Pages
      2. 9.1.2 RESTful APIs
        1. 9.1.2.1 Changing Configuration
        2. 9.1.2.2 Reading Configuration
      3. 9.1.3 Custom Static Pages
        1. 9.1.3.1 Custom Pages With Device Tokens
        2. 9.1.3.2 Static Pages With Host Tokens
      4. 9.1.4 Host Application Interface
    2. 9.2 Key Features
    3. 9.3 Configurations and Settings
    4. 9.4 RESTful API Processing
      1. 9.4.1  Ping
      2. 9.4.2  IP Configuration
      3. 9.4.3  URN Configuration
      4. 9.4.4  WLAN Profiles
      5. 9.4.5  WLAN Scan
      6. 9.4.6  Provisioning Confirmation
      7. 9.4.7  Connection Policy
      8. 9.4.8  Station Action
      9. 9.4.9  AP Black List
      10. 9.4.10 Date and Time
    5. 9.5 Device Parameter Querying Through HTTP (Device Tokens)
      1. 9.5.1  Retrieving Tokens Through GET Request
      2. 9.5.2  Embedded Tokens
      3. 9.5.3  System Information
      4. 9.5.4  Version Information
      5. 9.5.5  Network Information
      6. 9.5.6  Ping Results
      7. 9.5.7  Connection Policy Status
      8. 9.5.8  Provisioning
      9. 9.5.9  Display Profile Information
      10. 9.5.10 P2P Information
      11. 9.5.11 Host Tokens
    6. 9.6 Resource Search Order
      1. 9.6.1 GET Request Search Order
      2. 9.6.2 POST Request Search Order
      3. 9.6.3 PUT and DELETE Request Search Order
    7. 9.7 Host HTTP Requests Processing
      1. 9.7.1 Metadata (TLVs) Description
      2. 9.7.2 GET Processing
        1. 9.7.2.1 Fragmentation
      3. 9.7.3 POST Processing
        1. 9.7.3.1 Long Requests and Delayed Responses
      4. 9.7.4 PUT Processing
      5. 9.7.5 DELETE Processing
    8. 9.8 Security
      1. 9.8.1 Authentication
        1. 9.8.1.1 HTTP Realm
      2. 9.8.2 Secure Connection
    9. 9.9 Processing of Parallel Requests
  11. 10mDNS
    1. 10.1 Introduction
    2. 10.2 Key Features
    3. 10.3 Configurations and Settings
    4. 10.4 Query
      1. 10.4.1 One Shot Query
      2. 10.4.2 Continuous Query
      3. 10.4.3 Mask Services
    5. 10.5 Get Service List
    6. 10.6 Advertisement
      1. 10.6.1 Registering mDNS Services
      2. 10.6.2 Unregistering mDNS Services
      3. 10.6.3 Advertisement Settings
        1. 10.6.3.1 Timing
        2. 10.6.3.2 Update Text
    7. 10.7 Limitations
  12. 11Rx Filters
    1. 11.1 Introduction
    2. 11.2 Matching Process
      1. 11.2.1 Filter Matching
      2. 11.2.2 Tree Traversal
    3. 11.3 Examples of Filter Use
      1. 11.3.1 Example 1
      2. 11.3.2 Example 2
    4. 11.4 Filter Creation
      1. 11.4.1 Filter Type
      2. 11.4.2 Filter Flags
      3. 11.4.3 Rule Structure for Header Filters
        1. 11.4.3.1 Field
        2. 11.4.3.2 Compare Functions
        3. 11.4.3.3 Rule Fields
        4. 11.4.3.4 Pattern-Matching Rule Fields
      4. 11.4.4 Rule Structure for Combined Filters
      5. 11.4.5 Filter Trigger
        1. 11.4.5.1 Parent Filter ID
        2. 11.4.5.2 Connection State and Role
        3. 11.4.5.3 Filter During Transceiver Mode
      6. 11.4.6 Rx Filter Action
        1. 11.4.6.1 Send Events Action
        2. 11.4.6.2 Multiple Bits Set on the Same Event
        3. 11.4.6.3 Multiple Events From the Same Rx Frame
        4. 11.4.6.4 Code Example
        5. 11.4.6.5 Counter Action
    5. 11.5 Managing Filters
      1. 11.5.1 Enable and Disable Filters
      2. 11.5.2 Get Filter Status
      3. 11.5.3 Removing a Filter
      4. 11.5.4 Storing Filters into the SFLASH
      5. 11.5.5 Update Filter Arguments
  13. 12Ping
    1. 12.1 General Description
    2. 12.2 Start and Stop Ping
    3. 12.3 Limitations
  14. 13Transceiver
    1. 13.1 Introduction
    2. 13.2 Key Features
    3. 13.3 Configurations and Setting
      1. 13.3.1 Open Transceiver Socket
      2. 13.3.2 Close Transceiver Socket
      3. 13.3.3 Send Data
      4. 13.3.4 Receive Data
    4. 13.4 Internal Packet Generator
    5. 13.5 CW
    6. 13.6 Changing Socket Properties
      1. 13.6.1 Change Operating Channel
      2. 13.6.2 Change Default PHY Data Rate
      3. 13.6.3 Change Tx Power
      4. 13.6.4 Change Number of Frames to Transmit (Internal Packet Generator)
      5. 13.6.5 Change 802.11b Preamble
      6. 13.6.6 Set CCA Threshold
      7. 13.6.7 Set Tx Frames Time-out
      8. 13.6.8 Enable or Disable Sending ACKs
    7. 13.7 Limitations
  15. 14Real-Time RSSI
    1. 14.1 Introduction
    2. 14.2 Data Structure
    3. 14.3 Configurations and Settings
      1. 14.3.1 Connect to an AP
      2. 14.3.2 Opening Real-Time RSSI Socket
      3. 14.3.3 Example Code
    4. 14.4 Constraints
  16. 15Power Management
    1. 15.1 Introduction
      1. 15.1.1 Key Features
      2. 15.1.2 LPDS
      3. 15.1.3 802.11 Power Save
        1. 15.1.3.1 LSI (Long Sleep Interval)
      4. 15.1.4 WFA IoT Low Power
      5. 15.1.5 Low Power versus Latency
      6. 15.1.6 Power Modes versus Device Modes
    2. 15.2 Configurations and Settings
      1. 15.2.1 Changing Power Policy
      2. 15.2.2 Enabling Fast Connect
    3. 15.3 Network Applications and Power Consumption
      1. 15.3.1 mDNS
      2. 15.3.2 HTTP Server
    4. 15.4 Design Guidelines
      1. 15.4.1 LSI and Packet Loss
      2. 15.4.2 PHY Calibration Mode
  17. 16Provisioning
    1. 16.1  Introduction
    2. 16.2  Key Features
    3. 16.3  Provisioning Process Overview
      1. 16.3.1 Configuring a Profile
      2. 16.3.2 Confirming a Profile
    4. 16.4  Host Provisioning Application Flow
    5. 16.5  Configuration Modes
      1. 16.5.1 AP Provisioning
      2. 16.5.2 SC Provisioning
      3. 16.5.3 AP and SC Provisioning
      4. 16.5.4 AP and SC and External Configuration Provisioning
    6. 16.6  Starting and Stopping the Provisioning Process
    7. 16.7  Auto-Provisioning
    8. 16.8  Delivering Feedback to the User
      1. 16.8.1 External Confirmation
    9. 16.9  External Configuration
    10. 16.10 Common Events and Errors
      1. 16.10.1 Provisioning Status Event
      2. 16.10.2 Provisioning Profile-Added Event
      3. 16.10.3 Reset Request Event
      4. 16.10.4 Errors
      5. 16.10.5 Host Commands During Provisioning
    11. 16.11 Usage Examples
      1. 16.11.1 Successful SmartConfig Provisioning
      2. 16.11.2 Unsuccessful SmartConfig Provisioning
      3. 16.11.3 Successful SmartConfig Provisioning With AP Fallback
      4. 16.11.4 Successful AP Provisioning
      5. 16.11.5 Successful AP Provisioning With Cloud Confirmation
      6. 16.11.6 Using External Configuration Method: WAC
      7. 16.11.7 Successful SmartConfig Provisioning While External Configuration Enabled
  18. 17Crypto Utilities
    1. 17.1 Introduction
      1. 17.1.1 API and Usage
        1. 17.1.1.1 Install and Uninstall Key-Pairs and Certificates
        2. 17.1.1.2 Create or Remove Temporary Key
        3. 17.1.1.3 Get Public Key
        4. 17.1.1.4 Certificate Creation
        5. 17.1.1.5 Sign Buffer
        6. 17.1.1.6 Verify Buffer
        7. 17.1.1.7 True Random Number
      2. 17.1.2 Limitations and Constraints
      3. 17.1.3 Errors
    2. 17.2 Secured Content Delivery
      1. 17.2.1 SimpleLink Wi-Fi Side Process Flow
      2. 17.2.2 Encrypted File Format
  19. 18Hostless Mode
    1. 18.1 Introduction
    2. 18.2 Script Overview
    3. 18.3 Conditions
      1. 18.3.1 Pre-Initialization
      2. 18.3.2 System Event
      3. 18.3.3 Timer Expiration
      4. 18.3.4 Counter Threshold
      5. 18.3.5 Internal Errors
    4. 18.4 Sub-Conditions
    5. 18.5 Actions
      1. 18.5.1 Pre-Initialization Actions
        1. 18.5.1.1 Set Role
        2. 18.5.1.2 Delete All Profiles
        3. 18.5.1.3 Hardware GPIO
      2. 18.5.2 Run-Time Actions
        1. 18.5.2.1 Send Transceiver Packet
        2. 18.5.2.2 Send UDP Packet
        3. 18.5.2.3 Send TCP Packet
        4. 18.5.2.4 Set/Increment Counter
        5. 18.5.2.5 Timer Control
        6. 18.5.2.6 Set GPIO
        7. 18.5.2.7 Enter Hibernate
  20. 19Porting the Host Driver
    1. 19.1 Introduction
    2. 19.2 Create Platform Porting File
    3. 19.3 Select Capabilities Set
    4. 19.4 Bind the Device Enable/Disable Line
    5. 19.5 Implement the Interface Communication Abstract Layer
    6. 19.6 Choose Memory-Management Model
    7. 19.7 Implement OS Adaptation Layer
      1. 19.7.1 Sync Objects
      2. 19.7.2 Locking Objects
    8. 19.8 Implement Timestamp Services
    9. 19.9 Set Asynchronous Event Handler Routines
  21. 20Debug
    1. 20.1 Capture NWP Logs
      1. 20.1.1 Overview
      2. 20.1.2 Instructions
        1. 20.1.2.1 Configuring Pin Mux for CC32xx
        2. 20.1.2.2 Terminal Settings
        3. 20.1.2.3 Run Your Program
        4. 20.1.2.4 Send to TI Engineer
          1.        A Host APIs
            1.         A.1 Host APIs
              1.          B Persistency
                1.           B.1 Persistency
                  1.            C Regulatory Domain
                    1.             C.1 Regulatory Domain
                      1.              D Supported Host Interfaces
                        1.               D.1 SPI Host Interface
                          1.                D.1.1 Introduction
                          2.                D.1.2 Abbreviations
                          3.                D.1.3 SPI Modes
                          4.                D.1.4 SPI Configurations (Shared SPI)
                          5.                D.1.5 SPI Initialization
                          6.                D.1.6 Host Interface Protocol - SPI Perspective
                        2.               D.2 UART Host Interface
                          1.                D.2.1 Introduction
                          2.                D.2.2 Host Low Power Modes
                          3.                D.2.3 UART Host Topologies
                            1.                 D.2.3.1 5-Wire UART Topology
                            2.                 D.2.3.2 4-Wire UART Topology
                            3.                 D.2.3.3 3-Wire UART Topology
                          4.                D.2.4 UART Configuration
                          5.                D.2.5 UART Initialization
                            1.                 D.2.5.1 Changing the UART Baud Rate
                          6.                D.2.6 Implementing the UART Driver - Concept and Terminology
                            1.                 D.2.6.1 UART Read API Implementation
                            2.                 D.2.6.2 UART Write API Implementation
                          7.                D.2.7 Register/Unregister Interrupt Handler API Implementation
                          8.                D.2.8 Host Interface Protocol – UART Perspective
                            1.                 D.2.8.1 UART Host Command Flow
                            2.                 D.2.8.2 Synchronization Words
                              1.                  Revision History

Create a File

The open-create or open-create-write creates a new file, and as part of the function the device allocates the storage for the file. The size of the allocated storage is determined by the maximum size parameter. The close function makes the opened file valid.

A file created but not closed has allocated storage (according its maximum size), but does not have a valid copy.

Because the process of creating a file involves updating the file allocation table on the SFLASH, TI recommends minimizing the creation of files. If it is required to update the file content, open the file for write rather than delete and recreate it.

For a secure file, the default behavior of the file creation function is to generate the file tokens (including the master): the master token is returned as the function output, and all other tokens can be retrieved using the sl_FsGetInfo() function. Further information regarding the file tokens can be found in the CC3x20, CC3x35, and CC3x30 SimpleLink™ Wi-Fi® Internet-on-a chip™ Solution Built-In Security Application Report.

The sl_FsOpen() function tests that the file storage can be allocated, that the file does not exist, and that the creation flags are valid. The smallest memory hole that fits the requested size is allocated (as fragmentation is not supported). If an error occurs while attempting to open a file, the function returns a negative value which represents the error number; Table 9-3 shows a partial list of errors that might be returned by the creation function.

Table 8-3 Creation Function Errors
ErrorDescription
SL_ERROR_FS_NOT_ENOUGH_STORAGE_SPACENo available storage for the file.
SL_ERROR_FS_FILE_ALREADY_EXISTSFile with the same name already exists.
SL_ERROR_FS_NO_AVAILABLE_NV_INDEXNumber of opened files exceeded.
SL_ERROR_FS_FILE_INVALID_FILE_SIZEThe maximum file size is set to 0.

The create file input parameters are:

  • Filename: The filename is a string of up to 180 bytes; TI recommends using short filenames (explained in Section 9.3); the file name is not case-sensitive.
  • Maximum file size
    • When creating a file, the storage for the file is allocated according the requested maximum file size. For an existing file, the maximum file size cannot be changed; thus, when defining the maximum size of a file, the future growth of the file should be considered.
    • Creating a file with the FAILSAFE flag creates the file with a copy, thus the allocated storage size for the file is doubled.
    • Because the smallest erase unit of a SFLASH is 4096 bytes, the file system allocates storage size, which is aligned to 4096 bytes.
  • File tokens: The token is the key for accessing a secure file; for a nonsecure file, it is set to zero. The file creation function returns the file token. By default, the device generates the file master token and returns it to the host. The default behavior of the token creation can be overridden by special creation flags.
  • Creation flags: The creation flags are set during the file creation and cannot be changed afterward. The following is a list of creation flags:
    • SL_FS_CREATE_FAILSAFE: A file opened with failsafe has double copies, but only one copy is considered to be active at a time. Each time the file is opened for write, the file storage is erased. If the system is powered off while writing a file with no failsafe, the file content is lost. If the system is powered off while writing a file with failsafe, the old content becomes the active one. Using the FAILSAFE doubles the file allocated storage. If the bundle feature (used for OTA) is used with the file, this flag is mandatory.
    • SL_FS_CREATE_SECURE: A file created as secure has its content encrypted on the SFLASH. Access to the file is limited, and requires a file token. See the security application notes file for more information about secure files.
    • SL_FS_CREATE_NOSIGNATURE: The flag is relevant only for secure files. By default, a secure file has a signature, which authenticates the file creator. See the security application notes for more information about how to create file signature.
    • SL_FS_CREATE_STATIC_TOKEN: Relevant only for secure files. This flag changes the default behavior of the file tokens creation: with this flag, the file tokens are not changed each time a file is opened for write.
    • SL_FS_CREATE_VENDOR_TOKEN: Relevant only for secure files. This flag changes the default behavior of the file tokens creation: with this flag, the file master tokens are set by the host.
    • SL_FS_CREATE_PUBLIC_WRITE: Relevant only for secure files. This flag changes the default behavior of the file tokens creation: with this flag, the file can be written without a token, but for a read operation a token is required.
    • SL_FS_CREATE_PUBLIC_READ: Relevant only for secure files. This flag changes the default behavior of the file tokens creation; with this flag, the file can be read without a token, but for a write operation a token is required.
  • Flags: The following flags are not creation flags, but can be set when creating or opening an existing file for write.
    • SL_FS_WRITE_BUNDLE_FILE: Used for the bundle commit feature; for new files, the FAILSAFE flag is not a precondition for this flag.
    • SL_FS_WRITE_ENCRYPTED: Used for secure content download.

If the application creates a file once, it can then be created by the Image Creator tool with the default content. The application can then update the file when required.