RTC Alarm interrupt after 48 days in ST LoRa middlewares. What it happens?
Hi,
I have a question related to the working principle of RTC in the LoRa middleware I-CUBE-LRWAN and STM32CubeWL.
I'm working on the firmware for custom boards based on development boards both B-L072Z-LRWAN1 and the more recent NUCLEO-WL55JC1.
My projects should work for years on LoRaWAN public network and I noticed a comment in the user manuals about the duration (48 days) of RTC both LoRa middleware.
Here in I-CUBE-LRWAN (UM2073)
and here in STM32CubeWL documentation (AN5406)
What I observed looking at the firmware (example End_Node, TX_ON_TIMER) is that RTC is configured in free-running mode using binary mode.
Default configuration has LSE activated and it is clocked at 32.768 kHz. This means that each second we have an increment of 32768 units in the 32-bit RTC free-running counter register that is used to timing the LoRa stack and alarms (and wake-up the machine from low-power modes). Moreover, after around 48 days we have the overflow of this 32-bit RTC free-running counter register.
At first sight, I think that when we are close to the overflow of the counter, all future set-up alarms, that overcomes the width of the 32-bit counter, will overflow themselves, moreover, they will be corrected set up and they will wake up the machine after 48 days.
Is it right this last statement and it will work properly after 48 days?
Or LoRa middleware will not work properly after 48 days? In this last case, which is the appropriate solution to handle a project that it should work for months/years? Save all LoRa variables in non-volatile memories, reset the micro and re-upload these variables to avoid re-join to the LoRaWAN public network?
Best regards,
MBare