TIDUE59A May   2018  – September 2020

 

  1.   Description
  2.   Resources
  3.   Features
  4.   Applications
  5. 1System Description
    1. 1.1 Key System Specifications
  6. 2System Overview
    1. 2.1 Block Diagram
    2. 2.2 Design Considerations
    3. 2.3 Highlighted Products
      1. 2.3.1 CC3220
      2. 2.3.2 CC2640R2F
      3. 2.3.3 DRV8837
    4. 2.4 System Design Theory
      1. 2.4.1 CC3220S to CC2640R2F Interface
      2. 2.4.2 CC3220S to DRV8837 Interface
      3. 2.4.3 Software Architecture
      4. 2.4.4 Network Connection Management
      5. 2.4.5 Provisioning
        1. 2.4.5.1 AP Provisioning and SmartConfig™
        2. 2.4.5.2 Wi-Fi Provisioning Over BLE
      6. 2.4.6 Sending and Receiving Messages Through Cloud
        1. 2.4.6.1 Message Queue Telemetry Transport Protocol
        2. 2.4.6.2 MQTT Client Implementation
      7. 2.4.7 Over-the-Air Updates
        1. 2.4.7.1 HyperText Transfer Protocol
      8. 2.4.8 Security Enablers
        1. 2.4.8.1 Secure Boot
        2. 2.4.8.2 Secure Sockets
          1. 2.4.8.2.1 Hardware Accelerators
          2. 2.4.8.2.2 Simple Network Time Protocol
        3. 2.4.8.3 File System Security
          1. 2.4.8.3.1 Failsafe Files and Bundle Protection
      9. 2.4.9 Low-Power Consumption
  7. 3Hardware, Software, Testing Requirements, and Test Results
    1. 3.1 Required Hardware and Software
      1. 3.1.1 Hardware
        1. 3.1.1.1 CC3220S LaunchPad™ Development Kit
        2. 3.1.1.2 CC2640R2F LaunchPad™ Development Kit
        3. 3.1.1.3 Sensor BoosterPack™ Connections (BMI160)
        4. 3.1.1.4 DRV8837EVM Modifications and Connections
        5. 3.1.1.5 Assembling EVMs
      2. 3.1.2 Software
        1. 3.1.2.1 Getting Started With Software
          1. 3.1.2.1.1 Build simple_np Application and Flash CC2640R2F
          2. 3.1.2.1.2 Use Premade UniFlash ImageCreator Project
          3. 3.1.2.1.3 Importing Project Source Files Into CCS
        2. 3.1.2.2 User Files
        3. 3.1.2.3 Run Wi-Fi® Doorlock Demo
          1. 3.1.2.3.1 Connect CC3220 to Network
          2. 3.1.2.3.2 Networking Functions
            1. 3.1.2.3.2.1 Get Current Date and Time (SNTP)
            2. 3.1.2.3.2.2 Send and Receive Messages (MQTT)
            3. 3.1.2.3.2.3 Perform Software Update Using Dropbox (OTA Update)
    2. 3.2 Testing and Results
      1. 3.2.1 Pass or Fail Tests
      2. 3.2.2 Power Measurements
      3. 3.2.3 Test Setup
        1. 3.2.3.1 CC3220S
        2. 3.2.3.2 CC2640R2F
        3. 3.2.3.3 DRV8837
      4. 3.2.4 Test Results
      5. 3.2.5 Battery Life Estimate
  8. 4Design Files
  9. 5Software Files
  10. 6Related Documentation
    1. 6.1 Trademarks
  11. 7Terminology
  12. 8About the Author
  13. 9Revision History
Use Premade UniFlash ImageCreator Project

To evaluate the software out-of-box using the premade UniFlash project, do the following:

  1. Download the CC3220 SDK and wifi_doorlock.zip (follow the instructions in Section 3.1.2.1 to install the wifi_doorlock demo).
  2. Open UniFlash, and select CC3120/CC3220 or the CC3220 LaunchPad.
  3. Select Start Image Creator (for CC3120/CC3220).
  4. Choose Manage Projects.
  5. Select Import Project from ZIP file.
  6. Navigate to the wifi_doorlock example in the CC3220 SDK, and select the zip file with the latest version in the uniflash folder (wifi_doorlock/uniflash/wifi_doorlock_RS_tirtos_<version>.zip).
  7. Locate the UniFlash project named wifi_doorlock_RS_tirtos in the list of Available Projects.
  8. Select Open Project.
  9. Connect to the CC3220S-LAUNCHXL by pressing the Connect button on the right-hand side.
  10. Press the Generate Image button (flame symbol on the right-hand side).
  11. Choose Program Image (Create & Program) at the top of the Generate Image page.

These steps result in the software application and all associated system files being written to the external serial flash of the CC3220S. The example, as provided in the UniFlash bundle, is designed to provide updates on the application state by printing debug messages to a serial terminal. To see the debug messages, open a serial terminal application on the computer that the LaunchPad is connected to, and connect to the COM port called XDS110 Class Application/User UART. Table 3-4 lists the settings for how the serial port is configured.

Table 3-4 Serial Port Settings
SETTINGVALUE
Baud rate115200
Data8 bit
Parity
Stop1 bit
Flow control

When successfully connected to the serial terminal, restart the CC3220S by pressing the RESET switch at the top of the CC3220S-LAUNCHXL. The application boots from the external serial flash and starts running. Upon a restart, the application checks to see if a network profile exists in the file system of the CC3220S. If a profile exists, the system automatically connects to the AP. Otherwise, the system waits to be provisioned over a Bluetooth low energy connection. Figure 3-8 shows the messages that appear in the terminal when the system starts up and waits to be provisioned.

GUID-72BC24BF-3EAD-4E4A-B1BD-606755C88327-low.gifFigure 3-8 Debug Print Messages in Serial Terminal on First Application Start

To connect the device to a network and evaluate the rest of the application, see Section 3.1.2.3.1. When working with the premade UniFlash Image-Creator project, the system uses power-management by default.