cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WLE5JC code snippet for simple Lora RX/TX

OFauc.1
Associate II

Hi all.

I'd like to write a simple bare-metal application for STM32WLE5JC.

Could you provide snippet code for STM32WL (core + radio) initialization

and simple RX/TX Lora Packet ?

Thanks

Olivier

5 REPLIES 5
Mecanix
Senior

Hi Olivier,

Just reaching out to see if you've managed to get a STM32WLE5xx going in all simplicity. I've been attempting the same and failed on every attempts, nothing compiles.

If you've managed to get it working do you mind sharing what was needed and how you've achieved it?

Thanks

OFauc.1
Associate II

Hi Mecanix.

Sorry, but I did not manage to write a simple code for STM32WLE5.

But I'm still interested a some stripped down example for sending Lora packet if someone have it .

Olivier

Mecanix
Senior

Hey Oliver

Refer to this thread linked below for a simple custom board P2P based on the ST's example. I'll see if I can break it down to barebone SPI/IRQs + an ultra-lightweight radio library. Probably next weekend, or the other if I can find time to spend on that (I highly doubt though). Looks like the best option (for now) is to remain on a MCU + SX12xx solution. Let's see what the folks at ST comes up in the coming months to compete in the simplicity world...

https://community.st.com/s/question/0D53W000011uicfSAA

OFauc.1
Associate II

Hi Mecanix.

Actually, you should have a look to my port of STM32WLE5 (and its sx126x radio) for TinyGO (Still Work in progress)

Right now, this project is suspended because of some major change in TinyGO's internal timer management ...

But some parts of the code may interest you :

  • SubGhzInit (radio+SPI3 init)

https://github.com/ofauchon/tinygo-drivers/blob/7818398fdb04d1724cecadb73ed124fecfe2af94/examples/lora/sx126x/lora_tx.go#L50

  • configureLora (for enabling Lora Mode)

https://github.com/ofauchon/tinygo-drivers/blob/7818398fdb04d1724cecadb73ed124fecfe2af94/examples/lora/sx126x/lora_tx.go#L93

  • And some basic LoraRx, LoraTx .... etc functions

It should be easy to understand and to port back to C .

Please also note there will be references to some sx126x tinygo-driver code:

https://github.com/ofauchon/tinygo-drivers/blob/sx126x/lora/sx126x/sx126x.go

... and a lightweight stack I tried to design (WIP too)

https://github.com/ofauchon/go-lorawan-stack/blob/main/lorawan.go

All of that will look messy, but you may find some low-level init code.

I hope I can resume my project in a near future (when tinygo's STM32WLE5 timers support is fixed)

Please ask if you need informations (I'll try to answer)

Good luck !

Olivier

Oh wow, that is awesome. Thanks for linking up! And yes, indeed priceless in terms of roadmap; that will surely save quite a lot of hours on research.

Let me logon and star that project as soon as I get on with it. Catch u on gh

Thanks Olivier, gl2u2 and all the best