STM32WL LoRa Design Guide: Radio, Power and Firmware
The STM32WL puts a Cortex-M4 and a sub-GHz radio on one die. That removes an SPI link, a second crystal and a chunk of board area compared with a separate MCU and SX126x transceiver.
It also concentrates several decisions into one part selection. This guide covers the ones that matter.
Choosing the RF path
The STM32WL has two separate power amplifier paths and you must commit to one at layout.
Low power path. Up to +15 dBm. Lower current draw, simpler matching network.
High power path. Up to +22 dBm. Roughly four times the output power, which is around 7 dB more link budget, at a significant current cost during transmit.
Some designs bring out both and switch between them, at the cost of an RF switch and its insertion loss.
Decide based on your link budget and your battery. An extra 7 dB is worth roughly a doubling of range in open conditions, but transmit current at +22 dBm will dominate your power budget if you transmit often.
Matching the high power path
The reference designs published by the vendor are usually derived on Nucleo evaluation boards, which use a specific package and stackup.
If you are targeting the UFQFPN48 package and your board differs from the reference, the published component values will be close but not correct. Expect to characterize and adjust.
Two workable approaches:
Discrete matching. More board area, fully tunable, lowest cost at volume. Lay out a pi network footprint after the balun.
IPD balun module. A single integrated part carrying the balun and match. Much faster bring up, small footprint, higher unit cost and no tuning ability. For details on comparing discrete vs IPD options, see our guide on balun design for sub-GHz radios.
For a first product with schedule pressure, the IPD is usually the right call. For a high volume design with RF bench capability, discretes win.
Antenna and shared paths
At 433 MHz a quarter wave is about 173 mm, which most products cannot accommodate. Expect a compromised electrically small antenna and design the ground plane accordingly. See our guide on 433 MHz PCB antenna design for ground plane geometry rules.
If the product also needs GNSS, an LC diplexer can share one antenna between the sub-GHz radio and L1 at 1575 MHz. Budget the insertion loss carefully, because loss in the GNSS path directly reduces fix sensitivity, and consider an external LNA to recover it.
Power budget
For a battery powered node, three numbers dominate.
Sleep current. In Stop 2 mode with the RTC running, expect low single digit microamps. This is what determines standby life, and it is where most designs leak power through poorly configured GPIO or an always on regulator.
Transmit current. At +22 dBm the radio draws well over 100 mA. Your battery and its internal resistance must sustain that without the rail collapsing. Check the battery datasheet under pulsed load, not average load.
Receive current. Often overlooked, but a node that listens continuously will burn far more energy than one that transmits occasionally. Duty cycle the receiver aggressively.
Practical steps:
- Configure every unused GPIO as analog input rather than leaving it floating
- Disable peripheral clocks you are not using
- Use the LPTIM or RTC to wake rather than polling
- Measure actual sleep current on hardware, since it is almost always higher than expected on the first build
Firmware update strategy
Decide this before you ship, because retrofitting it is painful.
Bootloader with dual bank. The safest approach. Write the new image to the inactive bank, verify it, then switch. A failed update leaves the working image intact.
Single bank with a recovery image. Uses less flash but a power loss mid update can brick the device unless the recovery path is solid.
No field update. Viable only for devices you can physically retrieve.
If updates arrive over LoRaWAN or point-to-point LoRa, remember the data rate. A 200 KB image over a low data rate link takes a long time and a lot of energy. For protocol architecture, read our LoRaWAN device development guide.
Certification considerations
Sub-GHz bands are regulated differently in every region.
- 433 MHz, 868 MHz and 915 MHz all have different duty cycle and power rules
- Some regions impose listen before talk requirements
- Harmonic limits apply at full transmit power, so test at the power level you ship
Design the low pass filter after the PA from the start. Adding it after a failed scan usually means a board respin.
Bring up sequence that saves time
1. Verify the MCU alone boots and the debug interface works 2. Confirm the 32 MHz TCXO starts and is within tolerance 3. Transmit a continuous wave carrier and measure conducted power at the antenna port 4. Tune the matching network until conducted power meets expectation 5. Only then bring up the LoRa modem and test packet exchange 6. Measure sleep current with the full application running
Skipping straight to packet tests makes it impossible to tell an RF problem from a firmware problem.
Where teams commonly lose time
- Copying reference matching values without characterizing on the actual package and stackup
- Discovering sleep current is 200 microamps instead of 2 because of floating pins
- Sizing a battery on average current and finding it browns out during transmit
- Leaving firmware update strategy until after hardware is frozen
- Testing emissions at low power and failing at shipping power
Getting a sub-GHz product built
The STM32WL removes a lot of integration work but concentrates the RF design risk into a smaller number of decisions.
SRQ Robotics designs STM32WL based products end to end, including high power path matching, shared antenna diplexers, low power firmware and pre-compliance scanning. Explore our Embedded & IoT services or contact us if you need a sub-GHz node that meets both its range and its battery target.
