AnsweredAssumed Answered

RTC_OUT lost when calling HAL_RTCEx_EnableBypassShadow for HAL || RTC_BypassShadowCmd in StdLib

Question asked by zemni.ismail.002 on Oct 22, 2015
Latest reply on Oct 26, 2015 by Amel N

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 the bypass of RTC shadow registers. I bypass RTC register by calling RTC_BypassShadowCmd(DISABLE). Both for RTC_BypassShadowCmd in StdLib or HAL_RTCEx_EnableBypassShadow  in 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?