6LoWPAN IoT Software Development Kit

Page Summary

This page is an introduction to our “6LoWPAN IoT Software Development Kit”, which enables you to program our hardware devices with your own firmware as an alternative to our “ready to use” solutions based on CoAP.

The target audience is experienced embedded programmers with rich knowledge of the “C” programming language and the STM32 microcontroller family.

Quick Facts

  • Royalty-free 6LoWPAN stack
  • Based on free toolchain “GCC ARM Embedded”
  • Ready to use “CooCox” & “Eclipse” IDE projects
  • Complete UDP over IPv6 example app
  • Extensive API documentation
  • Easy SWD Debug (via ST/LinkV2)

Key Terms

  • IPv6 over 6LoWPAN
  • UDP Sockets
  • IPsec & IKEv2
  • gcc CooCox & Eclipse
  • Mesh networks
  • ZWIR4512

6LoWPAN Stack Introduction

The 6LoWPAN  (stands for: IPv6 over Low power Wireless Personal Area Networks) software stack enables you to transmit/receive  data over wireless mesh networks using standard IPv6 adressing. In practice this means that you can communicate with Lobaro hardware over well known IPv6 networks and UDP-sockets.

With our SDK you can build your custom embedded firmware running on the low power STM32F103 ARM Cortex-M3 microcontroller inside our devices. In contrast to our “ready to use” CoAP solutions you define the application layer completely by yourself when using raw udp sockets. This gives you flexibility but also means much more engineering work to do with the danger of “reinventing the wheel”…

One important part of your firmware will be the 6LoWPAN stack, which enables you to send data over UDP sockets, encrypt transmissons or do basics like sending out some text on the uart. The stack itself is supplied from the vendor of the internal radio module, which is “Zentrum Mikroelektronik Dresden AG” (ZMDI). This “piece of software” comes in pre-compiled “C” object code & header files for use with the free “GCC ARM Embedded“-Toolchain. Please note: The 6LoWPAN stack is royalty-free, but not open source.

You program and compile your own firmware targeted for the interal STM32F103RC microcontroller runing the 6LoWPAN stack in the background. The API is well documented, see the document ZWIR451x_ProgGuide_Rev_1_90.pdf. Additionally  you might want to download the schematic of our “IPv6 Universal Box” device in which you can find the connection options for e.g. attaching external sensors.

Lobaro also provides you with an skeleton project which you should use as  a starting point for firmware programming. If you use the free “CooCox” IDE (Windows only) it’s one click on the project file to get a running development enviroment with debug support (requires ST/LINKv2 debugger).

Please consider also our “higher-level” CoAP solutions which  are not necessary to do embedded programming at all!

Development Toolchain Quick Start

1. Install free GCC ARM Toolchain|Compiler

Download & install the free gcc toolchain for ARM processors:  launchpad.net/gcc-arm-embedded

2. Install integrated development environment (IDE)

Choose your prefered IDE:

CooCox supports programming and debuging via ST/LinkV2 JTAG adapter out of the box. This is accomplished by its internal provided remote GDB server.
On pure Eclipse you have to setup an external GDB Server. See ZMDIs OpenSourceToolChain_Rev_1_00.pdf document for further information on this topic.

To install the “GNU ARM Eclipse” Plugin follow step by step instructions at gnuarmeclipse.github.io/plugins/install

3. Open preconfigured project file inside IDE

  • CooCox: Just open the “coocox-proj/Lobaro-6LoWPAN-Skeleton.coproj” file
  • Eclipse: Right click @project tree “import” -> “import existings projects” und locate the directory “eclipse-proj”

All important compiler/linker settings are allready configured for you by this project templates!

4a. Flash firmware via serial/USB bootloader

To program your Lobaro Box the easiest way is to use the internal USB bootloader and the tool “Flash Loader Demonstrator” from ST.

To activate the bootloader mode just press the “Reset Button” while holding the “Update Button”. The device will start into bootloader mode once you release both buttons. Now a firmware *.hex file can be programmed via the usb-port (“USB-UART1”).

4b. Flash & Debug firmware via STlink/V2 programmer

The Lobaro Box exposes an SWD/JTAG 2×3 2mm header to which you can connect your STlink/V2 usb programmer. Please see the schematic for the pinout details.

With this adapter you can debug and flash directly out of coocox ide with just one click. An other option is to use the free ST-Link utility flash application.

 

Example Application

1
2
3
1

Lobaro IPv6 Universal Box
running SDK skeleton firmware.
Download it on Github!

2

Transparent IPv6 Gateway

3

PC Demo App written in GoLang.
Get it for free on GitHub!

To quick start your development with our SDK we provide to you an simple but complete example solution. You can see the block diagram of this system in the picture above. All you need is:

  1. Our “IPv6 Universal Box” running the raw-6lowpan-skeleton firmware
  2. An pc running our demo application “go-UDP6test“
  3. An “IPv6 USB gateway stick” attachted to this pc

The firmware opens an UDP socket on local port 5684 and waits for incoming datagrams send to the IPv6 address of the box. Once an datagram has been received its payload is forwared to the uart1 tx pin of the internal STM32F103. You can watch this ascii output by attaching an cable to the left hand front microUsb port of the box. This is made possible through an internal usb->serial converter. The used baudrate is 115200 with 8 databits, 1 stopbit and no parity. In addition the string “Lobaro OK!” is send back to origin of the just received datagram.

The pc application must be invoked with the link local ipv6 of the destination box as argument. For example: go-UDP6test [fe80::0211:7d00:0030:8e3f]:5684

The app simply sends every second an udp6 datagram to the destination box with the current timestamp as payload. Also any received data is logged to the console output.

Downloads:


Binaries:

*Please compile from golang sources if you need a binary for a different platform (Linux, MacOS)

Sources: