PicoWAN SDK Documentation
PicoWAN SDK

Synopsis

This SDK allows to create embedded applications compatible with the PicoWAN network. Moreover, thanks to its multi-MAC layer, an application designed with this SDK will also be compatible as-is with any LoRaWAN network. It has been primarily designed for the STM32L072 and LoRa (B-L072Z-LRWAN1) development board from STMicroelectronics, as well as the Archos PicoSmartTag, but can be easily extended to support additional devices based on the STM32L1/L0 MCU families coupled with an SX1276 Transceiver (like the CMWX1ZZABZ module from Murata).

A sample project named HelloPico is available as starting point. It mainly allows to send a PicoWAN message when you push a button on your target device.

Prerequisites

To use this SDK, a Unix environment with the GNU Make tool available is recommended (Linux 64-bit preferred, but it also works on Mac OS and Windows with Cygwin). If you want to use OpenOCD (provided in the SDK package), libusb v1.0 also needs to be installed. As an alternative, the various projects can also be loaded in IAR or TrueSTUDIO.

Installation

Binary package

The easiest and recommended way to install the PicoWAN SDK is to download the latest release package for your operating system in the Release section of the GitHUB repository. It includes all the required tools and dependencies (ST libraries, GNU ARM Embedded Toolchain, OpenOCD and PicoFlash), whose versions have been tested and validated all together. The SDK release package is available for Linux, Windows (Cygwin required) and Mac OS. If you plan to use IAR or TrueSTUDIO, the operating system dependent tools are not needed (only the SDK sources and the ST libraries are required). In such a case, just download and extract any SDK release package.

Linux

On Ubuntu/Debian:

Windows (Cygwin)

Please note that if the PicoWAN SDK as been properly downloaded in 'C:\ cygwin \ home \ <your_username> \', <path_to_the_downloaded_sdk_package> will be something like '../PicoWAN-SDK_v<version>_win32.tar.gz'.

Mac OS

Git repository

Alternatively, you can install the latest revision of the PicoWAN SDK directly from the Git repository. In that case you will need to create the SDK folder tree manually as follow:

Usage

Unix environment

Just type $ make in the firmware folder to see the available targets and parameters:

1 $ make [BOARD=<board>] <target> to build <target>
2 $ make [BOARD=<board>] <target>-flash to build and flash <target>
3 $ make [BOARD=<board>] buildall to build all targets
4 $ make [BOARD=<board>] CREDENTIALS="<credentials>" FlashPicoCred-flash to inject the PicoWAN credentials into the board
5 $ make <target>-clean to clean <target>
6 $ make clean to clean all targets

Several boards are available:

HelloPico, ATModem, FlashKeys, and FlashPicoCred will be the only targets available at first. Once your own projects added to the projects folder, they will be listed there as well.

For instance, to build the HelloPico project for the PicoSmartTAG board, just type:

1 $ make BOARD=picotag HelloPico

IAR/TrueSTUDIO

For each SDK project, ready to use IAR and TrueSTUDIO projects/workspaces are available for the Murata Discovery and PicoSmartTAG boards. They are located in the IAR and TrueSTUDIO sub-folders of the project.

Flashing credentials

To establish a connection with the PicoWAN network, a device needs a valid set of credentials (PicoWAN keys and IDs). While these credentials need to be injected into the device only once, it can be done at anytime if they need to be changed. Please note that doing so erases the application (project) currently loaded, so once the credentials have been flashed, the desired application needs to be flashed again.

Unix environment

In order to flash a particular set of credentials, just type:

1 $ make [BOARD=<board>] CREDENTIALS="<credentials>" FlashPicoCred-flash

Where <credentials> should be replaced by something like 00000C96,0016DC0100000C96,6E4ACC054D1B7857E1C9293B6413CDA9,C3A85734166A18734B5BB7184FAC0F99,57.

IAR/TrueSTUDIO

If you are using IAR or TrueSTUDIO, you need to import the corresponding project located in firmware/projects/FlashPicoCred, and insert the credentials at the beginning of the main.c file where requested. Then you just need to build, flash, and run the project.

LoRaWAN credentials

If you need to inject LoRaWAN credentials, open the FlashKeys project, and fill in the keys and IDs (for both, PicoWAN and LoRaWAN) where requested, making sure to carefully follow the requested endianness. Then you just need to build, flash, and run the project.

Folder organization

1 |___firmware the "Home" folder in which you should be to build the various projects
2 | |___common common code
3 | | |___mac multi-MAC layer
4 | | | |___lora-mac LoRaWAN implementation
5 | | | |___pico-mac PicoWAN related headers
6 | | | |___lib PicoWAN libraries for GCC and IAR
7 | | |
8 | | |___os OS related files
9 | | |___radio radio driver
10 | | |___sensors drivers for various sensors
11 | | |___stm32
12 | | | |___STM32L0 STM32L0 related files and boards definition (boards.h)
13 | | | |___STM32L1 STM32L1 related files and boards definition (boards.h)
14 | | |
15 | | |___utils helpers and algorithms independent from the hardware
16 | |
17 | |___projects the various projects that can be built (and where your own projects must go)
18 | |___ATModem the source of the ATModem firmware
19 | |___FlashKeys a project to modify and execute on the board (only once) in order to flash the various keys and IDs (PicoWAN and LoRaWAN)
20 | |___FlashPicoCred a project to execute on the board only once in order to flash all the PicoWAN credentials (binary with the right credentials generated from the command line)
21 | |___HelloPico a simple project demonstrating the use of the MultiMac layer
22 |
23 |___utils OpenOCD and PicoFlash
24 |___libs ST L0/L1 libraries
25 |___toolchain the GNU ARM toolchain

Porting the PicoWAN stack to other Hardware/Software environments

Operating System Abstraction Layer (OSAL)

The multi-MAC layer (PicoWAN + LoRaWAN stacks), located in the common/mac folder, has been designed to be self-contained and as much as possible independent from the Operating System on which it is running. Because of this design, it relies on an Operating System Abstraction Layer (OSAL), and can be the easily integrated on top of various software environments. If you need to run the muti-MAC layer on top of another environment (FreeRTOS, Linux, ...), you just need to integrate the common/mac folder in it, and adapt the OSAL. This layer is well documented, and must be carefully implemented in order to have a properly working multi-MAC-layer. To do so, rename the file called osal.c.template into osal.c, and implement the empty functions using the right OS and Radio calls.

Hardware requirements

To properly run the PicoWAN and LoRaWAN stacks, the following hardware requirements need to be met:

History

v2.0:

__ Copyright (c) 2018 Archos S.A.