ST Contiki6LP User manual

Version 1.3 (December 10, 2018)
Quick Start Guide
Contiki OS and 6LoWPAN sub-1GHz RF communication software
expansion for STM32 Cube (Contiki6LP)

Quick Start Guide Contents 2
Contiki6LP: Contiki OS/6LoWPAN and sub-1GHz RF communication
Hardware and Software overview
Setup & Demo Examples
Documents & Related Resources
STM32 Open Development Environment: Overview
12/18/2018

Sub-1 GHz RF expansion boards based on SPIRIT1
Hardware overview 3
SPSGRF-868 or
SPSGRF-915 (*)
Hardware description
•The X-NUCLEO-IDS01A4, X-NUCLEO-
IDS01A5 are evaluation boards based on the
SPIRIT1 RF modules SPSGRF-868 and
SPSGRF-915
•The SPIRIT1 module communicates with the
STM32 Nucleo developer board host
microcontroller though an SPI link available on
theArduino UNO R3 connector.
EEPROM
Arduino UNO R3 connector
Key products on board
SPSGRF
SPIRIT1 (Low data-rate, low-power sub-1GHz
transceiver) module
M95640-RMC6TG
64-Kbit serial SPI bus EEPROM
Latest info available at www.st.com
X-NUCLEO-IDS01A4
X-NUCLEO-IDS01A5
(*) Identification of the operating frequency of the X-NUCLEO-
IDS01Ax (x=4 or 5) is performed through two resistors (R14 and R15).

Sub-1 GHz 868 MHz RF expansion board based on S2-LP
Hardware overview 4
S2-LP
Hardware description
•The X-NUCLEO-S2868A1 evaluation board is based on the
S2-LP sub-1 GHz ultra-low power low data-rate transceiver.
•The S2-LP IC communicates with the STM32 Nucleo
developer board host microcontroller though an SPI link
available on the Arduino UNO R3 connector.
EEPROM
Arduino UNO R3 connector
Key products on board
S2LP
Ultra-low power, high performance, sub-1GHz transceiver
M95640-RMN6TP
64-Kbit serial SPI bus EEPROM
Latest info available at www.st.com
X-NUCLEO-S2868A1
Key features
•Programmable RF output power up to +16 dBm
•Modulation schemes: 2-FSK, 2-GFSK, 4-FSK, 4-GFSK, OOK
and ASK
•Air data rate from 0.1 to 500 kbps
•Ultra-low power consumption: 7 mA RX and 10 mA TX at +10
dBm
•IEEE 802.15.4g hardware packet support with whitening, FEC,
CRC and dual SYNC word detection
•RX and TX 128 byte FIFO buffers

Contiki OS/6LoWPAN and sub-1GHz RF communication
Software Overview 5
Contiki6LP Software Description
Contiki6LP is a library implemented as a STM32Cube
middleware ready to be integrated in projects based on
STM32Cube and X-CUBE-SUBG1 expansion software. The
expansion software is built on STM32Cube software
technology for portability across different STM32
microcontrollers. The software includes examples for sending
messages via UDP over 6LoWPAN, using the SPIRIT1/S2-LP
sub-1GHz radio transceiver.
Key features
•Middleware library with Contiki OS and Contiki
6LoWPAN protocol stack 3.x
•Support for mesh networking technology by the means
of the standard RPL protocol
•Built-in support for STM32 L1 and F4 platforms
•Example applications including UPD sender and
receiver, and border router
•Examples available for NUCLEO-F401RE and
NUCLEO-L152RE
•Easy portability across different MCU families, thanks to
STM32Cube
•Free, user-friendly license terms
Overall Software Architecture
X-CUBE-SUBG1
Latest info available at www.st.com
12/18/2018

Quick Start Guide Contents 6
Contiki6LP: Contiki OS/6LoWPAN and sub-1GHz RF communication
Hardware and Software overview
Setup & Demo Examples
Documents & Related Resources
STM32 Open Development Environment: Overview
12/18/2018

Setup & Demo Examples
HW prerequisites
•STM32 Nucleo development board
NUCLEO-L152RE or NUCLEO-F401RE
•Sub-1GHz RF expansion board for STM32 Nucleo based on the Spirit 1 (X-NUCLEO-
IDS01A4) or S2LP-868 module (X-NUCLEO-S2868A1)
•Windows/Linux PC
•mini USB cable
NUCLEO-L152RE
X-NUCLEO-S2868A1
mini USB cable
X-NUCLEO-IDS01A4
NUCLEO-F401RE
12/18/2018
7

Setup & Demo Examples
SW prerequisites
•X-CUBE-SUBG1 package
•Download and extract the X-CUBE-SUBG1 package, version 3.0.0 or higher
•A toolchain to build the firmware
•The Contiki6LP library has been developed and tested with
•IAR Embedded Workbench forARM® (EWARM) toolchain + ST-Link
•RealView Microcontroller Development Kit (MDK-ARM) toolchain + ST-LINK
•System Workbench for STM32 (SW4STM32) + ST-LINK (*)
•Serial line monitor e.g. Termite (Windows), or Minicom (Linux)
(*) For Linux users: System Workbench for STM32 (SW4STM32) is the only supported IDE
12/18/2018
8

