SimpleLink SDK NFC Plugin Users Guide

Table of Contents

Introduction

The SimpleLink SDK NFC Plugin is a companion software package that adds NFC functionality to the SimpleLink CC3220 family. With this software plugin, and the relevant hardware, one can enable NDEF messages to be written to and read from their CC3220 device over NFC. This opens up communication with the already large infrastructure of NFC-enabled smart phones, tablets, notebooks, and more. There are a number of interesting NFC applications, such as intuitively connecting the CC3220 to a Wi-Fi access point with only a tap.

The plugin interfaces with the RF430CL330H NFC BoosterPack which includes the RF430CL330H, a Dynamic NFC Tag Type 4 transponder that combines a wireless NFC interface and a wired SPI or I2C interface to communicate between the device and a host. It features ISO14443B-Compliant 13.56-MHz RF support with through-put up to 848 kbps.

This plugin leverages the use of the WiFi host driver that is standard within the SimpleLink CC32xx SDK. Through a simple porting layer, interaction with the network processor (NWP) is abstracted out to enable code compatibility between a one chip CC32xx solution and a two chip Host Processor (Such as a MSP432) + CC3120 solution.

SimpleLink SDK Plugins are designed to work in tandem with the device specific SDK. This plugin is designed to work alongside the SimpleLink CC3220 SDK. It relies heavily on several core elements within the SDK. Without a prior installation of the SimpleLink SDK, the SimpleLink SDK NFC Plugin will not work.

Plugin Architecture / General Overview

Plugins are intended to extend functionality of each individual base SDK to include specialized use-cases. These specialized use cases can range anywhere from adding wireless functionality to extending a base SDK’s example set.

While all of the plugins have the same look-and-feel of an SDK, they are not meant as standalone applications and rely heavily on components from the base SDK. The SimpleLink SDK NFC Plugin, for example, relies heavily on the TI-Drivers, TI-RTOS, and DriverLib components from the base SDK. A high level block diagram of these dependencies can be seen in the image below.

WiFi Layers

It is important to note that each plugin contains all of the necessary components to function fully alongside the base SDK. Plugins do not install inside of the SDK, but rather in a folder next to the SDK. This is to simplify the maintenance model and provide users with a better experience for updating and switching between plugin versions.

The code examples written for this software package leverage the following host microcontroller LaunchPad configurations listed below:

The CC3220xx device is a Wi-Fi® CERTIFIED® single-chip MCU System-on-Chip (SoC) with built-in Wi-Fi connectivity. Created for the IoT, the SimpleLink™ CC3220xx device integrates two physically separated on-chip MCUs: an ARM® Cortex®-M4 application processor and a network processor to manage all Wi-Fi and Internet logical layers.

In addition to the LaunchPads listed above, the software package leverages the RF430CL330H NFC BoosterPack. The CC3220xx application processor communicates with the RF430CL330H NFC transponder over a two wire I2C interface. Additionally, the RF430CL330H can signal to the host when an NDEF message has been written to or read from it using a GPIO interrupt. It is important to note that while the default pin configurations used in the example projects in this plugin package are mapped to the LaunchPad pins, they are fully reconfigurable to match the end application requirements.

WiFi Layers

The RF430CL330H NFC transponder consists of 3KB of SRAM that contains the NDEF message. The SRAM can be written or read from by the host using the SPI or I2C and can also be accessed and updated wirelessly through the integrated ISO14443B-compliant RF interface.

WiFi Layers

Folder Structure

The folder structure of the SimpleLink SDK NFC Plugin adheres to the same standard folder structure used by the platform SDK. From the root directory, the following folders are available:

The source/ folder contains the code that is likely to be reused without modification in a final application. Within there is the following folder:

The ti/ folder contains the bulk of the TI provided collateral to interact with and control the CC3220xx WiFi Device. This folder is structured as follows:

The code provided in the simplelink_wifi/ and simplelink_nfc/ folders is provided as source only (as opposed to a pre-compiled library) as the user may need to extend its functionality to meet their program’s requirements.

Back in the root directory, the tools/ folder consists of the following folders:

CC3220xx-LAUNCHXL and RF430CL330H NFC BoosterPack Hardware Setup

Out of the box, the RF430CL330H NFC BoosterPack is configured to use I2C signals routed from J2-14 and J2-15. The CC3220 has I2C routed from P1-9 and P1-10, and there are two methods that can be used to resolve the pin incompatibility. The first option is to modify the RF430CL330H NFC BoosterPack and move two resistors to reroute the signals to different pins on its boosterpack headers. Specifically, R12 and R13 should be depopulated, and R14 and R15 should be populated: CC3220xx-LAUNCHXL and RF430CL330H NFC BoosterPack HW Setup

The other method is to reroute the signals on the CC3220 launchpad, by using jumper wires to bring the I2C signal to the header pins that the F430CL330H NFC BoosterPack uses. To do so, P07 should be connected to P02, and P06 should be connected to P01:

