1.. zephyr:board:: cc3220sf_launchxl 2 3Overview 4******** 5The SimpleLink Wi-Fi CC3220SF LaunchPad development kit (CC3220SF-LAUNCHXL) 6highlights CC3220SF, a single-chip wireless microcontroller (MCU) with 71MB internal flash, 4MB external serial flash, 256KB of RAM and enhanced 8security features. 9 10See the `TI CC3220 Product Page`_ for details. 11 12Features: 13========= 14 15* Two separate execution environments: a user application dedicated ARM 16 Cortex-M4 MCU and a network processor MCU to run all Wi-Fi and 17 internet logical layers 18* 40-pin LaunchPad standard leveraging the BoosterPack ecosystem 19* On-board accelerometer and temperature sensor 20* Two buttons and three LEDs for user interaction 21* UART through USB to PC 22* BoosterPack plug-in module for adding graphical displays, audio 23 codecs, antenna selection, environmental sensing, and more 24* Power from USB for the LaunchPad and optional external BoosterPack 25* XDS110-based JTAG emulation with serial port for flash programming 26 27Details on the CC3220SF LaunchXL development board can be found in the 28`CC3220SF LaunchPad Dev Kit Hardware User's Guide`_. 29 30Hardware 31******** 32 33The CC3220SF SoC has two MCUs: 34 35#. Applications MCU - an ARM |reg| Cortex |reg|-M4 Core at 80 MHz, with 256Kb RAM, 36 and access to external serial 4MB flash with bootloader and peripheral 37 drivers in ROM. 38 39#. Network Coprocessor (NWP) - a dedicated ARM MCU, which completely 40 offloads Wi-Fi and internet protocols from the application MCU. 41 42Complete details of the CC3220SF SoC can be found in the `CC3220 TRM`_. 43 44Supported Features 45================== 46 47Zephyr has been ported to the Applications MCU, with basic peripheral 48driver support. 49 50+-----------+------------+-----------------------+ 51| Interface | Controller | Driver/Component | 52+===========+============+=======================+ 53| UART | on-chip | serial port-interrupt | 54+-----------+------------+-----------------------+ 55| GPIO | on-chip | gpio | 56+-----------+------------+-----------------------+ 57| I2C | on-chip | i2c | 58+-----------+------------+-----------------------+ 59| SPI_0 | on-chip | Wi-Fi host driver | 60+-----------+------------+-----------------------+ 61 62.. note:: 63 64 For consistency with TI SimpleLink SDK and BoosterPack examples, 65 the I2C driver defaults to I2C_BITRATE_FAST mode (400 kHz) bus speed 66 on bootup. 67 68The accelerometer, temperature sensors, or other peripherals 69accessible through the BoosterPack, are not currently supported. 70 71Programming and Debugging 72************************* 73 74TI officially supports development on the CC3220SF using the TI 75`CC3220 SDK`_ on Windows and Linux using TI tools: Code Composer 76Studio for debugging and `UniFlash`_ for flashing. 77 78For Windows developers, see the `CC3220 Getting Started Guide`_ for 79instructions on installation of tools, and how to flash the board using 80UniFlash. 81 82Note that zephyr.bin produced by the Zephyr SDK may not load via 83UniFlash tool. If encountering difficulties, use the zephyr.elf 84file and openocd instead (see below). 85 86The following instructions are geared towards Linux developers who 87prefer command line tools to an IDE. 88 89Before flashing and debugging the board, there are a few one-time board 90setup steps to follow. 91 92Prerequisites: 93============== 94 95#. Download and install the latest version of `UniFlash`_. 96#. Jumper SOP[2..0] (J15) to [010], and connect the USB cable to the PC. 97 98 This should result in a new device "Texas Instruments XDS110 Embed 99 with CMSIS-DAP" appearing at /dev/ttyACM1 and /dev/ttyACM0. 100 101#. Update the service pack, and place the board in "Development Mode". 102 103 Setting "Development Mode" enables the JTAG interface, necessary 104 for subsequent use of OpenOCD and updating XDS110 firmware. 105 106 Follow the instructions in Section 2.4 "Download the Application", 107 in the `CC3220 Getting Started Guide`_, except for steps 5 and 6 in 108 Section 2.4.1 which select an MCU image. 109 110#. Ensure the XDS-110 emulation firmware is updated. 111 112 Download and install the latest `XDS-110 emulation package`_. 113 114 Follow these `xds110 firmware update directions 115 <http://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_xds110.html#updating-the-xds110-firmware>`_ 116 117 Note that the emulation package install may place the xdsdfu utility 118 in ``<install_dir>/ccs_base/common/uscif/xds110/``. 119 120#. Switch Jumper SOP[2..0] (J15) back to [001]. 121 122 Remove power from the board (disconnect USB cable) before switching jumpers. 123 124#. Install OpenOCD 125 126 You can obtain OpenOCD by following these 127 :ref:`installing the latest Zephyr SDK instructions <toolchain_zephyr_sdk>`. 128 129 After the installation, add the directory containing the OpenOCD executable 130 to your environment's PATH variable. For example, use this command in Linux: 131 132 .. code-block:: console 133 134 export PATH=$ZEPHYR_SDK_INSTALL_DIR/sysroots/x86_64-pokysdk-linux/usr/bin/openocd:$PATH 135 136 If you had previously installed TI OpenOCD, you can simply switch to use 137 the one in the Zephyr SDK. If for some reason you wish to continue to use 138 your TI OpenOCD installation, you can set the OPENOCD and 139 OPENOCD_DEFAULT_PATH variables in 140 :zephyr_file:`boards/ti/cc3220sf_launchxl/board.cmake` to point the build 141 to the paths of the OpenOCD binary and its scripts, before 142 including the common openocd.board.cmake file: 143 144 .. code-block:: cmake 145 146 set(OPENOCD "/usr/local/bin/openocd" CACHE FILEPATH "" FORCE) 147 set(OPENOCD_DEFAULT_PATH /usr/local/share/openocd/scripts) 148 include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) 149 150#. Ensure CONFIG_XIP=y (default) is set. 151 152 This locates the program into flash, and sets CONFIG_CC3220SF_DEBUG=y, 153 which prepends a debug header enabling the flash to persist over 154 subsequent reboots, bypassing the bootloader flash signature 155 verification. 156 157 See Section 21.10 "Debugging Flash User Application Using JTAG" of the 158 `CC3220 TRM`_ for details on the secure flash boot process. 159 160 161Once the above prerequisites are met, applications for the ``_cc3220sf_launchxl`` 162board can be built, flashed, and debugged with openocd and gdb per the Zephyr 163Application Development Primer (see :ref:`build_an_application` and 164:ref:`application_run`). 165 166Flashing 167======== 168 169To build and flash an application, execute the following commands for <my_app>: 170 171.. zephyr-app-commands:: 172 :app: <my_app> 173 :board: cc3220sf_launchxl 174 :goals: flash 175 176This will load the image into flash. 177 178To see program output from UART0, connect a separate terminal window: 179 180.. code-block:: console 181 182 % screen /dev/ttyACM0 115200 8N1 183 184Then press the reset button (SW1) on the board to run the program. 185 186When using OpenOCD from Zephyr SDK to flash the device, you may notice 187the program hangs when starting the network processor on the device, if the 188program uses it. There is a known issue with how that version of OpenOCD 189resets the network processor. You would need to manually hit the reset button 190on the board to properly reset the device after flashing. 191 192Debugging 193========= 194 195To debug a previously flashed image, after resetting the board, use the 'debug' 196build target: 197 198.. zephyr-app-commands:: 199 :app: <my_app> 200 :board: cc3220sf_launchxl 201 :maybe-skip-config: 202 :goals: debug 203 204 205Wi-Fi Support 206************* 207 208The SimpleLink Host Driver, imported from the SimpleLink SDK, has been ported 209to Zephyr, and communicates over a dedicated SPI to the network co-processor. 210It is available as a Zephyr Wi-Fi device driver in 211:zephyr_file:`drivers/wifi/simplelink`. 212 213Usage: 214====== 215 216Set :kconfig:option:`CONFIG_WIFI_SIMPLELINK` and :kconfig:option:`CONFIG_WIFI` to ``y`` 217to enable Wi-Fi. 218See :zephyr_file:`samples/net/wifi/shell/boards/cc3220sf_launchxl.conf`. 219 220Provisioning: 221============= 222 223SimpleLink provides a few rather sophisticated Wi-Fi provisioning methods. 224To keep it simple for Zephyr development and demos, the SimpleLink 225"Fast Connect" policy is enabled, with one-shot scanning. 226This enables the cc3220sf_launchxl to automatically reconnect to the last 227good known access point (AP), without having to restart a scan, and 228re-specify the SSID and password. 229 230To connect to an AP, first run the Zephyr Wi-Fi shell sample application, 231and connect to a known AP with SSID and password. 232 233See :zephyr:code-sample:`wifi-shell` 234 235Once the connection succeeds, the network co-processor keeps the AP identity in 236its persistent memory. Newly loaded Wi-Fi applications then need not explicitly 237execute any Wi-Fi scan or connect operations, until the need to change to a new AP. 238 239Secure Socket Offload 240********************* 241 242The SimpleLink Wi-Fi driver provides socket operations to the Zephyr socket 243offload point, enabling Zephyr BSD socket API calls to be directed to the 244SimpleLink Wi-Fi driver, by setting :kconfig:option:`CONFIG_NET_SOCKETS_OFFLOAD` 245to ``y``. 246 247Secure socket (TLS) communication is handled as part of the socket APIs, 248and enabled by: 249 250- setting both :kconfig:option:`CONFIG_NET_SOCKETS_SOCKOPT_TLS` 251 and :kconfig:option:`CONFIG_TLS_CREDENTIAL_FILENAMES` to ``y``, 252- using the TI Uniflash tool to program the required certificates and 253 keys to the secure flash filesystem, and enabling the TI Trusted 254 Root-Certificate Catalog. 255 256See :zephyr:code-sample:`sockets-http-get` and 257:zephyr_file:`samples/net/sockets/http_get/boards/cc3220sf_launchxl.conf` for an 258example. 259 260See the document `Simplelink Wi-Fi Certificates Handling`_ for details on 261using the TI UniFlash tool for certificate programming. 262 263References 264********** 265 266CC32xx Wiki: 267 http://processors.wiki.ti.com/index.php/CC31xx_%26_CC32xx 268 269.. _TI CC3220 Product Page: 270 http://www.ti.com/product/cc3220 271 272.. _CC3220 TRM: 273 http://www.ti.com/lit/pdf/swru465 274 275.. _CC3220 Programmer's Guide: 276 http://www.ti.com/lit/pdf/swru464 277 278.. _CC3220 Getting Started Guide: 279 http://www.ti.com/lit/pdf/swru461 280 281.. _UniFlash: 282 http://processors.wiki.ti.com/index.php/Category:CCS_UniFlash 283 284.. _CC3220 SDK: 285 http://www.ti.com/tool/download/SIMPLELINK-CC3220-SDK 286 287.. _CC3220SF LaunchPad Dev Kit Hardware User's Guide: 288 http://www.ti.com/lit/pdf/swru463 289 290.. _XDS-110 emulation package: 291 http://processors.wiki.ti.com/index.php/XDS_Emulation_Software_Package#XDS_Emulation_Software_.28emupack.29_Download 292 293.. _Simplelink Wi-Fi Certificates Handling: 294 http://www.ti.com/lit/pdf/swpu332 295