Creating a LoRa platform with STM32WL
ICR3ATE is constantly looking at ways to improve the design phase of prototyping new IoT devices. While Low Code platforms are often sufficient for functional prototyping, ICR3ATE has been looking at a closer-to-hardware way of prototyping IoT devices. With the launch of ST’s STM32WL series of LoRa capable microcontrollers perfectly matching these demands, development has been started on a LoRa platform using these chips.
Low code platforms are often perfectly usable for functional prototyping of IoT devices. However, when starting to look at more production-ready industrial applications, low code becomes a bottleneck. Low code platforms often don’t allow control over deep system configuration, like changing specific internal clocks, as well as having limited debugging capability.
ST recently released their new STM32WL lineup of LoRa capable microcontrollers that include a general purpose microcontroller and sub-GHz radio on a single chip. Built using Arm Cortex M4 cores and supporting many wireless standards, they are the ideal choice for industrial ready wireless IoT device applications. This combined with the expansive development ecosysteem that ST has built over the years has made STM32WL the perfect choice for ICR3ATE.
The purpose of integrating the STM32WL into ICR3ATE’s portfolio has been clear from the start; Creating a development environment that allows for easy functional prototyping in the same way that current low code techniques allow, while making use of the more advanced features that using C/C++ directly on the hardware unlocks.
For this, three sub-goals have been set:
- Be able to set up a project in minutes by using the development environment as starting point
- Allow for easy configuration of the LoRa interface
- Create a software template for sending LoRa messages using all three class A message initialisers (timer, external interrupt and downlink)
Using the Windy Module from Midatronics as an initial development board together with STM32CubeIDE and STM32CubeProgrammer, initial setup was done. The by ST supplied example projects made for a good starting point and enabled the first LoRa messages to be sent. From there a blank project was created and setup of the peripherals was done using CubeMX.
Next, code was written to interface with the lower abstraction layers of the STM32WL firmware stack to supply a high level of abstraction to future applications. By consolidating calls to the different firmware layers into a single set of files, all required functionality was now easily accessible. This approach ensures that future developers, even ones that might not be familiar with the STM32 environment, should easily be able to realise their applications without having to look at lower abstraction layers.
Lastly a few helper functions were written that allow configuration of all three class A interrupts in a single place. By using a sequencer, tasks can be created and scheduled to call functions whenever the processor exits its sleep states. Example functions were created to allow simple Cayenne compliant LoRa messages to be sent.
In conclusion, the new STM32WL lineup of microprocessors has proven to perfectly match ICR3ATE’s requirements for industrialisation ready IoT solutions. The ability for advanced features and control combined with the created modular software environment makes prototyping speed comparable to low-code alternatives, while giving way more control to the programmer.
In the future this platform will be put to the test in actual IoT solutions, through a combination of this software environment and custom hardware.