FORUM

LoRaWAN Impementation Using STM32 and Dragino LPS8

Hello ,

I am Working on IoT Project Which includes LoRaWAN. I have Integrated (I-CUBE_LRWAN) and the code for Project. But I am not able Complete as My application is Using RTC for other task and LORAWAN is also Using RTC for some tasks.

Can anyone please let me know how to use that Code without RTC functionality in it.

Thanks,
Shiva
2023-01-19T18:30:00Z

The RTC is deeply imbedded inside the LoRa Code and used for lots of different things BUT It only uses ALARM A.

Rather than not using the RTC as you are, you can use ALARM B for anything you want and it won’t affect the LoRa firmware at all.

The second option is to look at TimeServer.c in Middlewares\Third_Party\Lora\Utilities
This is a timer that is available to any process in the system, simply create a TimerEvent_t object, call start, stop or whatever, and it will execute a callback when it times out. The Handler will allocate a place in the queue and interrupt at the appointed time.

If you have a need for a short interval, then consider the LPTIM1 instead.

One small note…
I found that the RTC doesn’t double buffer its registers in the LoRa code, occasionally you go back in time reading the RTC. It pays to read twice and check its stable before using.

Simon