Staging:CC3x00 to CC3x20 Porting Guide (Texas Instruments NDA restrictions applicable)

= Overview = 'CC3120 SimpleLinkTM Wi-Fi Network Processor' and 'CC3220 SimpleLinkTM Wireless MCU' are the second generation devices in the SimpleLinkTM Wi-Fi and Internet-of-Things family, with enhanced and newer features to further simplify connecting things to the internet.

The purpose of this document is to underline the changes that are required on the boards and applications, when moving from Gen-1 to Gen-2 of this device.

= Features Additions and Enhancements = Below is a list of features/enhancements that are enabled in Gen-2 of the device:
 * Support for IPv6
 * Improved provisioning
 * Improved power consumption
 * Support for more secure sockets, with the ability to upgrade a non-secure socket to a secure socket during connection
 * Ability to return to factory default settings
 * Ability to program an image from the host
 * Support for secure file-system
 * Support for bundle protection to allow system integrity during OTA update
 * Support for up-to 4 stations while in AP mode

In addition to the new features, customers moving to this generation of the device, should also be aware of the below changes:

= Migration from CC3x00 to CC3x20 =

Hardware
This section lists down the hardware changes that are needed on the board when migrating from CC3100/CC3200 to CC3120/CC3220 device respectively. Note: This is by no means a complete set of change list, as additional changes may be needed based on the actual board design. Note: This list of changes is not yet verified on silicon and is based on design changes only Note: Boards shouldn't be designed for the final silicon till TI provides the reference board design for CC3x20

Software
The host-driver for the Gen-2 device is modified to support the new features and enhancements listed above. Though, most of the APIs remain unchanged, signatures/names of some APIs/variables are modified. This section outlines the changes needed to adapt the application code to fit the new Gen-2 host-driver. It also reviews all APIs/variables that require adaptation.

New asynchronous events
In addition to the existing events, few new asynchronous events are generated by Gen-2 device. To allow applications handle these events, the Gen-2 host-driver calls below routines. If applications are required to handle these events, user.h shall be modified to define and map these host-driver calls to the corresponding callbacks routines defined in the application.
 * slcb_GetTimestamp - If defined, the host-driver calls this function to get the current time-stamp - This enables it to detect the timeouts/errors during its communication with the SimpleLink device.
 * slcb_NetAppRequestHdlr – If defined, it enables the application to respond to resource requests by the SimpleLink device, .i.e. HTTP requests.
 * slcb_NetAppRequestMemFree – If defined, it enables the host-driver to free resources which were dynamically allocated by the application. If not implemented, static allocation is assumed.
 * slcb_DeviceFatalErrorEvtHdlr – If defined, it enables the application to receive fatal error events which occur in the device or host-driver, and require restarting the device. In Gen-1 device, these events were being notified by 'slcb_DeviceGeneralEvtHdlr' callback

Miscellaneous

 * New silo 'NetUtils' is added in Gen-2 host-driver - It provides network utilities such as secure content delivery. APIs 'sl_NetUtilSet', 'sl_NetUtilGet' and 'sl_NetUtilCmd' are added. Refer the API documentation in '\simplelink\include\netutil.h' for more details
 * New header file 'errors.h' is added in Gen-2 host-driver – This file has defination for all the errors types in the host-driver
 * Header file 'wlan_rx_filters.h' is removed and filter related parameters are added in 'wlan.h'
 * 'Image Creator' tool will replace Uniflash in this release for flashing the service pack, application image and user specific files. Refer to 'CC3x20 Programmer Utility' section of 'cc3x20 programmers guide' for more details.