[DONE] STM32L1 and low power RTC wakeup

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

[DONE] STM32L1 and low power RTC wakeup

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32L1 and low power RTC wakeup

Post 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
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: STM32L1 and low power RTC wakeup

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32L1 and low power RTC wakeup

Post by Giovanni »

Hi,

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

Giovanni
Post Reply