There’s a possible work around that requires some firmware development and some hardware changes external to the module.
Use the low power timer on the STM32L041G6. LPTIM1 can take an external clock on LPTIM1_IN1 which can be mapped to several pins, including some that come out the module pins: PA0, PA4, PA8, PB5.
Attach a 32 KHz precision oscillator to those pins, and program LPTIM1 properly, it will count 32 KHz pulses. You can then set an interrupt compare on the counter value. The LPTIM will operate in STOP mode, which is the basic mode to lower power of the MCU during idle times (preserves state as opposed to STANDBY mode).
You have to produce a 32 KHz clock signal to valid logic levels, not just hook up a crystal. Here’s a part that does that:
https://www.sitime.com/datasheet/SiT1533
You can even get a TCXO version with much higher accuracy:
https://www.sitime.com/datasheet/SiT1552
The other issue is that the LPTIM is 16 bits. If you prescale by 1, then it lasts 2 seconds. You will need to take a wake up interrupt every 2 seconds at least to time events further away than that. A wake up, update counter, go back to STOP mode is not very much power every 2 seconds.
If you use the prescaler, you can make it last much longer, up to 256 seconds, but timing resolution is reduced to 3.9 ms (1/256 of a second). I would favor prescale by 1 and waking up every 2 seconds to keep the timing resolution.
There is no way to get an external clock to drive the RTC other then feeding it into the OSC32 pins, which are not pinned out on the DWM1004C module.
Mike Ciholas, President, Ciholas, Inc
3700 Bell Road, Newburgh, IN 47630 USA
mikec@ciholas.com
+1 812 962 9408