[[PageOutline]] = GW16122 - Mini-PCIe Radio for Internet of Things - IoT = ** Software Disclaimer: This hardware was designed from a Texas Instruments Reference design. Thus, all All software support is community supported through Texas Instruments.** == Getting Started == It is beneficial to read this entire wiki page before getting started to gain knowledge about the product. Gateworks recommends the following setup for getting started and development: === Hardware Requirements === * Gateworks [http://www.gateworks.com/product Ventana or Newport] Single Board Computer * Gateworks SBC loaded with [wiki:ventana/ubuntu Ubuntu operating system ] * Gateworks GW16122 IoT Card * Gateworks GW10124 900Mhz Antenna * Gateworks GW10074 MMCX to SMA Female Adapter Cable * [http://www.ti.com/tool/LAUNCHXL-CC1350 Ti CC1350 LaunchPad] - Gateworks SBC and GW16122 are the 'collector' in the system. This CC1350 LaunchPad becomes the 'sensor' for development. === Software Requirements === Most software must be acquired from Ti because it is held behind a EULA. You will need to download 2 items from Ti on a Linux PC: 1. SDK [http://www.ti.com/tool/download/SIMPLELINK-CC13X0-SDK SIMPLELINK-CC13X0-SDK] 2. Ti 15-4 Stack [http://www.ti.com/tool/download/TI-15-4-STACK-GATEWAY-LINUX-SDK TI-15-4-STACK-GATEWAY-LINUX-SDK] There are 3 or more pieces of software: 1. The firmware '''pre-installed (so you can skip this step)''' on the GW16122 is called the !CoProcessor firmware * Download the SDK here: [http://www.ti.com/tool/download/SIMPLELINK-CC13X0-SDK SIMPLELINK-CC13X0-SDK Version 1.60.00.21] * There is a precompiled binary in the SDK here: * /usr/src/ti/simplelink_cc13x0_sdk_xxx/examples/rtos/CC1350_LAUNCHXL/ti154stack/hexfiles/coprocessor_cc13x0_lp.hex * Built from the source code here: * /usr/src/ti/simplelink_cc13x0_sdk_xxx/examples/rtos/CC1350_LAUNCHXL/ti154stack/coprocessor 2. The firmware for the Sensor Node * There is a precompiled binary in the SDK from step 1, here: * /usr/src/ti/simplelink_cc13x0_sdk_xxx/examples/rtos/CC1350_LAUNCHXL/ti154stack/hexfiles/default/sensor_default.hex 3. The application running in Ubuntu on the Gateworks SBC * Must download Ti-15-4 Stack from Ti onto Linux Desktop [http://www.ti.com/tool/download/TI-15-4-STACK-GATEWAY-LINUX-SDK] * Once installed on desktop, find the file: ti154stack_linux_x64_2_04_00_19/prebuilt/bbb_prebuilt.tar.gz * Copy this file (bbb_prebuilt.tar.gz) onto the Gateworks SBC running Ubuntu either through wget or USB drive or scp or other options. * Extract this with the command: {{{ tar xvf bbb_prebuilt.tar.gz }}} === Setup Steps === * Program CC1350 LaunchPad Sensor node with default Ti Sensor firmware from Software Requirements section. Ti Steps here: * [http://dev.ti.com/tirex/content/simplelink_academy_cc13x0sdk_1_12_01_16/modules/154-stack_03_linux_project_0/154-stack_03_linux_project_0.html] * [http://www.ti.com/lit/ug/swru491a/swru491a.pdf] * Connect GW16122 to Gateworks SBC in Mini-PCIe slot that supports USB * Install [wiki:ubuntu Ubuntu 14.04] Trusty on Gateworks SBC * Connect ethernet cable to Gateworks SBC on the same network as a PC/Laptop (for web gui viewing) * Connect antenna to GW16122 * Install Ti 15.4 Stack on Gateworks board * Run the script on the Gateworks command line: ./run_demo.sh with the following output: {{{ }}} * Observe the IP address printed out in the script output * From a computer on the same network as the Gateworks board, open a web browser and type in the IP address including the port and observe the web gui shown below: [[Image(gw16122webgui.png,400px)]] * Power on the sensor node that should connect to the collector. * NOTE: The sensor node has NV Ram that stores the last network it was connected to. This must be reset every time the run_demo.sh script is ran. == General Information == Features Include: * Texas Instruments [http://www.ti.com/lsds/ti/wireless-connectivity/multi-standard/simplelink-cc1350/overview.page ​CC1350 MCU] * Open Source 802.15.4g * Lowest Power * Sub 1GHz * 5.4 mA Radio RX current * 13.4 mA Radio TX @ +10 dBm * 24.4 mA Radio TX @ +14 dBm * Longest Range * Excellent Receiver Sensitivity –124 dBm Using Long-Range Mode, –110 dBm at 50 kbps (Sub-1 GHz), –87 dBm at Bluetooth low energy * Programmable Output Power up to +14 dBm (Sub-1 GHz) and +9 dBm at 2.4 GHz (Bluetooth low energy) * Small form factor (7x7mm chip size) * Low Bandwidth applications - Sensor Data, etc * Minimal interference - Narrow Bandwidth * Can perform Sigfox TX if required, no RX This features two RF Channels: * Sub 1GHz (USA 915MHz) - Used for long distance communication * Bluetooth 4.2 Low Energy (2.4GHz) - Used for programming sensor nodes == Texas Instruments Reference Design == For more information see the [http://www.ti.com/product/CC1350 TI ​CC1350 Product Page]. == RF Network / Infrastructure == The GW16122 / CC1350 operates on its own network. It does not rely on towers/networks installed by 3rd party companies (!LoRa, Sigfox, Verizon, AT&T, etc). The entire network infrastructure is under control by the user. This includes sensors/nodes, collector(s), antennas and more. == Network Architecture == The default is a star-based topology system where there is one central collector (The GW16122 on a Gateworks SBC) that listens to all the sensors / nodes that are around it. == Sensor Limits == Number of connected users: * Support for 50 nodes in network is for the MAC-!CoProcessor configuration, where the network employs full MAC level security (AES-128). The Security table can take up all available RAM considering 500 bytes packets so some trade off are possible if the max packet size that must be supported by the application is smaller and the network size can go bigger (probably not reach 1K nodes). The network can scale up to much more nodes if for instance the security is removed at MAC level and deployed at application level (the code is hosted on Linux). The actual network size would be in that case more limited by the traffic profile (ie how frequently data is exchanged). == Glossary == * BLE - Bluetooth Low Engery * BLE-ADV - Bluetooth Low Energy Advertising * OAD - Over the Air Download * 802.15.4 - IEEE standard defining the operation of low-rate wireless personal area networks (LR-WPANs). Definition includes the physical layer and media access control. Can be used with 6LoWPAN. The IEEE 802.15.4 standard is used as a data-link layer of many popular networking standards deployed in the market (6LoWPAN, Wi-SUN, !ZigBee®, Thread and WHART). It guarantees a solid wireless foundation thanks to features like air arbitration (through CSMA-CA), acknowledgments and retransmissions and built-in AES security. * Frequency: North America: 902–928 MHz, up to 30 channels * RTOS - Real Time Operating System * 6LoWPAN - Low Power Personal Area Network, allowing for IPv6 packets. * LRM - Long Range Mode * LP - Likely LaunchPad, referring to the CC1350 'Dev Kit' from Ti. Could also mean 'LowPower' * PA/LNA - Power amplifier (PA) for increased output power, and a low-noise amplifier (LNA) with low noise figure for improved receiver sensitivity. This can be used with the [http://www.ti.com/product/CC1190/toolssoftware ​Ti CC1190 RF Booster / Front End] * BLE Modes - advertising, scanning, master, slave. Read more [http://www.eetimes.com/document.asp?doc_id=1278927 ​here] * TI-RTOS - TI-RTOS kernel is a tailored version of the legacy SYS/BIOS kernel and operates as a real-time, preemptive, multi-threaded operating system with drivers, tools for synchronization and scheduling. * TI-15.4 Stack - The TI 15.4-Stack is a software development kit (SDK) running on the !SimpleLink™ Sub-1 GHz CC1310 wireless microcontroller (MCU). Based on the proven IEEE 802.15.4 standard, it implements the 'g' amendment of the specification for operations in North America and Europe in the Sub-1 GHz band (regulated respectively by FCC and ETSI). * LPWAN - Low‑Power Wide‑Area * Contiki - Open Source Operating System * rfWsnDmNodeOad_US_CC1350STK_TI_CC1350F128-v1_06.hex * rf = Radio Frequency * Wsn = Wireless Sensor Network * Dm = Dual Mode, Bluetooth and Sub 1Ghz * Node = A node is an edge device that is a sensor and sends data back to a central coordinator or collector * Oad = Over the air download * STK = Sensor Tag Kit * Coord Addr - Coordinator Address - This is the address on the network for the coordinator/collector. Example: 0xAABB * PanID - Personal Area Network ID, example 0xACDC * FH - Frequency hopping. Not used in default examples. * EasyLink - an API, a simple abstraction layer on top of the RF Driver and is intended as a starting point for customers creating a proprietary Sub1-GHz protocol or application. * Alternatives: * TI-RTOS RF driver (of what EasyLink is a abstraction of) * TI-15.4 Stack, Full stack-based network solution, available as part of the CC13x0 SDK = GW16122 Development = Much of the following information is taken from TI documentation which is licensed under ​[http://creativecommons.org/licenses/by-nc-nd/4.0/ CC BY NC ND 4.0]. This wiki page aims to get users up and runnning with the GW16122 by collating relevant information contained by aforementioned TI sources along with our own annotations. The subsequent sections detail the information collected by Gateworks related to development with the GW16122. The GW16122 constitutes the following embedded systems: * !TiVa TM4C1294NCPDT MCU - Primarily used to program the CC1350; converts USB signals to UART * CC1350 MCU - The main MCU responsible for taking sensor readings A pre-made sensor node is provided by Texas Instruments: ​* [http://www.ti.com/tool/cc1350stk Simplelink CC1350 SensorTag Bluetooth and Sub-1GHz Long Range Wireless] Further information on the TI MCU's and tools utilized in GW16122 development can by found on the [http://processors.wiki.ti.com/ ​TI Wiki]. == Set Up == The following sections detail the steps necessary to set up a development environment for the GW16122. It is assumed that you already have a general understanding of Gateworks products and linux based OS operations. === Host Tools === Development can be done on either a Windows or Linux x86 based machine. Various references to Mac OS exist for some tools but were untested by Gateworks. You will need to create a TI account through their [http://my.ti.com/ ​registration page] before downloading some of the software listed here. After creating an account you will still need to sign an agreement on each download indicating its intended use. 1. JTAG USB dongle firmware for serial access and programming of Gateworks SBC ([http://svn.gateworks.com/jtag/windows/CDM20814_Setup.exe ​Direct download link]) 1. Remote terminal program, e.g. [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html ​PuTTY] for serial connection to Gateworks SBC 1. [http://www.ti.com/tool/CCSTUDIO Code Composer Studio] which is an IDE maintained by TI with preinstalled tools and libraries for software development on TI MCU's ([http://software-dl.ti.com/ccs/esd/CCSv7/CCS_7_3_0/exports/ccs_setup_7.3.0.00019.exe ​Direct download link]) * Don't forget to run the post install script {{{ccsv7/install_scripts/install_drivers.sh}}} * The executable for the IDE is located at {{{ccsv7/eclipse/ccstudio}}} 1. [http://www.ti.com/tool/download/SIMPLELINK-CC13X0-SDK Simple Link CC13X0 SDK] from TI's site is available on multiple platforms and contains prebuilt firmware images, example software, and documentation for working with the CC1350 1. [http://www.ti.com/tool/flash-programmer ​SmartRF Flash Programmer] for quickly installing prebuilt firmware without code composer studio and especially useful for quickly programming sensor nodes using a GUI ('''Windows only''') '''OR''' [http://www.ti.com/tool/uniflash ​Uniflash Programmer] which is a linux compatible alternative that includes both a GUI and command line interfaces Some quick commands for installing Uniflash properly on an Ubuntu system: {{{ #!bash # Get the installer (software version subject to change) wget --no-check-certificate http://software-dl.ti.com/ccs/esd/uniflash/uniflash_sl.4.2.1490.run # Link udev library for installer error sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0 # Run gui installer chmod +x uniflash_*.run ./uniflash_*.run }}} === Gateworks SBC Tools === The mechanism controlling the GW16122 will be a Gateworks SBC (testing was done with a GW5404-E.2). The [http://trac.gateworks.com/wiki/ventana/ubuntu ​Gateworks Ubuntu] image is recommended and the instructions will use Ubuntu specific commands. Some of the TI example projects make use of the Node.js framework in order to create a web interface to control what is referred to as the "collector" which in our case is the GW16122. Once Ubuntu has been installed and a network connection has been established, complete the following steps to finish initial target configuration: 1. Install necessary packages {{{#!bash # Always update your package manager information apt-get update apt-get upgrade # Install packages for GW16122 development apt-get install -y build-essential nodejs }}} 1. Acquire and install TI's 15.4 BLE stack source files from the [http://www.ti.com/tool/ti-15.4-stack-gateway-linux-sdk ​SDK] available online 1. Since TI apparently only offers the SDK installer in the form of an x86 binary (ventana CPU is arm architecture), you will need to download the installer on a compatible linux machine, run it, and repackage the files for transfer {{{#!bash # ON SEPARATE x86 CPU LINUX MACHINE: # enable execute permissions on binary downloaded from above link, your file name may be different chmod +x ti15.4stack_linux_x64_2_02_00_03.run # run the installer ./ti15.4stack_linux_x64_2_02_00_03.run # package the install files from target directory tar -czvf ti15-4.tar.gz ti/ }}} 1. Transfer and extract the sdk files to your Gateworks SBC filesystem using your method of choice {{{#!bash # pull installation file from host pc (networked method) wget http://remotehost/path/to/ti15-4.tar.gz # extract the files tar xzvf ./ti15-4.tar.gz }}} == Software == A quick breakdown of the software running on each piece of hardware in an example network utilizing the GW16122: * Gateworks SBC * Ubuntu Xenial Gateworks Image * node-js (if using web interface) * serial program (if using serial api) * GW16122 Mini-PCIe Card * !TiVa TM4C1294NCPDT MCU * boot_loader.bin - TI boot loader firmware * firmware.bin - XDS110 emulation firmware binary * CC1350 MCU * Co-Processor firmware (.out/.hex) - Either a prebuilt TI example or custom firmware designed with CCS The following subsections detail the various software layers developed by TI for use with the CC1350 which is the main MCU in the GW16122 as well as Code Composer Studio and other general notes. === TI-RTOS RF driver === The RF core has a dedicated driver called the TI-RTOS RF driver, which is used for all interaction with the RF core. If you do not wish to use the !EasyLink abstraction layer, there is also the option to do simple packet RX/TX using the TI-RTOS RF driver directly. A reference for the example lab located in the TI resource center, see [http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC13x0%20SDK%2FSimpleLink%20Academy%2FLabs%2FProprietary%20RF%2FBasic%20RX%20and%20TX ​SimpleLink Academy lab Proprietary RF - Basic RX and TX]. For more information, see the [http://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_1_00_00_13/docs/proprietary-rf/html/rf-core/rf-driver.html ​CC13X0 Proprietary RF User's Guide]. === !EasyLink API === !EasyLink is a simple abstraction layer on top of the RF Driver and is intended as a starting point for customers creating a proprietary Sub1-GHz protocol or application. For more information see the [http://processors.wiki.ti.com/index.php/SimpleLink-EasyLink ​EasyLink wiki page]. === TI 15.4-Stack === On the other hand, if you wish to create a full stack-based network solution, consider using the TI 15.4-Stack, available as part of the CC13x0 SDK. The example lab documentation to get started can be found at the [http://dev.ti.com/tirex/content/simplelink_academy_cc13x0sdk_1_12_01_16/modules/154-stack_01_sensor_collector/154-stack_01_sensor_collector.html ​TI 15.4-Stack Project Zero] page. Further documentation can be found in the [http://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_1_40_00_10/docs/ti154stack/ti154stack-users-guide/ti154stack/index.html ​TI 15.4 User's Guide]. === Texas Instruments Code Composer Studio === Code Composer Studio (CCS) is an IDE based on Eclipse and includes various libraries and software packages required to develop on many TI MCU's, including the CC1350 which is the primary component of the GW16122. Below are some various notes on using CCS. See the [http://processors.wiki.ti.com/index.php/CCSv6_Getting_Started_Guide ​Getting Started wiki] and the [http://processors.wiki.ti.com/index.php/Category:Code_Composer_Studio_v7 ​Main CCS wiki] for more information. ==== Resource Center ==== Click Menu item View -> Resource Explorer Expand software and view !SimpleLink CC13x0 SDK as well as Ti-RTOS for CC2650 Drill down to the area you would like to explore Find an example, then click the download button to download to desktop Then click the import to IDE to import the project ==== Building a Project ==== Once the project is imported, right click on the project title in the explorer window and click 'Build Project' and let it compile. You can also click the debug button to build the project and run it on the connected target. Once it is complete, a binaries folder will be created under the project. Most TI tools will use the .out file that is produced there to program with. Alternatively you can build projects via command line and avoid the entire IDE if you so desire. See the official TI wiki on [http://processors.wiki.ti.com/index.php/Projects_-_Command_Line_Build/Create ​Command Line Build/Create] for more information. A couple of additional notes when building via command line: Note that the executable for Linux CCS installations is named "eclipse" and not "eclipsec" Run with "-ccs.help" to see full list of options Use full path names for all command line arguments (environment variables useful here) === Serial Command API === The serial command API for the CC1350 is implemented in the form of standard AT+ commands that correlate to !EasyLink API functions. This serial control method there has an example project provided by the TI resource center. The web page can be found [http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC13x0%20SDK%2FSimpleLink%20Academy%2FLabs%2FProprietary%20RF%2FEasyLink%20Network%20Processor%20example&collapsetree= ​here]. You can easily test the AT to Easylink api commands by using two GW16122/SensorTag devices running the {{{rfEasyLinkNp}}} and the {{{rfEasyLinkRx}}} examples. ==== Serial Format ==== Parameters offer set and get functionality. * The format of a parameter read command to get the !TxPower parameter is: {{{ #!bash “ATP00?” }}} * The response to a read will be of the format shown below, depending on the parameter it will be hex or decimal: {{{ #!bash “-10” }}} * The format of an AT command to set the Frequency Parameter to 868MHz is: {{{#!bash “ATPFR=868000000” }}} * The response of a write will be of the format: {{{#!bash OK }}} The response to the "rx" "RX" (receive) command is of the format: * For ASCII Data Mode: {{{#!bash RX: Hello World OK For Binary Data Mode: RX: 2fbb1aa8ec84045fb0c3e5236cb8cc5b3c OK }}} * The response to the "rs" "RX" (reset) command is of the format: {{{#!bash For ASCII Data Mode: RESET:vxx.xx.xx Where vxx.xx.xx is the version number of the !EasyLink API }}} ==== Command List ==== The registers exposed for the !EasyLink API are: ||= Param =||= R/W =||= Description =||= Parameter(s) =|| || ST || R || Read The last !EasyLink status returned |---------------- {{{#!td !EasyLink status in {{{0x4B}}}: * hex
Success = 0000 * Config_Error = 0001 * Param_Error = 0002 * Mem_Error = 0003 * Cmd_Error = 0004 * Tx_Error = 0005 * Rx_Error = 0006 * Rx_Timeout = 0007 * Rx_Buffer_Error = 0008 * Busy_Error = 0009 * Aborted = 000a }}} |---------------- || AE || R/W || UART Echo Enable || 0 or 1 to enable/disable echo || || FR || R/W || !Read/Write frequency in kHz || Frequency in {{{0x1B}}} || || PW || R/W || !Read/Write tx power in dBm || Power in decimal between -10 to 14dBm. Note cfg changes are required for 14dBm output power || || BM || R/W || !Read/Write data mode for !Tx/Rx data |---------------- {{{#!td Mode in {{{0x1B}}} 0:ASCII 1:Binary }}} |---------------- || IE || R || Read IEEE address || None || || AS || R || Read address size in Bytes || None || || TS || R/W || !Read/Write Tx address || address {{{0x01}}}-{{{0x8B}}} || || RT || R || Read current radio time || None || || TY || R/W || !Read/Write Time Type |---------------- {{{#!td Time in {{{0x1B}}} 0:Absolute 1:Relative Time }}} |---------------- || TT || R/W || Absolute or relative (based on Time Type) radio time to Tx a packet || Absolute/relative time in units of 4MHz ticks in decimal OR 0 for immediate || || TR || R/W || Absolute or relative (based on Time Type) radio time to Rx a packet || Absolute/relative time in units of 4MHz ticks in decimal OR 0 for immediate || || RO || R/W || Relative time for Rx timeout || Relative time in units of 4MHz ticks in decimal OR 0 for never || || LA || R || Destination address of last Rx'ed message || None || || LT || R || Read absolute radio time of last Rx'ed message || None || || LR || R || Read RSSI of last Rx'ed message || None || || F0 || R/W || !Read/Write address filter 0 || address {{{0x01}}}-{{{0x8B}}} || || F1 || R/W || !Read/Write address filter 1 || address {{{0x01}}}-{{{0x8B}}} || || F2 || R/W || !Read/Write address filter 2 || address {{{0x01}}}-{{{0x8B}}} || || TM || R/W || !Read/Write test mode |---------------- {{{#!td Test mode in {{{0x1B}}}: 0:!None/Cancel 1:!Tone/Carrier Wave 2:Modulated Signal 3:PER Tx 4:PER Rx }}} |---------------- || PI || R/W || !Read/Write PER Tx bursts interval || {{{0x1B}}} time between PER bursts in units of ms || || PB || R/W || !Read/Write PER Tx burst size || {{{0x1B}}} Tx Burst Size in hex || || PP || R/W || !Read/Write number of PER !Tx/Rx packets || {{{0x1B}}} !Tx/Rx Packets in hex || || PL || R/W || !Read/Write PER !Tx/Rx packet length || {{{0x1B}}} !Tx/Rx Packet Length in hex || || GM00-03 || R/W || !Read/Write GPIO Mode || 0:1 GPIO Value input/output || || GV00-03 || R/W || !Read/Write GPIO Value || 0:1 GPIO Value || Command Responses Response for Register Write and Control Commands are formatted as: ||= Response =||= Description =|| || OK || Command or Register write successful || || Error 0001 || Command or register read/write failed due to bad formatting || || Error 0002 || Command or register read/write failed due to bad length || || Error 0003 || Command or register write failed due to a parameter Error || || Error 0004 || Command or register write failed due to a Memory Error || || Error 0005 || Command or register write failed due to Error From !EasyLink API (!EasyLink error is stored in Parameter "ST") || Sample app to interface with 16122 running this software (link to it under software example section) For further documentation on this serial implementation see the official [http://processors.wiki.ti.com/index.php/SimpleLink-EasyLink#rfEasyLinkNp_AT_Network_Processor_Example ​TI wiki page]. === General Notes === * The XDS110 USB debugger referenced by material related to the CC1350 or in CCS is equivalent to the !TiVa chip that's on the GW16122 * Make sure the GW16122 is properly into the miniPcie->USB adapter board otherwise it will come up as a usb device but fail to be recognized by the code composer software. You can check if its connected properly by opening the {{{.ccxml}}} file under the projects targetConfigs folder and hitting the "test connection" button. If multiple boards are connected at once you will * need to specify them by serial number. * The US frequency allows for a total of 129 channels to choose from, defined in {{{CONFIG_CHANNEL_MASK}}} You can prevent conflicts of sensor networks by either limiting the channels enabled on each collector/sensor, or by setting the PAN-ID to match on the devices belonging to each * network. * Beware of adding too many channels to your channel mask, for example, adding all of them took well over 20 minutes to complete the channel selection cycle and bring up the network. * Line of sight is extremely significant. Depending on the material, a few obstacles can drastically reduce your maximum range. * General RF information and specific information regarding antenna choice and performance can be found in this [http://www.ti.com/lit/an/swra161b/swra161b.pdf ​app note]. {{{#!comment == Programming the Tiva MCU == In the event of an unprogrammed or corrupted !TiVa MCU, you can flash firmware via USB connection. For the GW16122 this is done via a mini-PCIe to USB converter such as our GW16115. You will need to have installed the software detailed in the [wiki:expansion/gw16122#SetUp Set Up] section in order to continue. Since the !TiVa MCU functions as an XDS110 debug probe for the GW16122, you can use the default firmware included in the Code Composer Studio installation directory. To flash the bootloader and/or firmware via '''USB''': 1. Navigate to your Code Composer installation directory 1. Enter the XDS110 folder in ccs {{{#!bash cd ccsv7/ccs_base/common/uscif/xds110/ }}} 1. Connect a single GW16122 to your host machine via USB port. If more than one are connected the {{{xdsfu}}} program will operate on the first device it finds. {{{#!bash xdsdfu -e }}} If no device is found, check your connections and cables, if no usb device enumerates you will need to flash your firmware via JTAG. 1. Once a device is enumerated, flash the default XDS110 bootloader and firmware {{{#!bash xdsdfu -m xdsdfu -b bootloader.bin -r xdsdfu -m xdsdfu -f firmware.bin -r }}} Alternatively, to flash the bootloader and/or firmware via '''JTAG''': 1. Connect an external XDS110 debug probe to your host machine via USB, and to the GW16122 via 10-pin JTAG connector (designator J4) 1. Run the Uniflash gui application 1. Select target device of {{{TiVa > TM4C1294NCPDT}}} 1. Select connection of {{{XDS110 Debug Probe}}} 1. Click "Start" 1. Select the {{{boot_loader.bin}}} and {{{firmware.bin}}} files from the {{{ccsv7/ccs_base/common/uscif/xds110/}}} directory (click the plus sign to flash multiple files) and enter load addresses of {{{0x0000}}} and {{{0x4000}}} respectively 1. Click "Load Image" If you run into trouble using uniflash to load both the bootloader and firmware, just flash the bootloader and use the above USB method to flash the firmware. A properly flashed !TiVa MCU should now enumerate as a XDS110 debug probe which is required to program the connected CC1350. {{{#!bash # lsusb entry: Bus XXX Device XXX: ID 0451:bef3 Texas Instruments, Inc. # xdsdfu -e entry: VID: 0x0451 PID: 0xbef3 Device Name: XDS110 Embed with CMSIS-DAP Version: 2.3.0.9 Manufacturer: Texas Instruments }}} More information can be found on the {{{xdsdfu}}} tool via the {{{ReadMe.txt}}} in the same directory. Also refer to the XDS110 User Guide linked in the [wiki:expansion/gw16122#References References] section. }}} == Programming the CC1350 == The CC1350 of the GW16122 can be programmed a number of ways depending on your host machine. Gateworks has tested both Windows (SmartRF Flash Programmer) and Linux (Uniflash) tools but specific instructions will be provided from the Linux perspective. You will need to have installed the software detailed in the [wiki:expansion/gw16122#SetUp Set Up] section in order to continue. The Uniflash tool is linux compatible and has both a gui and command line interface. The gui program has an autodetect feature and is somewhat easier to use but the command line tool has the same functionality and is better suited for repeated tasks with constant configurations. * Note that there doesn't appear to be a way to update the firmware on a running ARM based target. All of the methods we used to program the !TiVa and CC1350 MCU's from a x86 host are not compatible with an ARM based system. This means that users will not be able to update firmware on running boards. === GUI Approach === 1. Connect a single GW16122 to the host machine via mini-PCIe to USB adapter. 1. Open the "Uniflash" application through a gui file manager from the uniflash_4.2 install directory, or via command line: {{{#!bash ./uniflash_4.2/node-webkit/nw }}} 1. Select target device of CC1350F128 1. Select connection of Texas Instruments XDS110 USB Debug Probe 1. Click the "Start" button In the Program tab, select the firmware file you wish to load. This is typically a .out file created via a Code Composer Studio Project and can be found in your workspace directory (default {{{~/workspace_v7/}}}) 1. Click the "Load Image" and "Verify Image" buttons and see the text console output on the bottom of the window for a green success message It should also be mentioned that you can program your GW16122 directly from the Code Composer Studio IDE by creating a proper target configuration and then selecting "Debug". Most of the TI example projects will detail this procedure. At this point you may want to power cycle your device. === Command Line Approach === 1. Navigate to your uniflash install directory {{{#!bash cd uniflash_4.2 }}} 1. Run the installer providing a configuration and .out file as arguments, for example: {{{#!bash ./dslite.sh --config=CC1350F128.ccxml ~/workspace_v7/collector_cc1350lp/collector_cc1350lp/collector_cc1350lp.out }}} The {{{CC1350F128.ccxml}}} file can be created via the uniflash gui or Code Composer Studio IDE. The contents of the file are provided in the collapsible text below for convenience. [[CollapsibleStart(CC1350F128.ccxml)]] {{{#!xml }}} [[CollapsibleEnd]] == References == * [http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC13x0%20SDK ​CC1350 Wiki] * [http://dev.ti.com/tirex/content/simplelink_academy_cc13x0sdk_1_12_01_16/modules/prop_04_cc1350lpdm/resources/CC1350LaunchPad_BLE_All_v1_00.hex ​CC1350 Bluetooth Software for use with iPhone App] * [http://dev.ti.com/tirex/content/tirtos_cc13xx_cc26xx_2_20_00_06/resources/cc1350LaunchPad/project0/landing_page_index.html ​Launch Pad Landing Page on Ti] * [http://processors.wiki.ti.com/index.php/Contiki-6LOWPAN ​Ti Information regarding Contiki] * [http://www.ti.com/lit/ug/sprui94/sprui94.pdf ​XDS110 User Guide] * [http://dev.ti.com/tirex/content/simplelink_academy_cc13x0sdk_1_13_01_05/modules/154-stack_03_linux_project_0/154-stack_03_linux_project_0.html ​TI 15.4-Stack - Linux Gateway Project Zero App Note] * [http://e2e.ti.com/support/wireless_connectivity/proprietary_sub_1_ghz_simpliciti/ ​TI Sub-1GHz E2E Forum] = CC1350STK Notes = The CC1350STK is a sensor node sold and designed by Ti. * Button 1 is the button on the edge furthest away from the JTAG headers. This is labeled as the 'Power' button. * Button 2 is the button on the same edge as the JTAG headers. This is a 'user' button. * There is no green LED on CC1350STK. There is only Green LED on CC2650STK and that function is for CC2650STK. * Hex file to erase CC1350SensorTag_ExtFlashErase.hex * Hex file for default factory image: CC1350SensorTag_BLE_All_v1_33.hex * It's not possible to set the STK in factory restore by pushing buttons. * The Ti Bluetooth iPhone app is missing the 1Ghz factory image in the list of available firmware. * Files are placed here (typical installation path): *C:\Program Files (x86)\Texas Instruments\SmartRF Tools\BLE Device Monitor\firmware\cc1350\sensortag * rfWsnDmNodeOad_US_CC1350STK_TI_CC1350F128-v1_06.hex