CC3220xx-LAUNCHXL and RF430CL330H NFC BoosterPack HW Setup

It is required to perform either the RF430CL330H NFC BoosterPack modification, or to use the jumper wires on the CC3220 for proper operation of the NFC plugin examples.

The CC3220xx-LAUNCHXL and RF430CL330H NFC BoosterPack must be physically connected to allow the devices to interface with each other. The RF430CL330H NFC BoosterPack should be placed onto the CC3220xx-LAUNCHXL in the orientation shown below. The female headers, J1 and J2, of the NFC BoosterPack should be connected to the male headers, P1 and P2, of the CC3220xx-LAUNCHXL.

CC3220xx-LAUNCHXL and RF430CL330H NFC BoosterPack HW Setup

Additionally, if serial port debugging is desired, pin 03 on the CC3220xx-LAUNCHXL should be wired to the top pin of header J5 (UART_RX) as shown in the above image.

Updating the CC3220 (Service Pack and User Files)

It will become necessary for the user to update both the user files stored on the CC3220’s flash storage and the service pack running on the CC3220 itself. The possible user files that need to be updated for the SimpleLink SDK NFC Plugin are updated certificates and certificate keys if secure wireless connections are to be made.

The service pack updates are done on a regular basis to patch fixes for the services running on the NWP as well as to ensure that the Network Processor (NWP) is running with the most up-to-date security patches. The specific service pack used in the validation and verification of each plugin release is stored in the tools/cc32xx_tools/servicepack-cc3x20 folder of the plugin installation folder. Note that this is the identical service pack used for the one chip CC3220 solution (and is identical to the file distributed in the CC32xx SDK).

The sections below describe how to update the service pack and user files running on the CC3220 via a direct USB connection.

Uniflash

The most common and obvious way to update the user files of the CC3220 is to use the Uniflash Image Creator. Uniflash is a unified utility used to program the on-chip flash memory on TI’s line of SimpleLink MCUs.

To get started first download the latest Uniflash package from the the link below:

https://processors.wiki.ti.com/index.php/Category:CCS_UniFlash

Next, plug the USB cable from the computer into the USB port of the CC3220 LaunchPad. Ensure that the CC3220 LaunchPad has the jumper settings as shown below:

WiFi Layers

Once connected, open up the UniFlash application. In the device list, scroll down (to the very bottom) and select CC3120 / CC3220, CC3220SF-LAUNCHXL, or use the auto-detect feature:

WiFi Layers

Once selected, click Start Image Creator to start the image creator application. This will start the SimpleLink WiFi Image Creator. On this screen you can manage various project settings as well as program external images. To get started, clock on the New Project button as seen below.

WiFi Layers

On the next screen fill out a project name of your choice. Make sure that you choose CC3220 or CC3220SF as the Device Type and make sure that the Device Mode is set to Develop. Develop mode allows the user to open up the filesystem and make changes via Uniflash during the development phase. When you wish to secure your device and program it for production the Production mode should be used.

WiFi Layers

On the next screen you will see the new project page as it exists for Development Mode. In Development Mode you can change and manipulate all aspects of the CC3220 device. At a minimum when creating an image to flash on the CC3220, it is recommended to start with specifying a service pack. The service pack provides various patches and security fixes for the NWP image running on the CC3220. To specify a service pack select the Service Pack menu item on the left.

WiFi Layers

On the next page click browse next to the file name field and navigate to the service pack release that is included with the SimpleLink SDK WiFi plugin release. This can be found in the /tools/cc32xx_tools/servicepack-cc3x20. The file name generally starts with sp_ and ends with .bin.

WiFi Layers

Note that when you select this file it persists within Uniflash- meaning if you save the project and reopen it the service pack file will exist within Uniflash’s internal memory. The next portion of the project that is common to update is the user files section. The user files are all files that are user accessible that are stored on the flash memory of the CC3220. These can include anything from application files such as html pages to certificates used for validation and security. To manage the user files contained within your image select the User Files menu item from the left.

On the next screen the file manager view will be displayed. Since this is a new project there are no files currently populated. Let’s add some files. Click on the small file icon located on the top of the file view.

WiFi Layers

A common file to add to the user files is a root ca certificate. This certificate is responsible for securing a client connection and provides a level of security that ensures that users are legitimately connected to a trusted source. As part of the plugin release a “dummy” certificate is provided. To add this certificate to your project navigate to the /tools/cc32xx_tools/certificate-playground folder and select the dummy-trusted-ca-cert file to add to the project. On the file options window select Failsafe (this adds a certain level of redundancy for safety) and select Write.

WiFi Layers

As with the service pack, once a file is added to the Uniflash project it will persist in the Uniflash project (even if the file is deleted from the file system on your PC). After all desired user files have been added, it is time to program your CC3220 device. Note that when programming through Uniflash all files that are not included in the user files are erased and the new files are persisted. The exceptions are system files (such as the factory reset image). First connect to the device using the Connect button on the side.

WiFi Layers

