Page 1 of 1

[DONE] STM32L1 and low power RTC wakeup

Posted: Fri Sep 06, 2013 3:22 pm
by dflogeras
Hi, is STM32Lxx RTC support planned in a future release? I would like to put my device to very low-power sleep for extended periods of time (say 10-15 minutes) and wake up with the RTC. I see it is not currently supported in the feature matrix, and there was some discussion about it in previous threads:

viewtopic.php?f=3&t=158&start=30
viewtopic.php?f=3&t=163

I am just starting out on my STM32 and ChibiOS journey, but I have hardware and could attempt to get this implemented (with direction). Alternatively I'd be happy to donate hardware if that is an issue. Unfortunately I cannot create time for Giovanni or barthess who seem to be the guys who understand everything :)

Are there any other feasible options other than bit-banging around Chibi? I could envision adding some sort of i2c counter chip with an interrupt alarm, if arbitrary interrupt wake-ups are allowed and implementable software-wise.

Regards, and thanks for ChibiOS!

Re: STM32L1 and low power RTC wakeup

Posted: Fri Sep 06, 2013 5:02 pm
by Giovanni
Hi,

The current RTCv2 driver should work on the L1, just it hasn't been tested yet. I am not sure if there are adjustments to be made on the HAL. Just try to add it to the platform.mk and see how it goes.

Giovanni

Re: STM32L1 and low power RTC wakeup

Posted: Fri Sep 13, 2013 4:58 am
by dflogeras
Thanks, adding RTCv2 related entries to platform.mk worked out of the box (I just referenced the STM32F1)

I also #defined HAL_USE_RTC TRUE in halconf.h

With a little cut/paste I was able to get the RTC example from one of the STM32Fx directories to compile and work (I stripped it down to remove the command shell and serial port etc, it basically just waits a few seconds, sets the RTC then suspends). Lo and behold it resets about 10 seconds later. I'll post to a different thread as I work through low power modes, but the RTC seems to be doing its job just fine :)

thanks

Re: STM32L1 and low power RTC wakeup

Posted: Fri Sep 13, 2013 8:05 am
by Giovanni
Hi,

Thanks for testing, I will enable it by default then.

Giovanni