zephyriot / zep-jira14

0 stars 0 forks source link

Texas Instruments CC3220 LaunchXL Support #1803

Open nashif opened 7 years ago

nashif commented 7 years ago

Reported by Gilbert Pitney:

Add support for the Texas Instruments CC3220 SoC and LaunchXL board.

CC3220 is the updated SoC following the CC3200. CC3220, CC3220S, and CC3220SF (with Flash) integrate an ARM® Cortex™-M4 MCU with on-chip Wi-Fi, internet, and robust security protocols.

Goals: Phase 1: port with basic drivers (uart, gpio) able to run Zephyr samples (w/o WiFi). Phase 2: deprecate the CC3200 launchxl support in Zephyr (redundant to the CC3220). Phase 3: integrate WiFi support as a TCP/IP offload driver. WiFi is supported on a separate core, via the TI SimpleLink host driver and protocol stack.

This port will leverage the peripheral driver library in ROM, plus the driver library headers and WiFi host driver from the CC3220 SDK as an external HAL.

(Imported from Jira ZEP-1958)

nashif commented 7 years ago

by Siwei Xu:

The TI SimpleLink offers a BSD socket like interface, but the zephyr project offers another style of interface. Do you have any idea to makes SimpleLink well works under zephyr net?

nashif commented 7 years ago

by Siwei Xu:

I have an idea, create a AF_INET raw socket to fake SimpleLink as an Ethernet device. but I'm not sure it is feasible.

nashif commented 7 years ago

by Gilbert Pitney:

The Zephyr IP stack designers placed a CONFIG_NET_OFFLOAD option in Zephyr, with the intention of supporting IP offload devices.

See slide 7 in this slideset: https://www.slideshare.net/linaroorg/bud17112-porting-the-ti-simplelink-cc32xx-wifi-stack-to-the-zephyr-iot-os

However, recently, there has been discussion about adding a BSD socket layer to Zephyr. See: GH-1769

To enable full offload, code space and energy savings entitlement to the TI WiFi processor, I think the best solution would be to offload from this (future) BSD API socket layer, similar to what is done in MyNewt. See: https://github.com/apache/incubator-mynewt-core/blob/develop/net/ip/mn_socket/include/mn_socket/mn_socket_ops.h

The disadvantage is that would bypass any future IP routing logic in Zephyr (but not a big issue for IoT client nodes just connected via WiFi), and it's also not clear which higher level Zephyr protocols (HTTP, MQTT, COAP, etc) would actually be built on the new BSD socket layer, since the lower level net_context APIs are still being offered as the "preferred" APIs.

So, until the BSD socket layer becomes the preferred API, the "plan of record" is to offload via the CONFIG_NET_OFFLOAD option, which will indeed incur some overhead mapping net_context APIs to BSD socket APIs.

There was some out-of-tree work on the CC3200, at https://git.linaro.org/people/gil.pitney/zephyr.git/log/?h=net_offload, which was stopped when TI released the CC3220SF, and so we are switching to that platform now.

nashif commented 7 years ago

by Siwei Xu:

Gilbert Pitney , great thanks for your additional informations

nashif commented 7 years ago

Related to GH-2106