Showing results for 
Search instead for 
Did you mean: 

What would cause the RTC to become damaged or stop updating hrs, mins and secs (but not subseconds) on an STM32L082 within a Murata CMWX1ZZABZ-078?

Associate II

I have two projects, both using HAL libraries in STM32CubeIDE 1.5.1.

The first project simply initializes the RTC, using external 32kHz crystal, and then falls into a loop that reads the RTC every second. Using my debugger with a breakpoint, I can see the read results of the RTC and that hrs, mins and secs are updating.

The second project does the same thing as the first project, but also includes code to PWM pin PA5 using TIM2 CH1. The DMA is also used to efficiently adjust the duty cycle of this PWM signal.

The issue is that once I execute the second project on my platform, the RTC no longer updates the hrs, mins or secs. However, the subseconds do get updated and the code that provides the PWM signal works as expected. I switch back to the first project (proven to work) and the RTC will still NOT update. Power cycling does not resolve. I replace my hardware (target platform). Now I have two platforms that are bricks (RTC no longer working).

At first, I thought my 2nd project was inadvertantly using and causing overdrive on the 32kHz crystal I/O pins and thus damaging the crystal. However, the subseconds are still updating. Although, I'm using Murata's recommended drive levels on the LSE, I have tried others and that does not resolve. I have read the parts errata sheet and found nothing that may pertain to this.

Can anybody direct or give me clues for further troubleshooting, before I damage another platform?


Read out and check/compare/post the RTC and RCC_BDCR registers content for working and non-working case.

You do read Date after Subseconds/Time, don't you.


Associate II

Apparently, I just needed to read the date along with the time.

Thank you for your quick response.