HAL Library 24- RTC for STM32Fxxx

RTC library was ported to HAL drivers for STM32Fxxx line from my previously library RTC for STM32F4xx. If features similar things as before except some functions were changed, which are already described in HAL API.

Library

Read more about new HAL libraries

Features

  • Support Internal or external clock source
    • PC14 and PC15 pins are used for external crystal oscillator
    • STM32F4/429 Discovery does not have RTC crystal onboard. Check board’s manual on how to set it up
  • Support wakeup interrupt
  • Support to set 2 internal alarms to trigger interrupts
  • they can also wake up STM32Fxxx from any low power mode
  • Get seconds from 01.01.1970 00:00:00
  • Get readable time from seconds from 01.01.1970 00:00:00
  • Support to save/get data in binary or BCD format
  • Support for read/write data to/from RTC backup registers
  • Support for subsecond
  • Support to write data in string format
  • Date and time are checked before saved for valid input data
  • Get days in month and year

Dependencies

  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h configuration file
    • attributes.h

Functions and enumerations

Full functions list can be found on HAL API section.

Examples

Projects are available on Github, download all libraries below.

tilz0R

Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...

Read before commenting!

Before you make a new comment, make sure you agree with things listed below:

  • - Read post to make sure if it is already posted what you are asking for,
  • - Make sure you have the latest version of libraries used in your project,
  • - Make a clean and grammatically correct written message,
  • - Report as many details as possible, including what have you done so far,
  • - Do NOT post any code here. Use Pastebin,
  • - Do NOT post any error codes here. Use Pastebin,
  • - Specify STM32Fxxx family and used Discovery/EVAL/Nucleo or custom made board,
  • - Make sure your clock is set correct for PLL,
  • - If you are using my HAL drivers, please check this post how to start.
Comment will be deleted on breaking these rules without notification!