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