Difference between revisions of "RTC overview"

[unchecked revision] [quality revision]
m
m

This article gives information about the Linux® RTC framework. The RTC framework is involved in precise time countdown.

1 Framework purpose[edit]

The RTC is used in standby mode to keep keeps the system time up to date or and can wake up the system from the standby power mode at a programmed time.

A general presentation of the RTC framework is available in the Linux RTC documentation [1].

2 System overview[edit]

2.1 Component description[edit]

  • RTC (hardware)
RTC dedicated hardware block in STM32MPU product.
  • rtc-stm32
RTC ST driver.
  • rtc
Linux RTC framework, it provides API to RTC driver and interfaces to user.
  • Sysfs interface
Sysfs interface is accessible via /sys/class/rtc/rtcX/.
  • Procfs interface
Procfs interface is accessible via /proc/driver/rtc.
  • Char device interface
Device interface is accessible via /dev/rtcX.
  • User application
The user application can be an user built application or an community application like hwclock.

2.2 API description[edit]

API is described in Linux RTC documentation [1].

3 Configuration[edit]

3.1 Kernel Configuration[edit]

Activate rtc-stm32 driver in kernel configuration using the Linux Menuconfig tool: Menuconfig or how to configure kernel

Device drivers  --->
    -*- Real Time Clock  --->
        <*> STM32 RTC

3.2 Device tree configuration[edit]

Please refer to the RTC device tree configuration.

4 How to use the framework[edit]

Please refer to the How to use the RTC.

5 How to trace and debug the framework[edit]

5.1 How to trace[edit]

Dynamic debug traces can be added using the following commands:

echo -n 'file rtc-stm32.c +p'>/sys/kernel/debug/dynamic_debug/control

6 Source code location[edit]

7 References[edit]


This article gives information about the Linux<sup>&reg;</sup> RTC framework. The RTC framework is involved in precise time countdown.

== Framework purpose ==
The RTC is used in standby mode to keep system time up to date or wake up system at programmed time.<BR><BR>

{{ReviewsComments|FDE w36. Suggesting: The RTC keeps the system time up to date and can wake up the system from the standby power mode at a programmed time}}
.<BR><BR>

A general presentation of the RTC framework is available in the Linux RTC documentation <ref name="Linux RTC documentation">{{CodeSource | Linux kernel | Documentation/admin-guide/rtc.rst | Linux RTC documentation}}</ref>.

== System overview ==

[[File:Contributors:rtc_overview.png | center | upright=4 | alt=Alternate text | RTC framework overview | link=]]

=== Component description ===
* '''RTC (hardware)'''
: RTC dedicated hardware block in STM32MPU product.

* '''rtc-stm32'''
: RTC ST driver.

* '''rtc'''
: Linux RTC framework, it provides API to RTC driver and interfaces to user.

* '''Sysfs interface'''
: Sysfs interface is accessible via /sys/class/rtc/rtcX/.

* '''Procfs interface'''
: Procfs interface is accessible via /proc/driver/rtc.

* '''Char device interface'''
: Device interface is accessible via /dev/rtcX.

* '''User application'''
: The user application can be an user built application or an community application like hwclock.

=== API description ===
API is described in Linux RTC documentation <ref name="Linux RTC documentation">{{CodeSource | Linux kernel | Documentation/admin-guide/rtc.rst | Linux RTC documentation}}</ref>.

== Configuration==
=== Kernel Configuration ===
Activate '''rtc-stm32''' driver in kernel configuration using the Linux Menuconfig tool: [[Menuconfig or how to configure kernel]]
 Device drivers  --->
     -*- Real Time Clock  ---><*> STM32 RTC

=== Device tree configuration ===
Please refer to the [[RTC_device_tree_configuration | RTC device tree configuration]].

==How to use the framework==
Please refer to the [[How_to_use_the_RTC | How to use the RTC]].

==How to trace and debug the framework==
=== How to trace===
Dynamic debug traces can be added using the following commands:
 echo -n 'file rtc-stm32.c +p'>/sys/kernel/debug/dynamic_debug/control

==Source code location==
*rtc-stm32: {{CodeSource | Linux kernel | drivers/rtc/rtc-stm32.c}}
*api: {{CodeSource | Linux kernel | include/linux/rtc.h}}
*framework:
** {{CodeSource | Linux kernel | drivers/rtc/class.c}}
** {{CodeSource | Linux kernel | drivers/rtc/dev.c}}
** {{CodeSource | Linux kernel | drivers/rtc/interface.c}}
** {{CodeSource | Linux kernel | drivers/rtc/lib.c}}
** {{CodeSource | Linux kernel | drivers/rtc/proc.c}}
** {{CodeSource | Linux kernel | drivers/rtc/sysfs.c}}
*device-tree bindings constants: {{CodeSource | Linux kernel | include/dt-bindings/rtc/rtc-stm32.h}}

==References==<references />

<noinclude>

[[Category:RTC|0]]
{{PublicationRequestId | |  2019-01-28 | Automatic approval (article under construction)}}
{{ArticleBasedOnModel|Framework overview article model}}</noinclude>
Line 2: Line 2:
   
 
== Framework purpose ==
 
== Framework purpose ==
The RTC is used in standby mode to keep system time up to date or wake up system at programmed time.
+
The RTC keeps the system time up to date and can wake up the system from the standby power mode at a programmed time.
 
<BR><BR>
 
<BR><BR>
{{ReviewsComments|FDE w36. Suggesting: The RTC keeps the system time up to date and can wake up the system from the standby power mode at a programmed time}}
 
   
 
A general presentation of the RTC framework is available in the Linux RTC documentation <ref name="Linux RTC documentation">{{CodeSource | Linux kernel | Documentation/admin-guide/rtc.rst | Linux RTC documentation}}</ref>.
 
A general presentation of the RTC framework is available in the Linux RTC documentation <ref name="Linux RTC documentation">{{CodeSource | Linux kernel | Documentation/admin-guide/rtc.rst | Linux RTC documentation}}</ref>.