Once connected various information such as the MAC address and hardware version is displayed on the right. To program the image, first select the Generate Image icon on the right.

WiFi Layers

On the next screen select the Program Image (Create & Program). This will proceed to program the new image (both the service pack and the user file that you added) to the flash memory on the CC3220.

WiFi Layers

Once finished, click Close and then reconnect to the device using the Connect button from the previous step. After connected, select the User File Browser icon on the right next to the Disconnect button.

WiFi Layers

This will probe the CC3220 and display all files that currently exist on the flash file system. Other than the required system files, you will notice that the service pack file exists as sys/servicepack.ucf and that the dummy-root-ca-cert file exists in the root directory as programmed.

WiFi Layers

Mobile Applications

Mobile applications are essential for evaluating the SimpleLink SDK NFC Plugin. For the purpose of this plugin, they are used for provisioning an unconfigured SimpleLink device and reading/writing NFC NDEF messages from/to the RF430CL330H SRAM. The mobile applications used while testing the SimpleLink SDK NFC Plugin are discussed below.

SimpleLink WiFi Starter Pro is an application written to specifically provision CC3xxx family of devices (both Gen1 and Gen2). This application supports both Android and iOS and supports advanced features such as SmartConfig and access point provisioning. To download and use SimpleLink WiFi Starter Pro please refer to the link below:

https://www.ti.com/tool/wifistarterpro

Generic Mobile Applications

There are generic NFC applications available to aid in reading and writing NDEF messages over NFC. At this time, Android handsets have NFC reading and writing functionality enabled.

Android Mobile Application Options:

Serial Port Logging/Debugging

Note that for logging/debugging messages the back channel serial port of the LaunchPad is used. In order to read these messages, use your favorite serial terminal program (such as Tera Term or PuTTY). The COM port number will be different depending on the system configuration, however it should show up as XDS110 Class Application/User UART.

Device Manager

Make sure to use the Application/User UART and not the Auxiliary Data Port. Along with the COM port of the XDS110 UART, the back channel UART defaults to the following serial port values:

Serial port values

Code Examples

WiFi Provisioning Example – Example implementation that connects the CC3220 device to an access point by passing the WiFi profile information (SSID & password) over the enabled NFC interface.

IDE/Software Configurations

This software package supports and has been tested with TI Code Composer Studio 8.0 as well as IAR Embedded Workbench for ARM v8.11.4. The GCC toolchain for ARM has also been tested within CCS as well as directly through command line invocation. Both FreeRTOS and TI-RTOS are fully supported in this release.

Code Composer Studio Project Guide

The SimpleLink SDK NFC Plugin is designed to integrate seamlessly with the Code Composer Studio Integrated Development Environment from Texas Instruments. After installing the plugin (it is recommended to use the default installation directory), CCS should automatically detect and install the plugin software package without any special interaction from the user. To check to see if the plugin has installed correctly, go to the Windows->Preferences menu item. Under the Code Composer Studio->Products item you should see “SimpleLink SDK WiFi Plugin” installed (with a version number):

Product installed

Note that the installation path of the plugin needs to be present in the Product Discovery Path:

Product installed

IAR Embedded Workbench Project Guide

IAR Embedded Workbench is fully supported under the SimpleLink SDK NFC Plugin. Setting up your development environment to work with IAR involves pointing IAR to the plugin and SDK directories as mentioned below.

To get started, a list of external variables needs to be imported in IAR in order to let the IDE know the paths for all of the relevant software installations. An example configuration file that uses the default paths can be found in the tools/iar/simplelink_sdk_nfc_plugin.custom_argvars file of the SimpleLink SDK NFC Plugin installation directory. This file might have to be changed depending on specific installation paths and version numbers; however it should work if the user chose to use the default installation paths (note the version numbers might slightly vary from the picture below):

Import external variables

To import this file into your IAR IDE, navigate to Tools->Configure Custom Argument Variables.

Import external variables

From here, click the “Global” tab and then the “Import…” button and navigate to the directory where the custom_argvars file is stored (by default in the tools/iar/ directory of the installation path) and select it.

Import external variables

After importing this file the custom variables will show up in the text box in the middle of the screen. Click OK to close out and save the dialog. Note that these custom variables need only be imported once and the settings will persist.

Import external variables

Once the external symbols have been imported you can either open the project manually on the file system or use IAR’s built-in example project explorer. To open the project manually, simply go to File->Open->Workspace: Navigate to the example project’s eww file. For example, the WiFi Provisioning Example eww file would be located at:

install_directory/examples/rtos/CC3220SF_LAUNCHXL/demos/nfc_wifi_provisioning_example/tirtos/iar/nfc_wifi_provisioning_example.eww

Once you have opened the workspace in IAR you are able to download and debug the program as you would any other IAR project.

Import external variables

Note that if you upgrade or change versions of the SimpleLink SDK NFC Plugin or the base SDK, the external tools variables will have to change to point to the correct version of the software.

Support

Please post on the SimpleLink™ WiFi CC31xx/CC32xx E2E Forum for device support questions.