cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L031F6P6 and LoRaWAN with sx1262

robertcabral
Associate

 

Hello,

I designed a board based on the STM32L031F6P6 with an sx1262 chip, and it worked well using the driver https://github.com/Lora-net/sx126x_driver for LoRa transmission.

I'm trying to send LoRaWAN signals, but I'm having trouble finding examples of LoRaWAN transmission with sx1262 for STM32 platforms.

Does anyone have any tips?

4 REPLIES 4
Andrew Neil
Super User

@robertcabral wrote:

I'm having trouble finding examples of LoRaWAN transmission with sx1262 for STM32 platforms.


The sx1262 neither knows nor cares what microcontroller you use - its operation doesn't change depending on the controller!

The only bit that's specific to a particular microcontroller is setup of IO pins and the SPI controller.

Once you've got that working, the rest is hardware agnostic.

As you say you can do basic LoRa, you must have that part already working...

Semtech provide hardware-independent software on their Product Page:

AndrewNeil_0-1758184462187.png

https://www.semtech.com/products/wireless-rf/lora-connect/sx1262

 

Having said all that, ST's I-CUBE-LRWAN provides specific support for STM32.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Hi Andrew! Thanks for your anwer.

I'm having trouble with the .elf file size.

My MCU has 32kB of flash (STM32L031F6P6), and I managed to get a package with at least 46KB using the BasicMAC library.

I'm having trouble adding I-CUBE-LRWAN; it doesn't appear in the options:

Captura de tela 2025-09-18 145030.png

I tried manually adding the .zip file, but got the following error:

Captura de tela 2025-09-18 151845.png

Does I-CUBE-LRWAN support STM32L031 family microcontrollers?

 

I would like to make lorawan sends in abp mode without the need for downlink, but I was unable to further optimize the lmic library for this.

 

Thanks in advance,

Robert.

>>Does I-CUBE-LRWAN support STM32L031 family microcontrollers?

Probably, it supports others in the L0x range, I've seen L07x

I do however anticipate it creating something too big, and a build for the L07x should illustrate this quickly enough. Those parts have 192KB of FLASH in the Murata parts, it doesn't use all that, but I'd suspect a LoRaWAN build with any Hash or Crypto would get a foot-print larger than 32KB

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

@robertcabral wrote:

I'm having trouble adding I-CUBE-LRWAN; it doesn't appear in the options:.


It isn't actually a Package like that - it's just a bunch of source files.

You just unzip them.

 


@robertcabral wrote:

Does I-CUBE-LRWAN support STM32L031 family microcontrollers?


AndrewNeil_0-1758225749242.png

It doesn't provide a ready-to-go project - but porting from one of those listed shouldn't be hard.

As @Tesla DeLorean says, try building one of them and see if that'll fit ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.