Demo Execution Using SPSGRF
(SPIRIT1)
12/18/2018

Contiki6LP
Start coding in just a few minutes with Contiki6LP 10
Download and unpack
X-CUBE-SUBG1
Go to www.st.com/x-nucleo
Open project example
e.g. Udp-sender
1
2
3
4
5
Select X-NUCLEO-IDS01Ax
6Select the SPIRIT1 radio configuration And
then build and flash the application code.
Download & install STM32
Nucleo ST-LINK/V2-1 USB driver
Documentation
Drivers and BSP
Contiki OS and 6LoWPAN stack
Application examples
X-CUBE-SUBG1 package
12/18/2018

Demo Overview –UDP Sender and Receiver
6LoWPAN Udp-receiver node
NUCLEO-L152RE or NUCLEO-F401RE
X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5
Host PC
with a terminal
Utility
6LoWPAN Udp-sender node
NUCLEO-L152RE or NUCLEO-F401RE
X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5
UDP
Messages
USB1
USB2
12/18/2018
11

UDP Sender and Receiver examples in a few steps (1/2)
Download and extract X-CUBE-SUBG1 1
Compile the firmware for the UDP Receiver node:
Select the “Udp-receiver” application and build the
Project using a supported IDE. Alternatively you can
use a pre-built binary that is provided for running this
application with the selected STM32 Nucleo board
2
3
Connect the STM32 Nucleo based kit
acting as a “UDP Receiver” to a
PC USB slot and program the device
Copy the binary file
(e.g. drag & drop) to the USB mass storage
corresponding to the STM32 Nucleo board
4
Compile the firmware for the UDP sender node:
Select the “Udp-sender” application and build the
Project using a supported IDE. Alternatively you can
use a pre-built binary that is provided for running
this application with the selected STM32 Nucleo
board
5
copy the file
(e.g. drag & drop) to the USB mass storage
corresponding to the STM32 Nucleo board
Connect the STM32 Nucleo based kit
acting as a “UDP Sender” to a
PC USB slot and program the device
12/18/2018
12

UDP Sender and Receiver
examples in a few steps (2/2)
Launch the terminal application
and set the UART port to
115200 bps, 8 bit, No Parity, 1
stop bit
Select the device corresponding
to the UDP sender node (e.g.
on a Linux host, it will be a
ttyACMx device type)
The terminal should be printing something like
8If everything has been done correctly,
the output in the terminal should now be
something similar to this:
Repeat step 6-8 for the
project Udp-receiver
(remember to open a new
terminal window):
The received UDP
messages are shown
67
9
Udp-receiver window Udp-sender window
Udp-sender window
12/18/2018
13

Demo Overview –Border Router Example
6LoWPAN Border Router
STM32 Nucleo board with the
X-NUCLEO-IDS01A4/5
Wireless Node
STM32 Nucleo board with the
X-NUCLEO-IDS01A4/5
IPv6 Host PC
IPv6/6LoWPAN
Network
Ping request
Ping reply
12/18/2018
14

Border Router Example in a few steps (1/3)
1
Compile the firmware for a wireless node:
Select the “Udp-sender” application and build the
Project using a supported IDE. Alternatively you can use
a pre-built binary that is provided for running this
application with the selected STM32 Nucleo board
2
3
Connect the board to a
PC USB slot and program the device
Copy the binary file
(e.g. drag & drop) to the USB mass storage
corresponding to the STM32 Nucleo board
4
Compile the firmware for the border router node:
Select the “Border-router” application and build
the Project using a supported IDE. Alternatively
you can use a pre-built binary that is provided
for running this application with the selected
STM32 Nucleo board
5
Connect the board to USB and
program the device
copy the file
(e.g. drag & drop) to the USB mass storage
corresponding to the STM32 Nucleo board
Download and extract X-CUBE-SUBG1
12/18/2018
15

Border Router Example
in a few steps (2/3)
cd ./tools
make tunslip6
sudo ./tunslip6 –s /dev/ttyACMx aaaa::1/64
Tunslip6 terminal window output
Linux PC setup (Ubuntu)
using “tunslip6” utility
Windows PC setup (Win 7/8)
using “wpcapslip6” utility
Setup the IPv6 Host PC
for IP traffic bridging between
host and 6LowPAN border Router
6
1. wpcapslip6 needs a working network adapter:
The Microsoft loopback adapter can be installed via “Add legacy
hardware” in the Windows Device Manager (reboot is needed after
installation of the loopback adapter)
2. Copy “cygwin1.dll” from “tools/cygwin” to wcapslip6 folder
3. Install WinPcaP
4. run Cygwin as administrator
wpcapslip6 utility can then be used with the rpl-border-router example
cd ./tools/stm32w/wpcapslip6
./wpcapslip6 –s /dev/ttySz –b aaaa:: -a aaaa::1/128 [addr]
Where [addr]is the MAC address of the local net adapter
Contiki server address (used in the next step)
OR
wpcapslip6 terminal window output
12/18/2018
16
From: [ROOT]/Middlewares/Third_Party/Contiki
ttySz / ttyACMx depends on the device enumeration, you
can use tab auto completion under both Linux and Cygwin

