CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single
1Introduction
The CC3200 SimpleLink™ Wi-Fi®is the industry’s first single-chip microcontroller (MCU) with built-in Wi-Fi
connectivity, created for the Internet of Things (IoT). The CC3200 device is a wireless MCU that integrates
a high-performance ARM Cortex-M4 MCU, allowing customers to develop an entire application with a
single IC. This document introduces the user to the environment setup for the CC3200 SimpleLink Wi-Fi,
along with programming examples from the software development kit (SDK). This document explains both
the platform and the framework available to enable further application development.
1.1Overview
The Texas Instruments royalty-free CC3200 Embedded Wi-Fi Foundation software development kit is a
complete software platform for developing Wi-Fi applications. It is based on the CC3200, a complete Wi-Fi
SoC (System-on-Chip) solution. The CC3200 solution combines a 2.4-GHz Wi-Fi PHY/MAC and TCP/IP
networking engine with a microcontroller, 256 kB on-chip RAM, and a comprehensive range of
peripherals.
Refer to the CC3200 Product Preview and Data Sheet (SWAS032) for more details on the CC3200 chip.
Programmer's Guide
SWRU369D–June 2014–Revised May 2018
Chip Wireless MCU
1.2Software Components
The CC3200 platform includes a user-programmable host, along with a comprehensive networking
solution combined with a Wi-Fi engine. The CC3200 Foundation software development kit provides an
easy-to-use framework, hosted in the on-chip microcontroller, to use the WLAN networking services, along
with a comprehensive listing of drivers for peripherals interfaced with the microcontroller. The kit also
includes a reference code for peripheral usage and a few simple applications for networking services.
Figure 1. CC3200 Overview of Peripherals
6
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
The CC3200 LaunchPad board is the default hardware companion for the foundation SDK. This board
hosts the CC3200 device, with interfaces designed for application software development and debugging.
The CC3200 LaunchPad also supports the TI Booster Pack interface, allowing the user to interface with a
rich repertoire of peripheral systems.
Refer to the CC3200 Launch Pad user manual (SWRU372) for more details.
Figure 3. CC3200 LaunchPad Platform
www.ti.com
8
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
• Documentation for hardware details present in Hardware folder
• Documentation for SimpleLink host driver in html format under docs\simplelink_api’ directory
• Application notes for all the sample application present in docs\examples directory.
• Peripheral driver library user’s guide
• Documentation for netapps libraries
• SimpleLink OTA Extlib API user's guide
• Contains the peripheral driver library source files.
• The driverlib.a is also provided in the ccs and ewarm directories.
• Getting Started in STA Mode: Configures the CC3200 in STA mode. It verifies the connection by
pinging the client connected to it.
• Getting Started in AP Mode: Configures the CC3200 in AP mode. It verifies the connection by pinging
the client connected to it.
• TCP Socket: Demonstrates the connection scenario and basic TCP functionality.
• UDP Socket: Demonstrates the connection scenario and basic UDP functionality.
• Scan Policy: Demonstrates the scan-policy settings in the CC3200.
• SSL: SSL certificates are designed to provide two principles, privacy and authentication. Privacy is
achieved by encryption and decryption, and authentication is achieved by signature and verification.
The application demonstrates using a certificate with SSL.
• MAC Filters (NWP Filters): The Rx-Filters feature enables the user to define and manage the Rxfiltering process, to reduce the amount of traffic transferred to the host and achieve efficient power
management.
• File_operations: Demonstrates the use of file-system APIs.
• Transceiver_mode: Demonstrates building a proprietary protocol on top of Wi-Fi PHY layer, with the
user given full flexibility to build their own packet. The RX Statistics feature inspects the medium in
terms of congestion, distance, validation of the RF hardware, and help using the RSSI information.
• Provisioning with WPS: Demonstrates the usage of WPS Wi-Fi provisioning with the
CC31xx/CC32xx.
• Provisioning with SmartConfig: Demonstrates the usage of TI's SmartConfig™ Wi-Fi provisioning
technique.
• Hib: Showcases hibernate as a power saving tool in a networking context (in this case, as a UDP
client).
• Get Time: Connects to an SNTP server and requests for time information.
• Get Weather: Connects to Open Weather Map and requests for weather data.
• Email: Sends emails through SMTP. The email application sends a preconfigured email at the push of
a button, or a user-configured email through the CLI.
• XMPP: Demonstrates the connection scenario with an XMPP server.
• Serial Wi-Fi: Serial Wi-Fi is a capability designed to provide easy, self-contained terminal access
behavior, over a UART interface.
• Connection Policy: Demonstrates the connection policies in the CC3200. The connection policies
determine how the CC3200 connects to the AP.
• ENT Wlan: Demonstrates the connection to an enterprise network using the flashed certificate.
Certificate is flashed in SFLASH.
• HTTP server: Demonstrates the HTTP server capability of the CC3200.
• mDNS: Demonstrates the usage of mDNS functionality in the CC3200. The application showcases both
mDNS advertise and mDNS listen functionality.
• Mode config: Switches the CC3200 LP from STA to AP and vice-versa.
• LED Blink Application: Showcases the usage of GPIO DriverLib APIs. The LEDs connected to the
GPIOs on the LP are used to indicate the GPIO output.
• Timer Demo Application: Showcases the usage of timer DriverLib APIs. This application uses 16-bit
timers to generate interrupts, which in turn toggle the state of the GPIO (driving LEDs).
• Watchdog Demo Application: Showcases the usage of watchdog timer (WDT) DriverLib APIs. The
objective of this application is to showcase the watchdog timer functionality to reset the system when
the system fails.
• UART Demo Application: Showcases the usage of UART DriverLib APIs. The application
demonstrates a simple echo of anything the user types on the terminal.
Foundation SDK – Getting Started
Table 1. Package Contents
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
• OTA Update: Illustrates over-the-air (OTA) updates of the service pack, user application, and user files.
• Dynamic Library Loader: Exercises an approach to enable dynamic loading of an application-binary
from non-volatile memory while the program is being executed.
• Contains the register definition header files.
• Contains the interface file to configure Free-RTOS or TI-RTOS.
• Contains power management framework to provide a simple infrastructure for developers to create a
power aware solution.
• http: Contains the HTTP (Hyper Text Transfer Protocol) client and server library
• smtp: Contains the SMTP (Simple Mail Transfer Protocol) client library
• tftp: Contains the TFTP (Trivial File Transfer Protocol) client library
• xmpp: Contains the XMPP (Extensive Messaging and Presence Protocol) client library
• json: Contains JSON parser library
• mqtt: Contains the MQTT (Message Queue Telemetry Transport) client and server library
• Contains SimpleLink host driver code.
• Contains the OTA (over the air) library
• Documentation for netapps libraries
• Contains the FatFS source files.
• Contains the FreeRTOS source files. Current SDK supports FreeRTOS v8.0.1.
• Contains the Ti RTOS config file and CCS, IAR , GCC projects to support TI-RTOS with all three IDEs.
Current SDK supports TI-RTOS v2.15.00.17.
• ccs_patch – Contains the files required for CCS-FTDI-LP connection.
• iar_patch – Contains the files required for IAR-FTDI-LP connection.
• ftdi - Contains FTDI PC driver.
• gcc_scripts - Contains the scripts to use GCC and openocd with CC3200.
2.3Prerequisite: Tools to be Installed
Table 2. CC3200 Prerequisite
ToolsRemarksLocation
Equipment
ComputerRunning Microsoft® Windows® 7 OSN/A
Development Environment
IARIAR version 7.20 onwards must be installed. After the
Or/and
CCSCCS 6.1.1 version and TI v5.2.6 compiler version. After
CC3200 Support package in
CCSv6.1
Or/and
GCCTo enable CC3200 SDK development on a Linux
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
installation, follow the tools\iar_patch\readme.txt to
debug over FTDI.
the installation, follow the tools\ccs_patch\readme.txt to
debug over FTDI.
Though CCS 6.1.1 provides an option to install this
add-on during installation, the user must check and
install if a newer version is available.
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
13
Foundation SDK – Components
Table 2. CC3200 Prerequisite (continued)
ToolsRemarksLocation
CC32xx PinMux Utility
CC32xx PinMux Utility.exeUtility to assign a desired personality to the general
purpose pins available at the CC3200 device boundary.
CC32xx Programmer Utility
UniflashTool to download firmware, application images, and
certificates to the CC3200 device.
Support Tools
HyperTerminal or TeratermSerial communication tool to communicate over the
UART with the CC3200 device.
IperfA useful tool for measuring TCP and UDP bandwidth
performance.
FTDI DriverFTDI Windows drivers must be installed for a
successful connection to the CC3200 LP over USB.
This FTDI connection can be used for debugging over
JTAG/SWD and communicating over UART.
3Foundation SDK – Components
The CC3200 Foundation SDK package includes two main building blocks:
•SimpleLink Library – This library hosts APIs that serve the connectivity features.
•Peripheral Driver Library – This library hosts APIs to access MCU peripherals.
This section also lists the sample and reference applications packaged in the software development kit.
www.ti.com
Installation:
http://processors.wiki.ti.com/index.php/TI_
PinMux_Tool or refer to Section 5.3.2.2
TI SimpleLink Framework provides a wide set of capabilities, including basic device management through
wireless network configuration, BSD socket services, and more. For better design granularity, these
capabilities are segregated into individual modules. Each module represents different functionality or
capability of the SimpleLink Framework.
14
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
The following list enumerates the different components in the SimpleLink Framework:
ComponentsFunctionality
device
wlan
socket
netapp
netcfg
fs
• Initializes the host
• Controls the communication with the network processor
• Connection to the access point
• Scan access points
• Add or remove access point profiles
• WLAN security
• UDP/TCP client socket
• UDP/TCP server socket
• UDP/TCP Rx/Tx
• DNS resolution
• Ping remote device
• Address resolution protocol
• IP and MAC address configuration
• File system read/write
3.1.2Using the TI SimpleLink Framework
The TI SimpleLink Framework provides a rich, yet simple set of APIs. For detailed information on the APIs
and their usage, refer to the document docs\simplelink_api\programmers_guide.html available in the SDK.
The TI SimpleLink Framework has a ready-to-use port available in the CC3200 Foundation SDK. The
source code is also shared if further customization is desired by the developer. The following note
describes simple possible customizations and the associated procedure.
Foundation SDK – Components
NOTE: All modifications and adjustments to the driver should be made in the user.h header file only,
to ensure a smooth transaction to future versions of the driver.
•Modify user.h file – Modify the user.h file that includes the default configurations and adjustments.
•Select the capabilities set required for your application – TI has focused on building a set of
predefined capability sets that fit most target applications. TI recommends trying and choosing one of
these predefined capabilities sets before building a customized set. Once a compatible set is found,
skip the rest of this step. The available sets are:
– # SL_TINY – Compatible with platforms with very limited resources. Provides the best-in-class
footprint in terms of code and data consumption.
– # SL_SMALL – Compatible with most common networking applications. Provides the most common
APIs with a balance between code size, data size, functionality, and performance.
– # SL_FULL – Provides access to all SimpleLink functionalities.
•Memory management model – The SimpleLink driver supports two memory models:
– Static (default)
– Dynamic
The CC3200 default configuration is static. In the dynamic model, the configuration uses the malloc
and free, as defined by the operating system. To define your own memory management, define
these interfaces.
•Asynchronous event handlers routines – The SimpleLink device generates asynchronous events in
certain situations. These asynchronous events can be masked. Provide handler routines to catch these
events. If a handler routine was not provided and the event is received, the driver drops this event
without any indication of a drop.
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
•Interface communication driver – The CC3200 host driver implements an SPI communication
interface. The interface for this communication channel includes four simple access functions:
1. open
2. close
3. read
4. write
The CC3200, SPI implementation uses DMA to increase the utilization of the communication
channel.
•OS adaptation – The SimpleLink driver can run on two kinds of platforms:
– Non-OS / single-threaded (default)
– Multi-threaded
The CC3200 SimpleLink host driver is ported on both non-OS and multi-threaded OS
environments. The host driver is made OS-independent by implementing an OS abstraction layer.
Reference implementation for OS abstraction is available for FreeRTOS and TI-RTOS.
To work in a multi-threaded environment under a different operating system, provide some basic
adaptation routines to allow the driver to protect access to resources for different threads (locking
object) and to allow synchronization between threads (sync objects). In addition, the driver support
runs without a dedicated thread allocated solely to the SimpleLink driver. To work in this mode,
supply a spawn method that enables functions to run on a temporary context.
3.1.3Switch Between OS, NON-OS, and Debug Configurations
IAR: Choose configuration options from menu Project->Edit configurations-
>OS/NON_OS/PM_Framework/NON_OS_PM/OS_debug/NON_OS_debug/PM_Framework_debug/NON_
OS_PM_debug, as indicated in Figure 8.
www.ti.com
Figure 8. CC3200 SimpleLink IAR Config Switch
16
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
CCS: Choose configuration options from menu Project->Build Configurations->Set active, or as indicated
in Figure 9:
Foundation SDK – Components
Figure 9. CC3200 CCS SimpleLink Config Switch
3.1.4Development versus Deployment Scenario
To support the usage of the reloading of application image using the debugger without having to reset the
device (LaunchPad), the implementation in the cc_pal* (simplelink) file requires a NwpPowerOnPreamble
routine to stop networking services, and a delay in the NwpPowerOn() function must be introduced for
proper operation.
This is required, as a core reset from the debugger only resets when the APPs processor and the
networking engine are still active. Thus, on the next debug session, the networking engine must be
gracefully stopped and started again. This results in additional delays and greater overall current
consumption. As these additional steps and delay are required only for debugging purposes, they should
not be a part of the deployment applications.
For ease of use, the CC3200 SDK latest package provides separate configurations of SimpleLink library
for the development (debug) and deployment scenarios. The following four items should be used for the
deployment scenario (this does not include the additional steps and delay) as per use-case.
•NON_OS – SimpleLink for NON-OS environment
•OS – SimpleLink for OS environment
•PM_Framework – SimpleLink with power management framework for OS environment
•NON_OS_PM – SimpleLink with power management framework hook
All of these configurations are pre-built in the SDK package, along with their generated output library. By
default, all of the networking examples link to one of these configurations.
The corresponding debug configurations are also present as part of the project.
•NON_OS_debug – SimpleLink for NON-OS environment with debug support
•OS_debug – SimpleLink for OS environment with debug support
•PM_Framework_debug – SimpleLink with power management framework for OS environment with
debug support
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
•NON_OS_PM_debug – SimpleLink with power management framework hook with debug support
These configurations are not pre-built; the user must build them first before linking them to their
application. Note that this will result in overall greater current consumption. Link the networking example to
the debug configurations of the SimpleLink library while debugging to enhance the user experience.
Follow these steps to link the application to the debug configuration.
3.1.4.1Relinking to the SimpleLink Library in CCS
1. Compile the relevant debug configuration for SimpleLink library.
2. Right-click on the application, and navigate to Properties>ARM Linker>File Search Path.
3. Edit the SimpleLink library path as shown in Figure 10 and Figure 11.
Figure 10. File Search Path
www.ti.com
18
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
1. Compile the relevant debug configuration for the SimpleLink library.
2. Open the application’s Makefile, and navigate to the linking portion.
3. Change the linking code as shown in Figure 14 and Figure 15.
Figure 14. Linking Code Example 1
Figure 15. Linking Code Example 2
Foundation SDK – Components
3.2Peripheral Driver Library
The CC3200 ROM contains the peripheral driver library (DriverLib) and the boot loader. DriverLib can be
utilized by applications to reduce their flash footprint, allowing the flash (or RAM) to be used for other
purposes (such as additional features in the application).
The Driverlib supports APIs for the modules listed below:
•ADC_Analog_to_Digital_Converter_api
•AES_Advanced_Encryption_Standard_api
•Camera_api
•CRC_Cyclic_Redundancy_Check_api
•DES_Data_Encryption_Standard_api
•Flash_api
•GPIO_General_Purpose_InputOutput_api
•HwSpinLock_api
•I2C_api
•I2S_api
•Interrupt_api
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
For detailed information on the APIs and their usage, refer to the document docs\CC3200 PeripheralDriver Library User's Guide.chm.
3.3Reference Applications
The reference applications available as a part of the SDK package are example implementations which
demonstrate key features and peripherals supported by the subsystem built around the CC3200 device on
the LaunchPad. A brief description of the reference applications are tabulated below. Refer to the
readme.txt present in the individual folders for further information. All examples are broadly divided into
two types: the network reference and the MCU-only reference examples.
www.ti.com
3.3.1Network Reference Examples for the CC3200 LP
Application / DemoDescriptionPeripheral/Feature exercised
Getting started with wLAN
Station
Getting started with wLANAPShowcases the device's capability as an AP in a typical
TCP Socket ApplicationShowcases the device's communication over network using
WLAN Scan Policies
Application
UDP Socket ApplicationShowcases the device's communication over network using
SSL Demo ApplicationShowcases SSL implementation on the CC3200 device.Networking (SSL)
NWP Filter ApplicationShowcases the Rx-Filter feature on the CC3200 device.Networking (MAC Filters)
File Operations ApplicationShowcases the file operation on the serial flash of the device.SFlash (File operations)
Transceiver mode
Application
Provisioning - Smart ConfigDemonstrates how to associate and connect the
Hibernate ApplicationShowcases hibernate as a power saving tool in a networking
Info Center-Get Time
Application
Info Center-Get Weather
Application
Email ApplicationSends emails through SMTP.Networking, GPIO, UART, Timer
XMPP Reference Application Demonstrates the connection scenario with an XMPP server.Networking (Internet)
Provisioning-WPS
Application
Showcases the device's capability as a station in a typical
networking system.
networking system.
TCP protocols.
Sets scan policy and enables the scan in the device.Networking (Scan policies)
TCP protocols.
Inspects the medium in terms of congestion and distance,
validates he RF hardware, and help using the RSSI
information.
CC31xx/CC32xx to any access point.
context (in this case, a UDP client).
Connects to an SNTP server and requests for time
information.
Connects to Open Weather Map and requests for weather
data.
Demonstrates how to use WPS Wi-Fi provisioning with the
CC3200.
Networking (STA mode)
Networking (AP mode)
Networking (Basics)
Networking (Basics)
Networking (Raw sockets),
GPIO, UART, Timer
Networking (Provisioning)
Networking, Low power modes
(HIB), UART, GPIO, Timer
Networking (Internet)
Networking (Internet)
Networking (Provisioning), GPIO
22
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
Application
Serial Wi-Fi ApplicationSerial Wi-Fi is a capability designed to provide easy, self-
Connection Policy
Application
ENT WLAN ApplicationDemonstrates the connection to an enterprise network using
HTTP Server ApplicationDemonstrates the HTTP server capability of the CC3200.Networking (STA Mode)
mDNS ApplicationDemonstrates the usage of mDNS functionality in the CC3200.
Out of Box ApplicationDemonstrates how to view different demo and SDK web links
Wi-Fi Audio ApplicationDemonstrates bi-directional audio application on a CC3200
Antenna Selection
Application
Camera ApplicationDemonstrates the camera feature on the CC3200 device. This
Peer to Peer ApplicationDemonstrates the Wi-Fi direct feature on the CC3200 device.Networking (p2p mode)
Idle ProfileExercises hibernation using power management framework
Sensor ProfileExercises low-power modes (LPDS) using power management
File Download ApplicationDemonstrates file downloading from the web server and stores
Watchdog System DemoIllustrates a full system recovery using watchdog, including the
TFTP ClientDemonstrates file transfer using TFTP (Trivial File Transfer
WebSocket CameraDemonstrates websocket HTTP server functionality by
HTTP Client DemoIllustrates the usage of the HTTP client library to enable the
Idle Profile (Non OS)Exercises the low-power modes (LPDS) using power
MQTT ClientShowcases the device acting as a MQTT client in a fully-
MQTT ServerShowcases the device acting as an MQTT server capable of
OTA UpdateIllustrates the over-the-air (OTA) update of the service pack,
Power MeasurementAllows the user to measure the current consumption for
Foundation SDK – Components
Configures the device either to a station or an AP mode.Networking (STA/AP mode)
contained terminal access behavior over a UART interface.
Demonstrates the connection policies in the CC3200. The
connection policies determine how the CC3200 is connected
to AP.
the flashed certificate. Certificate is flashed in SFLASH.
The application showcases both mDNS advertise and mDNS
listen functionality.
on a web-browser.
LaunchPad setup. The system is comprised of two LPs (in
STA mode). Audio is streamed from one LP and rendered on
another LP over Wi-Fi. This application requires the audio
boosterpack.
Allows the user to select the antenna with the highest signal
for APs using a web-browser.
application requires the camera boosterpack.
(middleware).
framework (middleware).
it to the device memory feature on the CC3200 device.
network subsystem.
Protocol). Requires a TFTP server running on a connected
device, such as a PC or smartphone.
transmitting continuous JPEG frames to a websocket client.
This application requires camera boosterpack and a
connected PC or smartphone with a browser supporting HTML
5.
device as an HTTP client.
management framework in a non-OS environment.
functional MQTT network.
managing multiple local clients, and allowing the local clients
to communicate with remote MQTT clients.
user application, and user files.
various low-power modes.
Networking
Networking (STA Mode)
Networking (STA mode)
Networking (STA Mode) , UART
Networking (AP/STA mode), I2C,
GPIO
Networking (STA/AP mode)
Networking (AP mode)
Networking (AP mode)
Networking (STA Mode)
Networking (STA Mode)
Networking (STA Mode)
Networking (STA Mode)
Networking (STA Mode)
Networking (AP Mode)
Networking (STA mode)
Networking (STA mode)
Networking (STA mode)
Networking (STA mode)
Networking (STA mode)
Networking (STA mode)
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
3.3.2MCU-Only Reference Examples for the CC3200 LP
www.ti.com
Application / DemoDescriptionPeripheral/Feature
LED Blink ApplicationShowcases the blinking feature of available LEDs connected over GPIO on
Timer Demo ApplicationShowcases the usage of 16-bit timers to generate interrupts, which toggle
Watchdog Demo
Application
UART Demo ApplicationShowcases the use of UART.UART
Interrupt Demo Application Showcases interrupt preemption and tail-chaining capabilities.NVIC, UART
I2C DemoShowcases I2C read/write/read from features on the CC3200 device.I2C, UART
MCU SleepExercises the sleep functionality of the MCU.Low-power mode
uDMA ApplicationShowcases different DMA modes of transfer.uDMA, UART
Autorun non-OS
Application
AES Demo ApplicationShowcases the AES encryption feature on the CC3200 device.Crypto, UART
DES Demo ApplicationShowcases the DES encryption feature on the CC3200 device.Crypto, UART
CRC Demo ApplicationShowcases the CRC feature on the CC3200 device.Crypto, UART
FeeRTOS Demo Application Showcases the FreeRTOS features, such as multiple task creation and
SHA-MD5 Demo
Application
ADC Demo ApplicationShowcases the functionality of the CC3200 ADC module by using the
PWM Demo ApplicationShowcases the PWM mode of the CC3200 general purpose timers (GPTs).
SDHost Demo ApplicationShowcases the functionality of the SDHost module in the CC3200. The
SDHost FatFS Demo
Application
SPI Demo ApplicationShows the required initialization sequence to enable the CC3200 SPI
UART dma ApplicationShowcases the use of UART along with uDMA and interrupts.UART, DMA
Timer Count Capture
Application
Application BootloaderShowcases the secondary bootloader operations to manage updates to
Dynamic Library LoaderExercises an approach to enable dynamic loading of an application-binary
LP.
the state of the GPIO.
Showcases the watchdog timer functionality to reset the system whenever
the system fails.
Showcases the basic packet send and receive functionality of the CC3200
in a non-OS environment.
inter-task communication using queues.
Showcases the SHA-MD5 hash algorithm on the CC3200 deviceCrypto, UART
Driverlib APIs.
The GPTs support a 16-bit pulse-width modulation (PWM) mode with
software-programmable output inversion of the PWM signal.
secure digital host (SD host) controller on the CC3200 provides an interface
to standard SD memory cards in 1-bit transfer mode, and handles the SD
protocol and data packing at transmission level with minimum CPU
intervention.
Uses the FatFS to provide the block level read/write access to the SD card,
using the SD host controller on the CC3200.
module in full duplex 4-wire master and slave modes.
Showcases the timer count capture feature to measure frequency of an
external signal.
application image.
from non-volatile memory while the program is being executed.
exercised
GPIO
Timer, GPIO, UART
WDT, GPIO, UART
(Sleep), UART
0.2
UART
ADC, UART
Timer, GPIO
UART, SDHOST
UART, SDHOST
UART, SPI
TIMER
SPI for serial flash
access
3.4CC3200 PinMux Utility
The CC3200 pinmux utility provides a convenient interface to select the personality of the general purpose
pins available at the CC3200 device boundary. The tool generates the source files based on the
information selected, and can be directly included in the project. Refer to the CC3200 PinMux tool wiki
page for further details.
Refer to Section 5.3.2.2 for how to get the new TI-Pinmux tool.
24
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
This section familiarizes the developer with the typical development flow using the building blocks hosted
in Foundation SDK, and emphasizes more of the network aspects of the CC3200. For this purpose, a
suite of Getting Started applications are presented in the SDK. Start with a comprehensive description of
these applications, build and execute procedure with the IDEs, and finally burn the application image in
the non-volatile storage.
The SDK contains five simple network applications to demonstrate the connection and packet-handling
functionality. These applications use the SimpleLink APIs to demonstrate the functionality. The source in
these applications is modular, and can be referred or re-used by the developer.
ApplicationDescription
1.Getting started with WLAN StationReference application to use the CC3200 in STA mode
2.Getting started with WLAN APReference application to use the CC3200 in AP (Access Point) mode
3.TCP Socket ApplicationReference application showcasing the TCP server and client functionality
4.UDP Socket ApplicationReference application showcasing the UDP server and client functionality
5.Raw Socket (Transceiver Mode
Application)
Reference application showcasing the Raw socket functionality
5.1Simple Networking Applications
Any SimpleLink API (sl_* ) must be invoked only after the sl_Start() API has completed. This function
starts the SimpleLink (networking) device. This function also initializes the communication interface.
www.ti.com
5.1.1Getting Started With WLAN Station
5.1.1.1Application Details
This application shows the CC3200 device as a station in a simple network. Developers and users can
refer the function or re-use them while writing a new application. The device connects to an AP (access
point), with AP configurations stored in the form of macros in the application. If the connection is
successful, it tries to get the IP address of www.ti.com, then ping to the IP address. Zero is the expected
return value. A different return code indicates that the internet connection is not available or that the ping
was not successful. The application uses LEDs to indicate the test results; RED indicates an AP
connection, GREEN indicates ping to AP, and ORANGE indicates a ping to www.ti.com.
The application source can be found in example\getting_started_with_wlan_station.
•main.c – Main file creates the SimpleLink task which handles most of the network related operations,
while a WlanStationMode task makes calls to the network-related APIs of the SimpleLink library.
•startup_ewarm.c – IAR workbench-specific vector table implementation for interrupts
•pinmux.c – Contains the configurations to mux the device pins
•gpio_if.c – Common interface file for LED use
•uart_if.c – Common interface file for UART prints
The ewarm folder contains the IAR workspace. The ccs folder contains the CCS Project, the driverlib
folder contains all the driver files, the oslib folder contains the project to build the TI-RTOS/Free-RTOS
library, and the simplelink folder contains SimpleLink host files.
26
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
Using the CC3200 as a STA is a three step process.
1. Start the SimpleLink by calling the sl_Start( ) API.
2. Connect to the AP by calling the sl_WlanConnect( ) API.
3. Ping to the AP and external host by calling the sl_NetAppPingStart() API.
Refer to the main.c file of the reference application for more details.
5.1.1.4Usage
1. Run the application (getting_started_with_wlan_sta) from IAR/CCS, or flash the bin file to the device.
2. The device switches to STA mode if it is in the other mode.
3. The device tries to connect to open a pre-defined AP (cc3200demo). The red LED glows upon a
successful connection.
4. The device pings to AP. If the ping is successful, the green LED glows.
5. The device checks for an internet connection by pinging to www.ti.com. If this ping is successful, the
orange LED glows.
5.1.2Getting Started with WLAN AP
5.1.2.1Application Details
This application aims to exhibit the CC3200 device as an AP. Developers and users can refer or re-use
the function while writing a new application. The device comes up as an AP (access point), then waits for
a station to connect to it. If the connection is successful, it pings to that station. Zero is the expected return
value. A different return code indicates that the ping to the station was unsuccessful.
www.ti.com
5.1.2.2Source Files Briefly Explained
•main.c – Main file creates the SimpleLink task which handles most of the network related operations,
while a WlanStationMode task makes calls to the network-related APIs of the SimpleLink library.
•startup_ewarm.c – IAR workbench-specific vector table implementation for interrupts
•pinmux.c – Contains the configurations to mux the device pins
•uart_if.c – Common interface file for UART prints
The ewarm folder contains IAR workspace. The ccs folder contains CCS Project, the driverlib folder
contains all the driver files, the oslib folder contains the project to build the TI-RTOS/Free-RTOS library,
and the simplelink folder contains SimpleLink host files.
28
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
void WlanAPMode( void *pvParameters )
{
...
lRetVal = sl_Start(NULL,NULL,NULL);
...
// Configure the networking mode ssid name (for AP mode)
ConfigureMode(lRetVal) ;/* ...
while(!IS_IP_ACQUIRED(g_ulStatus))
{
//looping till ip is acquired
}
// get network configuration
lRetVal = sl_NetCfgGet(SL_IPV4_STA_P2P_CL_GET_INFO,&ucDHCP,&len, (unsigned char *)&ipV4);
while(!IS_IP_LEASED(g_ulStatus))
{
//wating for the STA to connect
}
Foundation SDK – Development Flow
lRetVal = sl_WlanSetMode(ROLE_AP);
// set SSID name
lRetVal = sl_WlanSet( ... );
...
*/
// Ping to connected client
iTestResult = PingTest(ulIpAddr);
...
}
Using the CC3200 as an AP is a two step process:
a. Start the SimpleLink by calling the sl_Start() API.
b. Wait until the device gets an IP address.
After the device comes up in AP mode, follow these steps to ensure the device can act as an AP:
1. Wait for a station to connect to the device (the user must connect a machine to the device).
2. Ping the station (machine)
Refer to the main.c file of the reference application for more details.
NOTE: If the device is not able to ping to the connected machine, try disabling the antivirus on the
5.1.2.4Usage
1. Run the application (getting_started_with_wlan_ap) from IAR/CCS or flash to the device.
2. Application will switch to AP mode if it is not in AP mode.
3. After the client connects to the device, the device (AP) pings the client and prints the result over
UART.
4. All results can be viewed on the terminal screen.
5. Observe the execution flow to understand the result.
machine.
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
This application illustrates how to use the device as a client or server for TCP communication. Developers
and users can refer or re-use the function while writing new applications. The device connects to an AP
(access point), with the SSID for AP stored as a macro in the application. Initially, the application
implements a TCP client and sends 1000 TCP packets to a socket address, port number, and IP address
specified as macros. Zero is the expected return code. A different return code indicates that a socket error
has occurred. The default setting is defined as in the following macros, which can be changed either in the
source code or at runtime.
•main.c – Main file calls SimpleLink APIs to connect to the network, creates a socket, and uses it to
communicate over TCP by acting as a TCP client or server.
•pinmux.c – Pinmux file to mux the device to configure a UART peripheral.
•startup_ccs.c – CCS-specific vector table implementation for interrupts
•uart_if.c – Common interface file for UART prints
•udma_if.c – Common interface file for uDMA functionalities
•startup_ewarm.c – IAR workbench-specific vector table implementation for interrupts
The ewarm folder contains IAR workspace. The ccs folder contains CCS Project, the driverlib folder
contains all the driver files, and the simplelink folder contains SimpleLink host files.
int BsdTcpClient(unsigned short usPort)
{
...
//Open a socket with standard parameters
iSockID = sl_Socket(SL_AF_INET,SL_SOCK_STREAM, 0);
if( iSockID < 0 )
{
// error
ASSERT_ON_ERROR(TCP_CLIENT_FAILED);
}
//Connect to the server IP and port number
iStatus = sl_Connect(iSockID, ( SlSockAddr_t *)&sAddr, iAddrSize);
if( iStatus < 0 )
{
// error
ASSERT_ON_ERROR(TCP_CLIENT_FAILED);
}
...
//Send packet using the sl_Send API call
7. After selecting one of the above options, run the iperf command on the PC command prompt as given
in the TeraTerm/HyperTerminal screen.
8. Observe the execution flow to understand the results.
Note: Disable PC anti-virus while running iperf.
5.1.4UDP Socket Application
5.1.4.1Application Details
This application illustrates how to use the device as a client or server for UDP communication. Developers
and users can refer or re-use the function while writing new applications. The device connects to an AP
(access point), with the SSID for the AP stored as a macro in the application. Initially, the application
implements a UDP client and sends 1000 UDP packets to a socket address, port number, and IP address
specified as macros. Zero is the expected return code. A different return code indicates that a socket error
has occurred. The default setting is defined in the following macros, changed either in the source code or
at runtime.
The application source can be found in example\udp_socket.
•main.c – Main file calls SimpleLink APIs to connect to the network, creates a socket, and uses it to
communicate over UDP by acting as a UDP client or server.
•pinmux.c – Pinmux file to mux the device to configure the UART peripheral.
•startup_ccs.c – CCS-specific vector table implementation for interrupts
•uart_if.c – Common interface file for UART prints
•udma_if.c – Common interface file for uDMA functionalities
•startup_ewarm.c – IAR workbench-specific vector table implementation for interrupts
The ewarm folder contains IAR workspace. The ccs folder contains CCS Project, the driverlib folder
contains all the driver files, the oslib folder contains the project to build free_rtos library, the third_party
folder contains FreeRTOS files, and the simplelink folder contains SimpleLink host files.
34
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
/* following calls depend on user's input at runtime */
// Before proceeding, please make sure to have a server waiting on PORT_NUM
lRetVal = BsdUdpClient(PORT_NUM);
// After calling this function, you can start sending data to CC3200 IP
// address on PORT_NUM
lRetVal = BsdUdpServer(PORT_NUM);
...
}
The transceiver mode application in the SDK showcases the use of raw socket usage in CC3200. This
example demonstrates how to build a proprietary protocol on top of a Wi-Fi PHY layer, with the user given
full flexibility to build their own packet.
The first two bytes of the raw data are Wi-Fi PHY layer-specific.
•1st byte: Wi-Fi rate. Definition for rate options can be found in wlan.h, RateIndex_e structure.
•2nd byte: 4 bits of power level and 4 bits of preamble type.
The Rx statistics feature inspects the medium in terms of congestion and distance, validates the RF
hardware, and helps using the RSSI information.
5.1.5.2Source Files Briefly Explained
•main – Demonstrates sending a raw ping packet in Tx continues, and usage of different API for getting
the Rx statistics.
•uart_if – Displays status information over the UART.
•pinmux.c – Pinmux file to mux the device and configure the UART peripheral.
•startup_ccs.c – CCS-specific vector table implementation for interrupts
•startup_ewarm.c – IAR workbench-specific vector table implementation for interrupts
The ewarm folder contains IAR workspace. The ccs folder contains CCS Project, the driverlib folder
contains all the driver files, and the simplelink folder contains SimpleLink host files.
5.1.5.3Usage
•Setup a serial communication application (such as HyperTerminal or TeraTerm).
– Port: Enumerated COM port (CC3200LP Dual Port)
– Baud rate: 115200
– Data: 8 bit
– Parity: None
– Stop: 1 bit
– Flow control: None
•Run the reference application (Flashing the bin/IAR/CCS).
•Observe the status messages on the host over serial port in response to the user's selection of either
"sending packets" or "Collect statistics of received packets" to understand the sequence of operations
performed by the application.
Terminal snapshot when application runs on device is shown in Figure 19.
Foundation SDK – Development Flow
Figure 19. CC3200 Transceiver Application on the Hyperterminal
Common interface files are available under the example\common folder
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
WLAN APIssl_StartThis function starts the SimpleLink (Networking) device. This function initializes the
sl_WlanConnectThis function connects the device to the AP specified as parameter. Once the
sl_IpConfigGetWhile in DHCP mode, this function is used to get an IP address from the associated
sl_WlanDisconnectThis function prompts the device to relinquish the connection (hence the
Note – LED functionality depends on application implementation.
Network APIssl_SocketCreates UDP socket.
sl_SendToSends a Welcome message to the destination IP address, given as input. The
sl_BindBinds socket. The reception port is taken as 5002 in this application.
sl_RecvFromReceives message from client. The device is waiting for 200 packets to receive.
sl_CloseCloses the socket.
Note – Number of packets and port depend on application implementation.
www.ti.com
communication interface. Once this is complete, LED1 starts blinking to indicate
Sl_start is complete and waiting to complete Sl_Wlanconnect.
connection status is set, LED1 will be ON until the device is disconnected from the
AP. After a successful WLAN connect, the name of the AP to which the device is
connected is displayed on the terminal.
AP. The IP address is displayed on the terminal so that the client machine (iperf
PC) can make use of this address to connect to the device.
association) with the AP.
destination IP address is taken from input. 200 packets are sent to the specific
destination address if the address is mentioned in the input. If the destination
address is not mentioned, the message is broadcasted. Once this is complete, an
alert is given on UART. While the device is sending messages, LED2 will be on to
indicate the device status.
Once the device receives 200 packets, an alert indicating the same and the source
address of the packets will be shown on UART. While receiving messages, LED4
will be on to indicate the device status.
5.3Compilation, Build and Execution Procedure
Refer to the IAR/CCS help documentation for detailed information on compiling, building, and executing
user applications. The following sections highlight key projects exercised during the development process.
The basic Wi-Fi application is taken up as a reference to demonstrate the development environment.
Similar procedures apply for any reference application or new developments. Most of the steps mentioned
here are already performed for all the reference applications (present in examples/folder) and captured in
the project files. While using the debugger, clean and rebuild the libraries (driverlib, simplelink, FreeRTOS)
to avoid any source file association problems.
NOTE: While creating new project under this SDK, call PRCMCC3200MCUInit() as the first call in
main() for proper initialization of the device.
NOTE: Visit the CC3200 TI-RTOS page before creating any TI-RTOS-based application.
5.3.1Development Environment – IAR
Follow the steps given in C:\TI\CC3200SDK\cc3200-sdk\tools\iar_patch\readme.txt to replace
iarmLMIFTDI.dll.
5.3.1.1Creating a Project
1. Go to File->New->Workspace
2. Click on Project->Create New Project (Tool Chain = ARM, Project Templates = C)
3. Open Project Option, and follow the settings as given in Figure 20.
40
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
•To use Driverlib APIs – Include driverlib and inc folder path
•To use Simplelink APIs – Include simplelink, simplelink\Source, and simplelink\Include folder paths
•To use Free-RTOS TI-RTOS APIs – Include oslib path
Defined symbols and MACRO definition:
•USE_FREERTOS – If application uses Free-RTOS OS
•USE_TIRTOS – If application uses TI-RTOS OS
•ewarm – Define for IAR-based application
•SL_PLATFORM_MULTI_THREADED – If application uses any OS (Free-RTOS/TI-RTOS)
•NOTERM – If application does not need UART prints.
5.3.1.3Linking a Project
www.ti.com
Figure 22. CC3200 IAR Linker Project
42
Additional libraries:
•Add library path as per application needs:
– driverlib.a : Available under the driverlib\ewarm\Release\Exe\ folder.
– simplelink.a : Available under simplelink\ewarm\OS\, simplelink\ewarm\NON_OS\,
simplelink\ewarm\NON_OS_PM, and simplelink\ewarm\PM_Framework\ folder for the OS, Non-OS,
Non-OS with power management hook, and power management configuration for OS environment,
respectively.
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
– free_rtos.a : Available under oslib\ewarm\free_rtos\Exe\ folder.
– ti_rtos.a : If application uses TI-RTOS, then the TI-RTOS library is available under the
oslib\ewarm\ti_rtos\Exe\ folder.
NOTE:Use the *_debug configuration of the SimpleLink library while debugging the application.
Refer to Section 3.1.4.
Figure 23. CC3200 IAR Linker Config
Linker configuration file:
•Link to IAR linker file. By default, IAR links to CC3200.icf available in IAR installation. The developer
can change this as per application requirement.
Symbol definitions:
•Define CC3200_ES_1_2_1=0 for production devices.
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
To generate additional output select the output format, a current SDK user must select the binary option
and override the .bin path. In CC3200 SDK, IAR generates bin file in the <example>\ewarm\Release\Exe
folder.
5.3.1.5Executing a Project
To use the JTAG over FTDI, the TI Stellaris driver must be selected. The user can configure IAR to work
with JTAG/SWD by choosing the option available in Options->Debugger->TI Stellaris->Interface. On the
CC3200 LaunchPad:
•JTAG Mode – connect SOP-2 jumper only
•SWD mode – connect SOP-0 jumper only
NOTE: The 4-wire JTAG works without connecting the SOP 2 jumper. However, TI recommends
connecting the SOP 2 jumper to prevent the already-flashed code from executing while
debugging.
44
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
Click on the Download and Debug button to start the execution. The execution stops at the main function.
Click the Go button (or F5) to run.
Figure 26. CC3200 IAR Download and Run
If the application uses UART to print the output on the terminal, then the user must setup a terminal
application (such as HyperTerminal or TeraTerm). These are the serial port settings:
•Baud Rate – 115200
•Data – 8 bits
•Parity – none
•Stop – 1 bit
•Flow control- none
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
The current version of the SDK supports Copy Projects into Workspace, allowing the user to modify the
example source as per requirement without touching the SDK repository.
www.ti.com
Figure 29. Select CCS Projects to Import
48
If the user copies any library project (such as driverlib, simplelink, or netapps) to the workspace and
modifies it, ensure that the concerning application connects to the latest and modified >library>.a,
available in the workspace (see Figure 36).
MACRO.ini : This file is used when the user copies any example folder to their working directory and tries
to build a CCS project. Edit macro.ini and assign CC3200_SDK_ROOT to the SDK root path and import
the project into the workspace, so that the example can connect to the SDK libraries and common files.
•Open Project Option, and follow the settings as given in the snapshots.
For the application to work with TI-RTOS, ti_rtos_config project must be imported into the CCS
workspace. Refer to docs\CC3200-TI-RTOS User Guide.pdf or
Add a path variable CC3200_SDK_ROOT in the CCS project, which locates to the root folder of the
current SDK. The user can change this path to point to the desired version of the SDK path. This variable
can be used to include paths, link libraries, and common source files.
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
•As per the application requirements, include driverlib.a, simplelink.a, ti_rtos.a, or free_rtos.a
– driverlib.a is available under the driverlib\ccs\Release folder.
– simplelink.a is available under the simplelink\ccs\OS', NON_OS,' NON_OS_PM', PM_Framework
folder for OS, non-OS, power management for non-OS, or power management for OS-based
applications respectively.
– ti_rtos.a and free_rtos.a are present under the oslib\ccs\ti_rtos and oslib\ccs\free_rtos folders,
respectively.
NOTE: Use the *_debug configuration of the SimpleLink library while debugging the application.
Refer to Section 3.1.4.
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
•If the application uses TI-RTOS OS, add ti_rtos_config project as dependency for the application.
– ti_rtos_config project should be imported in CCS workspace for TI-RTOS-based application.
– Current SDK supports TI-RTOS 2.15.0.x
The execution stops at the main function. Click the Go button (or F8) to run.
For UART-based applications, configure the terminal application:
•Baud Rate – 115200
•Data – 8 bits
•Parity – none
•Stop – 1 bit
Foundation SDK – Development Flow
Figure 44. CC3200 CCS Executing 5
5.3.3Getting Started With GCC
This platform enables open source tool chains. In this section, developers can learn how to get started
with GCC/GDB using the CC3200 LaunchPad, including the dependencies associated with the
environment setup for Windows OS under Cygwin. Included are a few validated sample applications with
GCC, including building block libraries, such as the SimpleLink library and peripheral driver library.
5.3.3.1Install Cygwin (Windows)
1. Download setup-x86.exe from http://cygwin.com/install.html and run it. Select the Install from Internet
option.
2. Specify a proxy if necessary, depending on the network.
3. Choose a download site (for example, http://mirrors.kernel.org).
4. Include the latest versions of the following packages in the Cygwin installation (in addition to those
included in the base installation):
•Archive/unzip
•Archive/zip
•Devel/autoconf
•Devel/automake
•Devel/libtool
•Devel/make
•Devel/subversion (Note: if using TortoiseSVN/Windows7, skip this file)
•Devel/gcc-core
•Devel/gcc-g++
•Devel/mingw-gcc-core
•Devel/mingw-gcc-g++
•Devel/mingw-runtime
See Figure 45 for an example of selecting a package (as example: Devel/autoconf).
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
6. After a successful Cygwin installation, add its path (c:\cygwin\bin\) to the Windows environment
variable PATH by going into Control Panel>System>Advanced System Settings>EnvironmentVariables. Under System Variables, select PATH and press Edit. Append “;C:\cygwin\bin\” to the end of
the line and press OK.
5.3.3.2GNU Tools for ARM Embedded Processors
Download the latest version of gcc-arm-none-eabi-<version>-win32.exe from https://launchpad.net/gcc-
arm-embedded, and install it under the Cygwin root directory (default: c:\cygwin). Add the path
<installation_dir>\bin (for example, c:\cygwin\4.9 2015q2\bin) to the windows PATH environment variable.
5.3.3.3Open On-Chip Debugger (OpenOCD)
1. Download prebuilt openocd-0.9.0 for Windows from
http://sourceforge.net/projects/openocd/files/openocd/0.7.0/ and unzip the package to the Cygwin root
directory (default: c:\cygwin).
2. Add the path for the openocd.exe (.\openocd-0.9.0\bin\) to the Windows PATH environment variable.
3. Download the Zadig USB installation driver from http://zadig.akeo.ie/.
4. Run the zadig_<version>.exe and install the WinUSB driver for USB<->JTAG/SWD (Interface 0)
debuggers (refer to Figure 46 and Figure 47). The IAR and CCS debugger do not work after this: the
drivers must be reconfigured to work with these (refer to Section 5.3.3.6).
62
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
1. Open the common.h file located at the path C:\TI\CC3200SDK_1.3.0\cc3200-sdk\example\common\.
2. Edit common.h to use the SSID, security type, and security key of the AP. Edit the macros
SSID_NAME, SECURITY_TYPE, and SECURITY_KEY to contain the AP information as shown in
Figure 48. The security types supported for this demo are WPA/WPA2 and Open. For Open security,
define SECURITY_TYPE as SL_SEC_TYPE_OPEN. For WPA and WPA2 security, define it as
SL_SEC_TYPE_WPA.
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
63
Foundation SDK – Development Flow
3. Save common.h.
4. In the Cygwin terminal, change the directory to C:\TI\CC3200SDK_1.3.0\cc3200-sdk\example\getting_started_with_wlan_station\gcc\ and run the following command:
make -f Makefile
Note that Cygwin uses forward slashes to separate the directories.
5. Go to <cc3200-sdk>\example\getting_started_with_wlan_station\gcc\ in the command prompt and run
following command:
make -f Makefile
6. This generates the wlan_station.axf file under the gcc\exe folder.
5.3.3.5Target Connection and Debugging (GDB)
1. The OpenOCD configuration file for FTDI is present under the C:\TI\CC3200SDK_1.3.0\cc3200sdk\tools\gcc_scripts\ folder. To test the connection to the CC3200 FTDI Launchpad, navigate to the
<cc3200-sdk>\tools\gcc_scripts folder, run the following command at the Cygwin prompt window, and
check the output to see if the connection happened properly. Cygwin may need to be restarted before
this step.
openocd -f cc3200.cfg
See Figure 49 for the connection output screen while the CC3200 device is connected through GDB.
Figure 49. Output Screen
www.ti.com
64
2. Press <ctrl>+c to return to prompt.
3. Copy the wlan_station.axf file found in C:\TI\CC3200SDK_1.3.0\cc3200-sdk\
\example\getting_started_with_wlan_station\gcc\exe\ to the directory C:\TI\CC3200SDK_1.3.0\c3200sdk\tools\gcc_scripts\.
4. Launch Tera Term, and create a new serial connection to the CC3200 Launchpad COM port.
5. To start debugging using GDB on CC3200, go to C:\TI\CC3200SDK_1.3.0\cc3200-sdk\tools\gcc_scripts\ and run the following command at the Cygwin prompt:
arm-none-eabi-gdb -x gdbinit wlan_station.axf
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
3. Select the <cc3200-sdk>\tools\ftdi folder for the driver update, as shown in Figure 52.
www.ti.com
Figure 52. Device Manager
5.3.4Setup the Terminal Application
To view the UART-based application output on the terminal screen, set up the terminal application (such
as HyperTerminal or TeraTerm). Serial port settings:
•Baud Rate – 115200
•Data – 8 bits
•Parity – none
•Stop – 1 bit
66
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
5.4Flashing and Running the .bin Using the Uniflash Tool
Once finalized, the binary images are flashed onto the non-volatile serial flash (SFlash) of the LaunchPad.
The application starts the execution when the LaunchPad device is powered on. The Uniflash tool flashes
the binaries onto the SFlash. The utility is available at
Follow the Uniflash Quick Start Guide to download the .bin file to the CC3200 device.
NOTE: Connect the SOP 2 jumper on the LaunchPad before flashing any image to the device. After
the flashing is done, remove the SOP 2 jumper and reset the board to boot-up the
application.
The .bin files for the reference examples are available in the folder example\<referenceapp>\ccs\Release
(as generated by CCS) and example\<referenceapp>\ewarm\Release\exe (as generated by IAR). The
application image filename must be /sys/mcuimg.bin.
6CC3200 ROM Services
The CC3200 ROM hosts the bootloader and peripheral driver library. The peripheral driver library is a
collection of routines that abstract the peripheral programming (refer to accompanying doxygen output in
the CC3200 SDK packages). This library is provided in the ROM to let the developer reduce the RAM
footprint of the application.
Bootloader services allow the user to update the application binary image along with other user files in the
serial flash, and are also responsible for loading the user application from the serial flash to MCU RAM.
Foundation SDK – Development Flow
6.1CC3200 Bootloader
The CC3200 bootloader resides in the ROM of the application processor.
•Update/Download – The bootloader downloads an application image from the PC to the CC3200
device. The Bootloader-DNLD functionality is only triggered when the board is in UARTLOAD SenseOn-Power (SOP) mode.
•Bootstrap – The bootloader is responsible for scanning a valid application image (binary) in the serial
flash (for the CC3200R device). Subsequently, the image is loaded to internal memory and execution
control is passed on to the user program.
6.1.1Bootloader Modes – Impact of Device Sense-On-Power (SOP) Pin
The CC3200 device has three SOP pins. A detailed explanation of the functionality is described in the
data sheet (SWRS166). In the context of the boot loader there are two modes:
•A setting corresponding to SOP[2:0] = 0b100, makes the bootloader enter the DOWNLOAD mode; in
this mode an external intervention triggers an operation – for example a break signal on UART from
the SimpleLink programming application, followed by a sequence to push the application image to the
device serial flash.
•A setting corresponding to SOP[2:0] = 0b000 instructs the bootloader to load the application image
from the SFLASH to the internal MCU RAM.
6.1.2Bootloader and User Application – Sharing MCU RAM
In DOWNLOAD mode, the bootloader requires memory resources acquired from the MCU RAM. The
amount of RAM used by the bootloader is 16 KB. This implies that for the production variant of a CC3200
device, the user application image must be restricted to 240 KB for the 256-KB MCU RAM variant of the
CC3200. There are several key points for developers:
•MCU RAM address range 0x20000000 - 0x20003FFF: This area is shared between the application and
the bootloader. The developer can only locate application data sections, as data sections are not part
of the application image; this ensures that when the bootloader is loading the application image from
serial flash to RAM, this memory region is made exclusive to the bootloader. Once the bootloader
launches the application, this memory region can be used by the application for its data sections.
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
•0x20004000 to END of RAM: This RAM area is exclusively for the application. The application image
should always be within this region and start at 0x20004000.
•RAM range for different variants:
– CC3200R1M1: 0x20004000 - 0x20020000
– XCC3200JR, CC3200R1M2: 0x20004000 - 0x20040000
Refer to the Blinky Linker command file (CCS /IAR / GCC), which defines 240 KB of RAM for the
XCC3200JR and CC3200R1M2 devices.
www.ti.com
Table 3. End of RAM
Exclusively for application. Application should be part of this region and start at 0x20004000
16 KB Shared between bootloader and application
END of RAM
[0x20004000]
[0x20000000]
6.2CC3200 Peripheral Driver Library Services in ROM
Peripheral driver routines are used in the CC3200 MCU ROM for linking with user applications. Entire
source codes of the peripheral driver routines are available in the CC3200 SDK. The developer could
choose to build an application with the library while instructing the linker to use routines directly from RAM.
The focus of this section is to appraise the developer on how to use these routines, and the procedure to
patch or extend any existing routines.
6.2.1Peripheral Library Access in ROM
ROM APIs are invoked using the following re-direction flow to allow future extensions while retaining
backward compatibility of location of access functions in the ROM memory map. While the API locations
may change in future versions of the ROM, the API tables will not.
Two tables in the ROM resolve to the entry point of each supported API. Access is made through two
levels; the main table contains one pointer per peripheral, which points to a secondary table that contains
one pointer per API associated with that peripheral.
The main table is located at address 0x0000040C in the ROM. The following table shows a small portion
of the API tables in a graphical form to illustrate the arrangement of the tables:
68
Table 4. ROM APIs
ROM_API TABLE (at 0x0000040C)
[0] = RESERVED
[1] = pointer to ROM_UARTTABLE
[2] = pointer to ROM_TIMERTABLE
[3] = pointer to ROM_WATCHDOGTABLE
[4] = pointer to ROM_INTERRUPTTABLE
[5] = pointer to ROM_UDMATABLE
[6] = pointer to ROM_PRCMTABLE
[7] = pointer to ROM_I2CTABLE
… …
Table 5. ROM Interrupts
ROM_INTERRUPT TABLE
[0] = pointer to ROM_IntEnable
[1] = pointer to ROM_IntMasterEnable
[2] = pointer to ROM_IntMasterDisable
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
The address of the ROM_INTERRUPTTABLE table is located in the memory location at 0x0000041C. The
address of the ROM_IntMasterEnable () function is contained at offset 0x4 from that table. In the function
documentation, ROM_APITABLE is an array of pointers located at 0x0000040C.
ROM_INTERRUPTTABLE is an array of pointers located at ROM_APITABLE[4].
ROM_IntMasterEnable is a function pointer located at ROM_INTERRUPTTABLE [1].
CC3200 ROM Services
SWRU369D–June 2014–Revised May 2018
Submit Documentation Feedback
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
Below are the steps to use ROM driver lib APIs instead of the RAM APIs. These APIs could be used with
the production version of a CC3200 device. These steps apply to all relevant source and project files that
use driver lib APIs, such as the SimpleLink and oslib library.
1. All the .c files which use driver lib APIs should include these header files in order:
•#include rom.h
•#include rom_map.h
2. All the project files should add the global preprocessor define TARGET_IS_CC3200.
3. All driver lib APIs should be invoked by MAP_apiname instead of apiname. For example, use
MAP_UARTCharPut instead of UARTCharPut. Any changes or additions should follow this approach.
4. Rebuild all relevant projects.
6.2.3Patching ROM APIs
Follow these steps to selectively patch the ROM driver lib APIs. Note that “patch” in this description means
using the RAM driver lib API instead of the ROM driver lib API.
1. Add an entry in the file \driverlib\rom_patch.h for all APIs to be patched.
2. For example, to patch MAP_UARTCharPut and MAP_UARTBreakCtl entries in file rom_patch.h:
•#undef ROM_UARTCharPut
•#undef ROM_UARTBreakCtl
3. Rebuild all the relevant projects that use driver lib APIs.
www.ti.com
6.2.4Linking with RAM-based Peripheral Driver Library
To de-link all ROM driver lib APIs and use the RAM driver lib APIs, follow these steps:
1. Remove the global preprocessor define TARGET_IS_CC3200 from all project files that use driver lib
APIs.
2. Rebuild all the relevant projects that use driver lib APIs.
70
CC3200 SimpleLink™ Wi-Fi®and IoT Solution, a Single Chip Wireless MCU
IMPORTANT NOTICE FOR TI DESIGN INFORMATION AND RESOURCES
Texas Instruments Incorporated (‘TI”) technical, application or other design advice, services or information, including, but not limited to,
reference designs and materials relating to evaluation modules, (collectively, “TI Resources”) are intended to assist designers who are
developing applications that incorporate TI products; by downloading, accessing or using any particular TI Resource in any way, you
(individually or, if you are acting on behalf of a company, your company) agree to use it solely for this purpose and subject to the terms of
this Notice.
TI’s provision of TI Resources does not expand or otherwise alter TI’s applicable published warranties or warranty disclaimers for TI
products, and no additional obligations or liabilities arise from TI providing such TI Resources. TI reserves the right to make corrections,
enhancements, improvements and other changes to its TI Resources.
You understand and agree that you remain responsible for using your independent analysis, evaluation and judgment in designing your
applications and that you have full and exclusive responsibility to assure the safety of your applications and compliance of your applications
(and of all TI products used in or for your applications) with all applicable regulations, laws and other applicable requirements. You
represent that, with respect to your applications, you have all the necessary expertise to create and implement safeguards that (1)
anticipate dangerous consequences of failures, (2) monitor failures and their consequences, and (3) lessen the likelihood of failures that
might cause harm and take appropriate actions. You agree that prior to using or distributing any applications that include TI products, you
will thoroughly test such applications and the functionality of such TI products as used in such applications. TI has not conducted any
testing other than that specifically described in the published documentation for a particular TI Resource.
You are authorized to use, copy and modify any individual TI Resource only in connection with the development of applications that include
the TI product(s) identified in such TI Resource. NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE TO
ANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY TECHNOLOGY OR INTELLECTUAL PROPERTY
RIGHT OF TI OR ANY THIRD PARTY IS GRANTED HEREIN, including but not limited to any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
regarding or referencing third-party products or services does not constitute a license to use such products or services, or a warranty or
endorsement thereof. Use of TI Resources may require a license from a third party under the patents or other intellectual property of the
third party, or a license from TI under the patents or other intellectual property of TI.
TI RESOURCES ARE PROVIDED “AS IS” AND WITH ALL FAULTS. TI DISCLAIMS ALL OTHER WARRANTIES OR
REPRESENTATIONS, EXPRESS OR IMPLIED, REGARDING TI RESOURCES OR USE THEREOF, INCLUDING BUT NOT LIMITED TO
ACCURACY OR COMPLETENESS, TITLE, ANY EPIDEMIC FAILURE WARRANTY AND ANY IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL
PROPERTY RIGHTS.
TI SHALL NOT BE LIABLE FOR AND SHALL NOT DEFEND OR INDEMNIFY YOU AGAINST ANY CLAIM, INCLUDING BUT NOT
LIMITED TO ANY INFRINGEMENT CLAIM THAT RELATES TO OR IS BASED ON ANY COMBINATION OF PRODUCTS EVEN IF
DESCRIBED IN TI RESOURCES OR OTHERWISE. IN NO EVENT SHALL TI BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL,
COLLATERAL, INDIRECT, PUNITIVE, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES IN CONNECTION WITH OR
ARISING OUT OF TI RESOURCES OR USE THEREOF, AND REGARDLESS OF WHETHER TI HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
You agree to fully indemnify TI and its representatives against any damages, costs, losses, and/or liabilities arising out of your noncompliance with the terms and provisions of this Notice.
This Notice applies to TI Resources. Additional terms apply to the use and purchase of certain types of materials, TI products and services.
These include; without limitation, TI’s standard terms for semiconductor products http://www.ti.com/sc/docs/stdterms.htm), evaluation
modules, and samples (http://www.ti.com/sc/docs/sampterms.htm).