AWS IoT CC32XX Quick Start Guide

Table of Contents

Introduction

This guide is intended to assist users in the initial setup and demonstration of a CC32XX AWS application using the CC32XX Plugin for AWS. The guide explains how to configure the boards, compile the software artifacts, program the CC32XX device, set up your AWS account and run an AWS application.

Hardware Requirements

Software Requirements

Installing CC32XX Plugin for AWS in CCS

  1. Download and open the CC32XX Plugin for AWS Installer (replace x’s with version number):
    • Windows: aws_cc32xx_2_20_xx_xx.exe
    • Linux: aws_cc32xx_2_20_xx_xx.run
    • Note: If you have downloaded a zip file of the Plugin, then you should simply unzip it using your favorite unzip tool. The location you choose to unzip it to will be the installation directory (AWS_INSTALL_DIR).

  2. Select an installation directory. This will be referred to as AWS_INSTALL_DIR in the rest of this document. It’s recommended that you install it in your CCS installation directory (default c:/ti) so it can be discovered automatically.

  3. Click Next > and finish the installation

  4. Open CCS (close and re-open if already running) and you should see the Install Discovered Products window

  5. Select the CC32XX Plugin for AWS and click Install

Hardware Setup

Jumper settings

The SOP[2…0] jumpers are used to set different flash programming modes/states.

  1. SOP[2…0] mode ‘100’ is used for programming the serial flash with the application binary and/or the service pack. After flashing, the board should be reset and the mode set to ‘000’ (no jumpers in place) to run/execute the contents of flash

  2. SOP[2…0] mode ‘010’ is the flash and execute mode which is similar to the ‘100’ mode except that after flashing, the contents of flash are executed immediately without having to reset or remove all jumpers. This mode is also used when using the CCS to connect to the device for loading and debugging

Setting up a serial terminal

  1. Plug the CC32XX Launchpad into a USB port on your PC.

  2. Open a serial session to the appropriate COM port with the following settings:

    Baudrate:     115200
    Data bits:       8
    Stop bits:       1
    Parity:       None
    Flow Control: None
  3. The output of the examples will be displayed in the terminal.

AWS IoT Developer Setup

In order to run the example applications, it is necessary to complete the steps of the AWS IoT Developer Guide. In particular, the following steps of the guide must be completed:

  1. Installing the AWS Command Line Interface

  2. Configuring the AWS Command Line Interface

  3. Sign in to the AWS IoT Console

  4. Register a Device in the Thing Registry

  5. Create and Activate a Device Certificate
    • Make sure you choose to download the certificate files, as these will be needed when setting up the examples.
    • Note: you will also need a root CA certificate. You can download the root CA from here.

  6. Create an AWS IoT Policy

  7. Attach an AWS IoT Policy to a Device Certificate

  8. Attach a Thing to a Certificate

Note that Amazon has recently tailored the AWS IoT Developer Guide instructions specifically for the “AWS IoT Button.” You can ignore the mentions of the button, as your TI embedded device will be used in place of this. For more details on AWS IoT, please refer to the What Is AWS IoT page.

Building and running Examples in CCS

Several examples are provided in the CC32XX Plugin and can be found in the examples/ subdirectory. These steps refer to the subscribe_publish_sample application for the CC3220SF device, but the same procedure applies to other examples, as well.

  1. It is assumed that the CC32XX SDK has already been installed in a directory we will refer to as CC32XX_SDK_INSTALL_DIR. You should install it if you have not already done so, as the CC32XX Plugin for AWS depends on the CC32XX SDK.

  2. Open Code Composer Studio.

  3. In CCS, import the subscribe_publish_sample by first selecting File > Import…

  4. In the Import window, select C/C++ > CCS Projects and hit the Next button

  5. In the Import CCS Eclipse Projects window, hit the browse button to browse to the location corresponding to AWS_INSTALL_DIR\examples\rtos\CC3220SF_LAUNCHXL\aws\subscribe_publish_sample. Select the checkbox next to the subscribe_publish_sample for TIRTOS (or FreeRTOS) for CCS (or GCC) and hit the Finish button.

  6. Two projects should appear in the Project Explorer tab in CCS: one for the subscribe_publish_sample example itself, and another which corresponds to the OS chosen.

  7. Update the example to use the proper certificates, AWS account and WiFi Access Point information, as specified in the section Example Pre-Build Steps

  8. If TIRTOS is your OS, you can simply right-click on the subscribe_publish_sample project, and select Build Project to build.


  9. If you are using FreeRTOS for your OS, you need to set the installation directory of FreeRTOS before building:
    1. In CCS, select Window > Preferences
    2. Navigate to Code Composer Studio > Build > Variables
    3. Click Add
    4. For Variable name, enter FREERTOS_INSTALL_DIR
    5. For Type, select directory
    6. For Value, enter the installation directory of FreeRTOS
    7. Hit OK until you get back to the main window in CCS
    8. To build the subscribe_publish_sample project, right-click on it, and select Build Project.

