Changes between Version 14 and Version 15 of cc135x


Ignore:
Timestamp:
08/08/2020 12:45:09 AM (4 years ago)
Author:
Cale Collins
Comment:

added contiki-ng example

Legend:

Unmodified
Added
Removed
Modified
  • cc135x

    v14 v15  
    790790References:
    791791 * Ti Thingsquare [http://www.ti.com/ww/en/internet_of_things/Thingsquare-for-TI-IoT-development-kits.html]
     792
     793== Contiki-ng
     794
     795Contiki-NG is an open-source, cross-platform operating system for Next-Generation IoT devices. It focuses on dependable (secure and reliable) low-power communication and standard protocols, such as IPv6/6LoWPAN, 6TiSCH, RPL, and CoAP. Contiki-NG comes with extensive documentation, tutorials, a roadmap, release cycle, and well-defined development flow for smooth integration of community contributions.
     796
     797=== Installing the Contiki-ng Docker image
     798
     799Compiling Contiki-ng examples is made easy through use of their docker container, this saves manually configuring the build environment.  Even if you're unfamiliar with docker this procedure is quite simple.  
     800
     801Official Contiki-ng wiki instructions:
     802https://github.com/contiki-ng/contiki-ng/wiki/Docker
     803
     804* Installing Docker can be done using apt:{{{
     805sudo apt-get install docker-ce
     806}}}
     807Official instructions can be found here: https://docs.docker.com/engine/install/ubuntu/
     808
     809* Once Docker is installed add your user to the docker group:
     810{{{
     811sudo usermod -aG docker <your-user>     
     812}}}
     813After log out and log back in.  Missing this step will result in errors moving forward.  
     814
     815* Download the Contiki-ng Docker image:
     816{{{
     817docker pull contiker/contiki-ng
     818}}}
     819
     820=== Download and link the Contiki-ng source to the container
     821
     822Clone the source code from the Contiki-ng github repository:
     823{{{#!bash
     824git clone https://github.com/contiki-ng/contiki-ng.git
     825cd contiki-ng
     826git submodule update --init --recursive
     827}}}
     828
     829Create an alias to start docker with required arguments and source code bound:  
     830{{{
     831export CNG_PATH=<absolute-path-to-your-contiki-ng>
     832alias contiker="docker run --privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 --mount type=bind,source=$CNG_PATH,destination=/home/user/contiki-ng -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/bus/usb:/dev/bus/usb -ti contiker/contiki-ng"
     833}}}
     834
     835=== Building the example:
     836
     837Launch the container by typing the {{{contiker}}}, this will use the alias that was previously created.  You will be presented with a new shell, with the $PWD being "/home/user/contiki-ng".
     838
     839Change directory to the example you would like to build, in this case "hello world":
     840{{{
     841cd examples/hello-world/
     842}}}
     843
     844If you would like to see a list of Simplelink targets:
     845{{{
     846make TARGET=simplelink boards
     847}}}
     848
     849To build for GW16122:
     850{{{
     851make TARGET=simplelink BOARD=launchpad/cc1352p-2
     852}}}
     853
     854The build artifacts are located in this folder:
     855{{{
     856/home/user/contiki-ng/examples/hello-world/build/simplelink/launchpad/cc1352p-2/
     857}}}
     858
     859If you would like to copy them out of your running container start a different shell, "cd" to your destination directory and execute the following command:
     860{{{
     861docker cp <container $HOSTNAME>:/home/user/contiki-ng/examples/hello-world/build/simplelink/launchpad/cc1352p-2/<desired file> .
     862}}}
     863An easier way to gain access to the files is to type "exit" within the container, then navigate to the "contiki-ng/examples/hello-world/build/simplelink/launchpad/cc1352p-2/" directory on your host machine.  
     864
     865Follow the instructions in the [wiki:/cc135x#Programming Programming] section to flash this firmware to your board.
     866
     867==== Using the Hello World example.
     868
     869Connect your programmed GW16122 to a Gateworks SBC. This will create a /dev/tty interface, in most cases /dev/ttyUSB0.
     870
     871To view the output from the example:
     872{{{
     873stty -F /dev/ttyUSB0 115200
     874cat /dev/ttyUSB0 &
     875}}}
     876** Example of the expected output: **
     877{{{
     878INFO: Main      ] Starting Contiki-NG
     879[INFO: Main      ] - Routing: RPL Lite
     880[INFO: Main      ] - Net: sicslowpan
     881[INFO: Main      ] - MAC: CSMA
     882[INFO: Main      ] - 802.15.4 PANID: 0xabcd
     883[INFO: Main      ] - 802.15.4 Default channel: 26
     884[INFO: Main      ] Node ID: 1813
     885[INFO: Main      ] Link-layer address: 0012.4b00.1cc1.0715
     886[INFO: Main      ] Tentative link-local IPv6 address: fe80::212:4b00:1cc1:715
     887[INFO: CC13xx/CC26xx] Operating frequency on Sub-1 GHz
     888[INFO: CC13xx/CC26xx] RF: Channel 26
     889[INFO: CC13xx/CC26xx] Node ID: 1813
     890Hello, world
     891Hello, world
     892Hello, world
     893Hello, world
     894[INFO: Main      ] Starting Contiki-NG
     895[INFO: Main      ] - Routing: RPL Lite
     896[INFO: Main      ] - Net: sicslowpan
     897[INFO: Main      ] - MAC: CSMA
     898[INFO: Main      ] - 802.15.4 PANID: 0xabcd
     899[INFO: Main      ] - 802.15.4 Default channel: 26
     900[INFO: Main      ] Node ID: 1813
     901[INFO: Main      ] Link-layer address: 0012.4b00.1cc1.0715
     902[INFO: Main      ] Tentative link-local IPv6 address: fe80::212:4b00:1cc1:715
     903[INFO: CC13xx/CC26xx] Operating frequency on Sub-1 GHz
     904[INFO: CC13xx/CC26xx] RF: Channel 26
     905[INFO: CC13xx/CC26xx] Node ID: 1813
     906Hello, world
     907Hello, world
     908Hello, world
     909Hello, world
     910}}}