Skip to content

uraich/WisTrio_RAK5205

Repository files navigation

rak5205Demos

Introduction

This repository contains simple examples on how to program the STM32L151CB-A processor implemented on the Rak5205 Wis-Trio LoRa board. This board contains a RAK811 LoRa module with the processor and an SX1276 LoRa transceiver. The programs in this repository were written to explore the Wis-Trio board during beta testing. They use peripherals either implemented on the processor chip itself or on the Rak5205 board. All programs have been developed with STM32CubeMX which generates the peripheral initialization code. This code is included into Eclipse with the Ac6STM32 plugin. STM32CubeMX generated code for the ST HAL (Hardware Abstraction Layer) library whose functions are subsequently used in the programs. Once the program has been successfully built it is flashed into the Rak811 processor using an ST-Link V2 debugging probe. In circuit debugging is accomplished using this probe with the help of openocd and gdb. All this can be done from within the Eclipse IDE.

The Blink Demo (RAK5205Blink)

The Rak5205 Wis-Trio board has 2 user programmable LEDs connected to the GPIO port PA12 (LED1) and PB4 (LED2) The Blink program uses a 2 bit binary counter to drive those LEDs. The HAL_Delay function determines the frequency of blinking.

The Timer (Rak5205Timer)

This program also uses the LEDs on the WisTrio board but here the blinking frequency is determined by 2 hardware timers. When the first timer expires it triggers an interrupt at a frequency of 1 Hz. In the callback routine associated with this interrupt the state of the first LED is toggled and the second LED switched on. Then a second 200 ms timer is started and the interrupt generated by this timer will switch the second LED off again.

The board ID (RAK5205BoardID)

Each STM32L151CB-A processor has a unique identifier which is used as device EUI when registering the device with The Things Network (TTN). RAK5205BoardID reads the ID registers and constructs the device EUI as needed by TTN. The ID is printed to the serial port where it can be picked up with a serial terminal emulator like minicom or gtkterm.

GPS (RAK5205GPS)

The Rak5205 WisTrio uses Quectel L76 GNSS module as a GPS receiver. This module is interfaced to the Rak811 processor through its UART3. Quectel L76 sends GPS information in form of NMEA sentences. The program reads and prints these sentences which are in ASCII format. It then interprets each of the sentences and saves the results in dedicated data structures.

GPS with Parser (RAK5205_GPSParse)

The program is based on RAK5205GPS and reads out the Quectel L76 module the same way. However, this program copies each NMEA sentence into a line buffer and parses it, filling C structures. you can switch on "debugging" in which case the parsed information is printed in a humanly readable format,

I2C Scanner (RAK5025_I2CScanner)

The Wis-Trio Rak5205 has a MEMS digital motion sensor and a BME608 barometric presssure sensor on board. These chips are interfaced to the Rak811 chip through I2C. In order to scan the I2C bus for I2C slaves connected I wrote a simple I2C scanner. These program tries to acces an I2C slave on each of the possible I2C addresses and print the address on which it gets an answer.

The LIS3-DH MEMS motion scanner (Rak5205Lis3d)

In this program I try to read the LIS3-DH chip and print motion information. This needs some polishing.

The Real Time Clock (Rak5205RTC)

A demo program for the RTC. At the start of the program the user is asked to enter the current date and time (no line editing yet!). These data are sent to the RTC to set up date and time. In the main loop the RTC is read out every 5 s and date and time are printed.

About

Test programs for the RAK5205 WisTrio LoRa node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published