LoraWAN

LoRaWAN with the STM32WL55

During Boostcamp 2022, we gained more in-depth knowledge of several technologies. This article gives an insight into ST’s STM32WL55 controller, which combines a dual-core general-purpose microcontroller with a sub-GHz radio chip. This enabled us to build a compact LoRaWAN infrastructure during Boostcamp and thus communicate with the Nucleo development boards.

Controller
Figure 1: Schematic structure of the controller

Dual-core
The STM32WL55 has two cores: the Arm® Cortex®‐M4 and the Cortex®-M0+. The application uses the powerful M4 CPU while the radio stack runs on the M0+ core. The two programs are stored separately in the memory and do not have direct access to each other. The mailbox connects the two processors and thus helps establish a communication channel.

 

Mailbox
The mailbox consists of the interprocessor communication controller (IPCC) and a shared memory, the intercore memory. The IPCC is a hardware peripheral used to trigger and receive interrupts on the other core. It has 12 channels – six for each direction. The IPCC does not have its own memory, which is why the above-mentioned intercore memory is used for data exchange between the two cores.
 
The mailbox multiplexer (MBMUX) is the accompanying firmware component responsible for routing commands. Each feature has its own interface with the MBMUX. Features include the following components:

  • System
  • Trace
  • KMS (key management services)
  • Radio
  • Protocol stack

The features must reserve the IPCC channels for using it. As a result, the design of the communication between the two cores can be flexibly adapted to the application.
 
This mailbox system enables a remote procedure call (RPC) structure. CPU 1 can call functions implemented on CPU 2 and vice versa. Data is exchanged via the shared memory.

 

Encryption
The STM32WL55 controller is equipped with hardware-supported security functions. ST provides the proprietary key management services (KMS) library, which is compliant with the PKCS11 standard. With the KMS API, sensitive data, such as the LoRaWAN keys, can be stored on the device in encrypted form, thus keeping it protected. Implementing the secure boot and firmware update (SBSFU) functionality also protects the end device from any installation of malicious firmware.

 

Sub-GHz radio
The integrated sub-GHz radio controller is based on a Semtech SX126x and operates in the frequency range of 150 to 960 MHz. LoRa or (G)FSK can be used as modulation types. Since the controller covers a wide frequency range, a suitable radio front end selects the desired frequency band. This enables country-specific adaptation of the terminal device with the same controller.
 
Existing stacks can be used for the communication protocol. ST provides a BSD-3 licensed stack for LoRaWAN. A proprietary stack from ST is also available for the Sigfox network (ST/Sigfox).

 

Our conclusion on the STM32WL55
The STM32WL55 is ideal for compact designs that need to be energy efficient but also require a temporary increase in computing power. The controller combines dual-core functionality with a sub-GHz radio controller. This enables a one-chip solution and reduces the additional dependencies on other components. The dual-core functionality allows for clear separation of tasks. The various features of the cores help to optimise power consumption. The radio stack runs independently and can communicate with the application located on the other core. This also enables independent firmware development of the two chips.
 
The sub-GHz controller is primarily designed for LoRa. LoRa is characterised by long-range, interference-resistant and energy-saving transmission. However, the data throughput of this technology is small, making it ideal for platforms that send small amounts of data, such as sensor readings. Using a communication stack such as LoRaWAN makes it possible to create an efficient network of sensor stations. But LoRaWAN is not the only option. The integrated radio controller also allows you to implement your own protocols. Implementing a point-to-point communication protocol is therefore a conceivable option.

 

Application ideas
LoRaWAN can be used in many different fields. It is proving ideally suited to the IoT sector in particular. Examples include intelligent urban infrastructure that records and monitors air quality, or, in the area of waste disposal, rubbish bins that send a notification as soon as they are full.
In the healthcare sector, portable devices could be connected to a LoRaWAN network to monitor critical patient measurement values over a long distance. A wristband with an alarm button could also provide an emergency call function in hard-to-reach locations.
In agriculture, measuring stations can be used to track important environmental parameters and trigger an alarm in the event of critical incidents such as frost.

 

Conclusion
Testing the STM32WL55 in a complete LoRaWAN infrastructure has given us a good insight into the controller and its functionalities. We have expanded our knowledge of radio technology and are now well-placed to tackle future LoRaWAN projects. LoRaWAN offers huge potential and its possible applications are almost unlimited.

 

CSA Engineering AG would be happy to use its expertise and ideas to help you develop your individual solution.

Contact us