How to tell Android to use iMX6 RTC as the alarm?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to tell Android to use iMX6 RTC as the alarm?

2,849 次查看
jeffreychang
Contributor I

I am using iMX6 to build a system based on Android Kit-Kat. On the system I have an external RTC chip which is powered by a separate battery. The external RTC chip does not have an interrupt line connected iMX.

The external RTC chip is registered under /sys/class/rtc/rtc0. I have also enabled CONFIG_RTC_DRV_MXC_V2 to build the rtc-mxc_v2.o.

My question is that how do I let Android know that it should use the iMX internal RTC (/proc/driver/rtc) as the alarm to wake up the system when it is in suspend state? Currently if I set an alarm and suspend the device, the alarm is not fired until I manually wake up the system.

标签 (2)
0 项奖励
回复
6 回复数

2,573 次查看
jeffreychang
Contributor I

Hi Igor,

These are not new questions, I just re-phrased the original questions to make them clearer. But anyway, I have started a new thread https://community.nxp.com/message/995499 .

Thank you.

Jeffrey

0 项奖励
回复

2,573 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Jeffrey

to wake up the system when it is in suspend state, it is necessary

to provide interrupt to processor. Usually it is done using gpio, also some

peripherals can wake, like uart. It is described in sect."UART Operation in System Stop Mode"

i.MX6DQ Reference Manual. Otherwise, there are no ways to wake processor.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,573 次查看
jeffreychang
Contributor I

Hi Igor,

Thank you for the prompt response.

Do you mean that the SRTC on iMX cannot wake up the system when it is in suspend state?

0 项奖励
回复

2,573 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Jeffrey

your question was about external RTC.

SRTC on iMX can wake up.

Best regards
igor

0 项奖励
回复

2,573 次查看
jeffreychang
Contributor I

My question may not be clear enough. Please let me put my questions here again.

Mainly two questions:

  1. When I have both an external RTC and SRTC on iMX enabled on the system, how do I synchronize the SRTC with the external RTC? The time will be kept on external RTC because it is powered by a separate battery so SRTC has to be synchronized with the external RTC.
  2. How do I configure Android so that when it needs to get time, it gets time from the external RTC; and when it needs to set an alarm to wake up the system in suspend, it sets the alarm using the SRTC on iMX not the external RTC.

Thank you.

0 项奖励
回复

2,573 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Jeffrey

 

for new questions recommended to start new thread.

 

Best regards
igor

0 项奖励
回复