Question
RTC_OUT lost when calling HAL_RTCEx_EnableBypassShadow for HAL || RTC_BypassShadowCmd in StdLib
Posted on October 22, 2015 at 15:03
Hi,
I'm working with STM32F0 RTC using LSE. All work perfectly till I need to map the RTC_CALIB to RTC_OUT. I succeed to get my 1Hz in RTC_OUT pin, but after a moment I lose the signal. with an investigation in my code, the signal is lost where I need to disable thebypass of RTC shadowregisters. I bypass RTC register by callingRTC_BypassShadowCmd(DISABLE).Both forRTC_BypassShadowCmd in StdLib or HAL_RTCEx_EnableBypassShadowin Cube, I find that a cast of a byte is made for bypass enable bit mask./* Reset the BYPSHAD bit */
RTC->CR &= (uint8_t)~RTC_CR_BYPSHAD;
and an AND operation of CR & 0x000000DF is made. So as the
BYPSHAD bit is the 5st bit in CR register all other configuration bits starting from the 8st bit are cleared, thus the clear of the configuration bits of the mapping out of RTC_CALIB. I loss my alarm configuration and my mapping out by calling this function.
So it's recommended that I clear the alarm, the maping out,... in the CR register before disabling the bypass? Or Can I disable the Bypass of shadow registers without resetting my half RTC config?
Thanks,
#rtc #stm32-rtc_b-ypassshadowcmd