Setting Up Code Composer Studio Before Running The Examples

  1. In Code Composer Studio, open the CCS Debug Perspective - Windows menu > Open Perspective > CCS Debug

  2. Open the Target Configurations View - Windows menu > Show View > Target Configurations

  3. Right-click on User Defined. Select New Target Configuration.

  4. Use CC3220.ccxml as “File name”. Hit Finish.

  5. In the Basic window, select “Texas Instruments XDS110 USB Debug Probe” as the “Connection”, and then type “CC3220” in the “Board or Device” text field. Check the box next to “CC3220SF” or “CC3220S” (depending on your launchpad). Hit Save.

  6. Right-click “CC3220.ccxml” in the Target Configurations View. Hit Launch Selected Configuration.

  7. Under the Debug View, right-click on “Texas Instruments XDS110 USB Debug Probe_0/Cortex_M4_0”. Select “Connect Target”.

Running an Example in CCS

  1. Ensure that your CC32XX device is connected in CCS.

  2. Select Run > Load > Load Program…, and browse to the file subscribe_publish_sample_CC3220SF_LAUNCHXL_tirtos_ccs.out, found in your project. Hit OK. This will load the program onto the board. (The same procedure applies to other examples by substituting subscribe_publish_sample with the name of the example you are working with)

  3. Run the application by pressing F8. The output will appear in your serial terminal session:

    startSNTP: Current time: Tue Aug  7 19:28:11 2018
    
    CC32XX has connected to AP and acquired an IP address.
    
    IP Address: 192.168.1.131
    
    AWS IoT SDK Version 3.0.1-
    
    Connecting...
    
    Subscribing...
    
    -->sleep
    
    Subscribe callback
    
    sdkTest/sub     hello from SDK QOS1 : 1
    
    Subscribe callback
    
    sdkTest/sub     hello from SDK QOS0 : 0
    
    -->sleep

Building and running Examples in IAR

Download and Installation of IAR

For instructions on downloading and setting up IAR properly for use with the CC32XX SDK, please refer to the Quick Start Guide document that is included in the SimpleLink CC32XX SDK. As part of the procedure, make sure to import the custom argvars for the SDK.

Configuring the IAR environmental variables for the AWS IoT SDK

Before starting to work with any of the AWS example projects in the SDK, you need to load a set of environment variables that will be set to your current workspace (custom argvars), in addition to the ones from the SDK.

  1. The custom argvars can be found at <AWS_INSTALL_DIR>/tools/iar/AWS_CC32XX_SDK.custom_argvars. If you need to modify the default path argument variables, edit the variables to correct the paths.

  2. Open the IAR IDE

  3. Choose Tools > Configure Custom Argument Variables

  4. Click Global > Import

  5. Browse to <AWS_INSTALL_DIR>/tools/iar. Import the custom argvars from the Plugin.

  6. Restart IAR

Importing your First Project

You can choose to open an Example Project by either directly accessing the Example workspace (by double clicking on it), or by importing the Example from the Example List in the IDE.

Directly accessing an Example from the Example Folder

All Code Examples that are shipped with the SDK come with an IAR workspace. Double-Clicking the specific workspace allows you to open the project on disk and build it. Be sure to update the example to use the proper certificates, AWS account and WiFi Access Point information, as specified in the section Example Pre-Build Steps

Importing an Example in the Example List

  1. In the IAR-IDE go to the Help tab and click on Information Center

  2. In the IAR Information Center for ARM window, click on Integrated Solutions

  3. Scroll down and choose Texas Instruments - Example projects