Border Router Example
in a few steps (3/3)
Open a Web browser (Firefox) to access the
Contiki server
providing the RPL neighbors and routes
information.
7
8Ping the wireless
Node to test the
6LoWPAN connectivity
[Linux:] ping6 aaaa::a00:f7ff:b9bc:4643
[Windows:] ping -6 aaaa::a00:f7ff:b9bc:4643
Contiki server address (see previous step)
between brackets, e.g. [aaaa::800:f5ff:eb3a:14c5]
12/18/2018
17

Demo Overview –Serial Sniffer Example
Serial Sniffer
STM32 Nucleo board with the
X-NUCLEO-IDS01A4/5
Wireless Nodes
STM32 Nucleo boards with the
X-NUCLEO-IDS01A4/5
PC running
Wireshark
IPv6/6LoWPAN
Network
12/18/2018
18

Serial Sniffer Example in a few steps (1/3)
12
3
Connect the board to a
PC USB slot and program the device
Copy the binary file
(e.g. drag & drop) to the USB mass storage
corresponding to the STM32 Nucleo board
4
A pre-requisite to use the Serial Sniffer is a
running 6LoWPAN network, you can refer to the
example UDP Sender and Receiver described
in previous slides, i.e. select “Udp-sender” and
“Udp-receiver” applications and build the
Projects using a supported IDE. Alternatively
you can use the pre-built binaries that are
provided for running these applications with the
selected STM32 Nucleo board
5
Connect the board to USB and
program the device (repeat this for both firmwares)
copy the file
(e.g. drag & drop) to the USB mass storage
corresponding to the STM32 Nucleo board
Download and extract X-CUBE-SUBG1
12/18/2018
19
Compile the firmware for the Serial Sniffer:
Select the “Serial-sniffer” application and build the
Project using a supported IDE. Alternatively you can use
a pre-built binary that is provided for running this
application with the selected STM32 Nucleo board

Serial Sniffer Example
in a few steps (2/3)
> sudo serialdump-linux -b115200 /dev/ttyACMx |
./convert-to-binary |wireshark -k -i -
Linux PC setup (Ubuntu)
using “serialdump-linux” utility
1. run Cygwin as administrator
2. serialdup-windows.exe utility is provided pre-compiled, but in
case you need to recompile it:
•cd serialdump-src
•make
•(or gcc –o serialdump-windows.exe serialdump.c)
•mv serialdump-windows.exe ..
3. Run the following command chain (it is ONE line of three
commands in pipe “|” one with the next one)
12/18/2018
20
Windows PC setup (Win 7/8)
using “serialdump-windows.exe” utility
Setup the PC
running Wireshark
application
6
From: [ROOT]/Utilities/serial-sniffer
OR
> serialdump-windows.exe -b115200 /dev/ttySz |
./convert-to-binary |wireshark.exe -k –i -
1. serialdump-linux utility has to be compiled:
•cd serialdump-src
•make
•(or gcc –o serialdump-linux serialdump.c)
•mv serialdump-linux ..
2. Run the following command chain (it is ONE line of three
commands in pipe “|” one with the next one)
NOTES:
Mind the trailing dash (-), it is mandatory, not a typo!
The ttySz / ttyACMx numbers depends on the device enumeration of the Nucleo board running the Serial-sniffer firmware, you can
use tab auto completion under both Linux and Cygwin
It is mandatory to invoke the above commands from the “serial-sniffer” folder (actually, the “header.pcap” file is supposed to be in
the same folder of the “convert-to-binary” script)
Perl is needed in order for the “convert-to-binary” script to work
•You can install it either via Cygwin setup or your Linux Package Manager
Wireshark application is required, a recent version it is recommended in order to have state of the art protocols dissectors
•In the above commands, Wireshark is supposed to be in System’s Shell PATH, if it is not the case you must provide the full
command path or create a proper link
•Under Windows, if you need to use the full path for wireshark.exe and this contains spaces, use '' as escape char before
spaces and parenthesis
Serial-sniffer firmware must be compiled with the same radio (channel, modulation, …) settings as the network under investigation
Under Windows you may need to hardcode the baudrate (115200) in the serialdump.c code and recompile
This manual suits for next models
1
Table of contents
Other ST Motherboard manuals

ST
ST ST72F651 User manual

ST
ST STEVAL-AKI002V1 User manual

ST
ST M24LR64-R User manual

ST
ST STEVAL-IDB007V Series User manual

ST
ST STM32F746G-DISCO User manual

ST
ST STM32 Nucleo Installation and operating instructions

ST
ST STM32L4 Series User manual

ST
ST PractiSPIN UM0696 User manual

ST
ST STEVAL-WESU1 User manual

ST
ST STM3210C-EVAL User manual