stm32l4 RTC Bypass Shadow Registers

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

geoffrey.brown
Posts: 42
Joined: Thu May 07, 2015 9:47 pm
Been thanked: 7 times

stm32l4 RTC Bypass Shadow Registers

Postby geoffrey.brown » Sun Sep 09, 2018 6:57 pm

I'm interested in doing RTC reads without the shadow registers (i.e. by setting BYPSHAD bit). First why --

-- coming out of low power modes, the shadow registers are incorrect and must be update which requires 2 RTC clock cycles
-- in one of my designs I use a 1024hz LSE signal because micro crystal makes a temperature compensated RTC -- 1.5ppm at 340nA and rather than pay the energy cost of I2C to read the RTC there, I'm using the STM32 RTC.

ok, I know how to set BYPSHAD, but the available documentation is (very) terse other than saying it's necessary to read the registers twice and compare values. Has anyone in this group used the RTC in shadow bypass ?

I'd ask the stm32 forum, but my experience there is that very rarely is a question answered by someone who has any actual experience with the issue at hand. In contrast, the quality of the feedback in this forum is high.

My plan is simply to add a define to rtc_lld_get_time that "does the right thing" if bypshad is set.
Geoffrey

User avatar
Giovanni
Site Admin
Posts: 11152
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 391 times
Been thanked: 322 times
Contact:

Re: stm32l4 RTC Bypass Shadow Registers

Postby Giovanni » Sun Sep 09, 2018 7:18 pm

Never used it but it does not sound complex to do.

Try to make a generic register read function that can work in both modes (with a compile-time switch) and just try it.

Giovanni

geoffrey.brown
Posts: 42
Joined: Thu May 07, 2015 9:47 pm
Been thanked: 7 times

Re: stm32l4 RTC Bypass Shadow Registers

Postby geoffrey.brown » Sun Sep 09, 2018 8:40 pm

The implementation is easy, but testing impossible -- there's a correctness issue that requires more information that STM provides.
Geoffrey


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 11 guests