RTC

[中文]

1. Overview

The real-time clock records time; on BK7258 the AP exposes read/NTP interfaces only (single hardware instance, id=0).

See: RTC Driver Guide

2. Code Path

  • Demo: components/bk_cli/cli_aon_rtc.c

  • Driver: ap/middleware/driver/rtc/aon_rtc_driver_64bit.c

3. CLI Reference

Required configuration:

NAME

Description

File

value

CONFIG_AON_RTC

Enable RTC support

ap/middleware/soc/bk7258/bk7258_ap.defconfig

y

Commands:

Command

Param

Description

aon_rtc_get_time {id}

RTC id

Read RTC tick

aon_rtc_time_of_day set {sec|usec}

sec/usec

Set time-of-day

aon_rtc_time_of_day get

none

Get time-of-day

4. Demo

Example:

cpu1 aon_rtc_get_time 0

[16:48:06.968]Send→◇cpu1 aon_rtc_get_time 0
[16:48:06.974]Recv←◆cpu1 aon_rtc_get_time 0
os:I(337790):create shell_handle, tcb=28086ff0, stack=[280853c8-28086fc8:7168], prio=5
$cpu1:cli:I(337655):id=0, tick_h=0 tick_l=337792 ms