-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stm32LoraWan with RTC in mix mode #22
Conversation
The Alarm B of the RTC is used for LoRaWan purpose. Use the LSE as clock source for the RTC instance. set the free running mix mode. Signed-off-by: Francois Ramu <francois.ramu@st.com>
Mask is set to ALL in case of MIX mode, so that interrupt is trigged on the sub-second basis (other calendar values do not care) Signed-off-by: Francois Ramu <francois.ramu@st.com>
The RTC.begin does not propose the RTCmode parameter. This is configured with the setRTCMode method before .begin The RTC irq (for Alarm B) is handled directly by the STM32RTC library Signed-off-by: Francois Ramu <francois.ramu@st.com>
Include the STM32RTC library to all the BSP as only few functions remain in the BSP as the RTC is instantiated by the STM32RTC library Signed-off-by: Francois Ramu <francois.ramu@st.com>
Problem found with STM32duinoLoRaWAN/examples/Basic cannot connect. The RTC is running but the Lorawan started timers expires with an ALARM B interrupt
|
Directly call the RTC functions from the STM32duino RTC library Let the IsEnabled.RtcFeatures be handled by the RTC library
Give the parameters a 32-bit value to match the SubSecond register of the RTC.
In Mix mode, the SSR is counting on a fqce APRE which is RTCCLK freq / 'PREDIV_A + 1) = 256Hz when RTC is clocked by LSE. This frqe gives a tick of 3.9ms (= 1/256 * 1000)
Adjusting the conversion formula to change ticks in ms and ms to ticks. |
Running the STM32duinoLoRaWAN/examples/Basic on the nucleo_wl55jc
|
now replaced by the #25 |
Configure the RTC in mix mode and use the ALARM B of the stm32WL55 device
for the LoraWan purpose.
This requires the stm32duino/STM32RTC#93
The MIX mode of the RTC allows the Lorawan to use the subsecond and alarm (B) in binary mode
and the RTC to be also used in BCD calendar mode.