Changes between Initial Version and Version 1 of expansion/gw16122

10/30/2017 05:45:43 PM (5 years ago)
Bobby Jones

Raw text from backup


  • expansion/gw16122

    v1 v1  
     1GW16122 - Mini-PCIe Radio for Internet of Things - IoT
     3This card uses the Texas Instruments ​CC1350 MCU.
     5Features Include:
     7Open Source 802.15.4g
     8Lowest Power
     9Sub 1GHz
     105.4 mA Radio RX current
     1113.4 mA Radio TX @ +10 dBm
     1224.4 mA Radio TX @ +14 dBm
     13Longest Range
     14Excellent Receiver Sensitivity –124 dBm Using Long-Range Mode, –110 dBm at 50 kbps (Sub-1 GHz), –87 dBm at Bluetooth low energy
     15Programmable Output Power up to +14 dBm (Sub-1 GHz) and +9 dBm at 2.4 GHz (Bluetooth low energy)
     16Small form factor (7x7mm chip size)
     17Low Bandwidth applications - Sensor Data, etc
     18Minimal interference - Narrow Bandwidth
     19Can perform Sigfox TX if required, no RX
     20This features two RF Channels:
     22Sub 1GHz (USA 915MHz) - Used for long distance communication
     23Bluetooth 4.2 Low Energy (2.4GHz) - Used for programming sensor nodes
     24For more information see the TI ​CC1350 Product Page.
     26RF Network / Infrastructure
     28The 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.
     30Network Architecture
     32The 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.
     34Sensor Limits
     36Number of connected users:
     38Support for 50 nodes in network is for the MAC-CoProcessor configuration, where the network employs full MAC level security (AES-128).
     39The 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).
     43BLE - Bluetooth Low Engery
     44BLE-ADV - Bluetooth Low Energy Advertising
     45OAD - Over the Air Download
     46802.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.
     47Frequency: North America: 902–928 MHz, up to 30 channels
     48RTOS - Real Time Operating System
     496LoWPAN - Low Power Personal Area Network, allowing for IPv6 packets.
     50LRM - Long Range Mode
     51PA/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 ​Ti CC1190 RF Booster / Front End
     52BLE Modes - advertising, scanning, master, slave. Read more ​here
     53TI-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.
     54TI-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).
     55LPWAN - Low‑Power Wide‑Area
     56Contiki - Open Source Operating System
     57GW16122 Development
     58Much of the following information is taken from TI documentation which is licensed under ​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.
     60The subsequent sections detail the information collected by Gateworks related to development with the GW16122. The GW16122 constitutes the following embedded systems:
     62TiVa TM4C1294NCPDT MCU - Primarily used to program the CC1350; converts USB signals to UART
     63CC1350 MCU - The main MCU responsible for taking sensor readings
     64A pre-made sensor node is provided by Texas Instruments:
     66​Simplelink CC1350 SensorTag Bluetooth and Sub-1GHz Long Range Wireless
     67Further information on the TI MCU's and tools utilized in GW16122 development can by found on the ​TI Wiki.
     69Set Up
     71The 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.
     73Host Tools
     75Development 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 ​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.
     77JTAG USB dongle firmware for serial access and programming of Gateworks SBC (​Direct download link)
     78Remote terminal program, e.g. ​PuTTY for serial connection to Gateworks SBC
     79​Code Composer Studio which is an IDE maintained by TI with preinstalled tools and libraries for software development on TI MCU's (​Direct download link)
     80Don't forget to run the post install script ccsv7/install_scripts/
     81The executable for the IDE is located at ccsv7/eclipse/ccstudio
     82​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
     83​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)
     86​Uniflash Programmer which is a linux compatible alternative that includes both a GUI and command line interfaces
     88Some quick commands for installing Uniflash properly on an Ubuntu system:
     90# Get the installer (software version subject to change)
     91wget --no-check-certificate
     92# Link udev library for installer error
     93sudo ln -sf /lib/x86_64-linux-gnu/ /lib/x86_64-linux-gnu/
     94# Run gui installer
     95chmod +x uniflash_*.run
     97Gateworks SBC Tools
     99The mechanism controlling the GW16122 will be a Gateworks SBC (testing was done with a GW5404-E.2). The ​Gateworks Ubuntu image is recommended and the instructions will use Ubuntu specific commands.
     101Some 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.
     103Once Ubuntu has been installed and a network connection has been established, complete the following steps to finish initial target configuration:
     105Install necessary packages
     106# Always update your package manager information
     107apt-get update
     108apt-get upgrade
     109# Install packages for GW16122 development
     110apt-get install -y build-essential nodejs
     111Acquire and install TI's 15.4 BLE stack source files from the ​SDK available online
     112Since 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
     114# enable execute permissions on binary downloaded from above link, your file name may be different
     115chmod +x
     116# run the installer
     118# package the install files from target directory
     119tar -czvf ti15-4.tar.gz ti/
     120Transfer and extract the sdk files to your Gateworks SBC filesystem using your method of choice
     121# pull installation file from host pc (networked method)
     122wget http://remotehost/path/to/ti15-4.tar.gz
     123# extract the files
     124tar xzvf ./ti15-4.tar.gz
     127A quick breakdown of the software running on each piece of hardware in an example network utilizing the GW16122:
     129Gateworks SBC
     130Ubuntu Xenial Gateworks Image
     131node-js (if using web interface)
     132serial program (if using serial api)
     133GW16122 Mini-PCIe Card
     134TiVa TM4C1294NCPDT MCU
     135boot_loader.bin - TI boot loader firmware
     136firmware.bin - XDS110 emulation firmware binary
     137CC1350 MCU
     138Co-Processor firmware (.out/.hex) - Either a prebuilt TI example or custom firmware designed with CCS
     139The 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.
     141TI-RTOS RF driver
     143The 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.
     145A reference for the example lab located in the TI resource center, see ​SimpleLink Academy lab Proprietary RF - Basic RX and TX.
     147For more information, see the ​CC13X0 Proprietary RF User's Guide.
     149EasyLink API
     151EasyLink 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.
     153For more information see the ​EasyLink wiki page.
     155TI 15.4-Stack
     157On 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.
     159The example lab documentation to get started can be found at the ​TI 15.4-Stack Project Zero page.
     161Further documentation can be found in the ​TI 15.4 User's Guide.
     163Texas Instruments Code Composer Studio
     165Code 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.
     167Below are some various notes on using CCS. See the ​Getting Started wiki and the ​Main CCS wiki for more information.
     169Resource Center
     171Click Menu item View -> Resource Explorer
     172Expand software and view SimpleLink CC13x0 SDK as well as Ti-RTOS for CC2650
     173Drill down to the area you would like to explore
     174Find an example, then click the download button to download to desktop
     175Then click the import to IDE to import the project
     176Building a Project
     178Once 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.
     180Alternatively you can build projects via command line and avoid the entire IDE if you so desire. See the official TI wiki on ​Command Line Build/Create for more information.
     182A couple of additional notes when building via command line:
     184Note that the executable for Linux CCS installations is named "eclipse" and not "eclipsec"
     185Run with "" to see full list of options
     186Use full path names for all command line arguments (environment variables useful here)
     187Serial Command API
     189The 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 ​here.
     191You can easily test the AT to Easylink api commands by using two GW16122/SensorTag devices running the rfEasyLinkNp and the rfEasyLinkRx examples.
     193Serial Format
     195Parameters offer set and get functionality.
     197The format of a parameter read command to get the TxPower parameter is:
     198 “ATP00?”
     199The response to a read will be of the format shown below, depending on the parameter it will be hex or decimal:
     200 “-10”
     201The format of an AT command to set the Frequency Parameter to 868MHz is:
     202 “ATPFR=868000000”
     203The response of a write will be of the format:
     205The response to the "rx" "RX" (receive) command is of the format:
     207For ASCII Data Mode:
     208RX: Hello World<CR>
     210For Binary Data Mode:
     211RX: 2fbb1aa8ec84045fb0c3e5236cb8cc5b3c<CR>
     213The response to the "rs" "RX" (reset) command is of the format:
     215For ASCII Data Mode:
     217Where vxx.xx.xx is the version number of the EasyLink API
     218Command List
     220The registers exposed for the EasyLink API are:
     222Param   R/W     Description     Parameter(s)
     223ST      R       Read The last EasyLink status returned 
     224EasyLink status in 0x4B:
     226hex<br> Success = 0000
     227Config_Error = 0001
     228Param_Error = 0002
     229Mem_Error = 0003
     230Cmd_Error = 0004
     231Tx_Error = 0005
     232Rx_Error = 0006
     233Rx_Timeout = 0007
     234Rx_Buffer_Error = 0008
     235Busy_Error = 0009
     236Aborted = 000a
     237AE      R/W     UART Echo Enable        0 or 1 to enable/disable echo
     238FR      R/W     Read/Write frequency in kHz     Frequency in 0x1B
     239PW      R/W     Read/Write tx power in dBm      Power in decimal between -10 to 14dBm. Note cfg changes are required for 14dBm output power
     240BM      R/W     Read/Write data mode for Tx/Rx data     
     241Mode in 0x1B
     245IE      R       Read IEEE address       None
     246AS      R       Read address size in Bytes      None
     247TS      R/W     Read/Write Tx address   address 0x01-0x8B
     248RT      R       Read current radio time None
     249TY      R/W     Read/Write Time Type   
     250Time in 0x1B
     2531:Relative Time
     254TT      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
     255TR      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
     256RO      R/W     Relative time for Rx timeout    Relative time in units of 4MHz ticks in decimal OR 0 for never
     257LA      R       Destination address of last Rx'ed message       None
     258LT      R       Read absolute radio time of last Rx'ed message  None
     259LR      R       Read RSSI of last Rx'ed message None
     260F0      R/W     Read/Write address filter 0     address 0x01-0x8B
     261F1      R/W     Read/Write address filter 1     address 0x01-0x8B
     262F2      R/W     Read/Write address filter 2     address 0x01-0x8B
     263TM      R/W     Read/Write test mode   
     264Test mode in 0x1B:
     2671:Tone/Carrier Wave
     2682:Modulated Signal
     2693:PER Tx
     2704:PER Rx
     271PI      R/W     Read/Write PER Tx bursts interval       0x1B time between PER bursts in units of ms
     272PB      R/W     Read/Write PER Tx burst size    0x1B Tx Burst Size in hex
     273PP      R/W     Read/Write number of PER Tx/Rx packets  0x1B Tx/Rx Packets in hex
     274PL      R/W     Read/Write PER Tx/Rx packet length      0x1B Tx/Rx Packet Length in hex
     275GM00-03 R/W     Read/Write GPIO Mode    0:1 GPIO Value input/output
     276GV00-03 R/W     Read/Write GPIO Value   0:1 GPIO Value
     277Command Responses Response for Register Write and Control Commands are formatted as:
     279Response        Description
     280OK<CR>  Command or Register write successful
     281Error 0001<CR>  Command or register read/write failed due to bad formatting
     282Error 0002<CR>  Command or register read/write failed due to bad length
     283Error 0003<CR>  Command or register write failed due to a parameter Error
     284Error 0004<CR>  Command or register write failed due to a Memory Error
     285Error 0005<CR>  Command or register write failed due to Error From EasyLink API (EasyLink error is stored in Parameter "ST")
     286Sample app to interface with 16122 running this software (link to it under software example section)
     288For further documentation on this serial implementation see the official ​TI wiki page.
     290General Notes
     292The XDS110 USB debugger referenced by material related to the CC1350 or in CCS is equivalent to the TiVa chip that's on the GW16122
     293Make 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.
     294The US frequency allows for a total of 129 channels to choose from, defined in CONFIG_CHANNEL_MASK
     295You 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.
     296Beware 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.
     297Line of sight is extremely significant. Depending on the material, a few obstacles can drastically reduce your maximum range.
     298General RF information and specific information regarding antenna choice and performance can be found in this ​app note.
     299Programming the Tiva MCU
     301In 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.
     303You will need to have installed the software detailed in the Set Up section in order to continue.
     305Since 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.
     307To flash the bootloader and/or firmware via USB:
     309Navigate to your Code Composer installation directory
     310Enter the XDS110 folder in ccs
     311cd ccsv7/ccs_base/common/uscif/xds110/
     312Connect 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.
     313xdsdfu -e
     314If no device is found, check your connections and cables, if no usb device enumerates you will need to flash your firmware via JTAG.
     315Once a device is enumerated, flash the default XDS110 bootloader and firmware
     316xdsdfu -m
     317xdsdfu -b bootloader.bin -r
     318xdsdfu -m
     319xdsdfu -f firmware.bin -r
     320Alternatively, to flash the bootloader and/or firmware via JTAG:
     322Connect an external XDS110 debug probe to your host machine via USB, and to the GW16122 via 10-pin JTAG connector (designator J4)
     323Run the Uniflash gui application
     324Select target device of TiVa > TM4C1294NCPDT
     325Select connection of XDS110 Debug Probe
     326Click "Start"
     327Select 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
     328Click "Load Image"
     329If 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.
     331A properly flashed TiVa MCU should now enumerate as a XDS110 debug probe which is required to program the connected CC1350.
     333# lsusb entry:
     334Bus XXX Device XXX: ID 0451:bef3 Texas Instruments, Inc.
     336# xdsdfu -e entry:
     337VID: 0x0451    PID: 0xbef3
     338Device Name:   XDS110 Embed with CMSIS-DAP
     340Manufacturer:  Texas Instruments
     341More 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 References section.
     343Programming the CC1350
     345The 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.
     347You will need to have installed the software detailed in the Set Up section in order to continue.
     349The 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.
     351Note 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.
     352GUI Approach
     354Connect a single GW16122 to the host machine via mini-PCIe to USB adapter.
     355Open the "Uniflash" application through a gui file manager from the uniflash_4.2 install directory, or via command line:
     357Select target device of CC1350F128
     358Select connection of Texas Instruments XDS110 USB Debug Probe
     359Click the "Start" button
     360In 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/)
     361Click the "Load Image" and "Verify Image" buttons and see the text console output on the bottom of the window for a green success message
     362It 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.
     364At this point you may want to power cycle your device.
     366Command Line Approach
     368Navigate to your uniflash install directory
     369cd uniflash_4.2
     370Run the installer providing a configuration and .out file as arguments, for example:
     371./ --config=CC1350F128.ccxml ~/workspace_v7/collector_cc1350lp/collector_cc1350lp/collector_cc1350lp.out
     372The 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.
     376<?xml version="1.0" encoding="UTF-8" standalone="no"?>
     377<configurations XML_version="1.2" id="configurations_0">
     378<configuration XML_version="1.2" id="configuration_0">
     379        <instance XML_version="1.2" desc="Texas Instruments XDS110 USB Debug Probe" href="connections/TIXDS110_Connection.xml" id="Texas Instruments XDS110 USB Debug Probe" xml="TIXDS110_Connection.xml" xmlpath="connections"/>
     380        <connection XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe">
     382                           <instance XML_version="1.2" href="drivers/tixds510icepick_c.xml" id="drivers" xml="tixds510icepick_c.xml" xmlpath="drivers"/>
     384                           <instance XML_version="1.2" href="drivers/tixds510cs_dap.xml" id="drivers" xml="tixds510cs_dap.xml" xmlpath="drivers"/>
     386                           <instance XML_version="1.2" href="drivers/tixds510cortexM.xml" id="drivers" xml="tixds510cortexM.xml" xmlpath="drivers"/>
     389                  <property Type="choicelist" Value="4" id="SWD Mode Settings">
     390            <choice Name="cJTAG (1149.7) 2-pin advanced modes" value="enable">
     391                <property Type="choicelist" Value="1" id="XDS110 Aux Port"/>
     392            </choice>
     393        </property>
     395                  <property Type="choicelist" Value="1" id="Power Selection">
     396            <choice Name="Probe supplied power" value="1">
     397                <property Type="stringfield" Value="3.3" id="Voltage Level"/>
     398            </choice>
     399            <choice Name="Target supplied power" value="0">
     400                <property Type="choicelist" Value="1" id="Voltage Selection">
     401                    <choice Name="User specified value" value="1">
     402                        <property Type="stringfield" Value="3.3" id="Voltage Level"/>
     403                    </choice>
     404                </property>
     405            </choice>
     406        </property>
     408                  <property Type="choicelist" Value="0" id="JTAG Signal Isolation"/>
     410            <platform XML_version="1.2" id="platform_0">
     411                <instance XML_version="1.2" desc="CC1350F128" href="devices/cc1350f128.xml" id="CC1350F128" xml="cc1350f128.xml" xmlpath="devices"/>
     412            </platform>
     413        </connection>
     414    </configuration>
     418​CC1350 Wiki
     419​CC1350 Bluetooth Software for use with iPhone App
     420​Launch Pad Landing Page on Ti
     421​Ti Information regarding Contiki
     422​XDS110 User Guide
     423​TI 15.4-Stack - Linux Gateway Project Zero App Note
     424​TI Sub-1GHz E2E Forum