View Single Post
Old 08-04-2022, 08:11 AM   #79
bzar
Junior Member
bzar began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2022
Device: Kobo Aura
I'm trying to utilize the RTC on my Kobo Aura to use it as an info display for HomeAssistant.

Since I'm making an application for this, I skipped using rtcwake altogether and just ioctl the rtc0 device directly.

I have a simple test program to figure out how to suspend and wake reliably, but the RTC does not seem to work like linux docs expect it to. Basically I'm running into the same issue as pizzamonster above. dmesg shows my test program correctly sets an alarm for 10 seconds and unmasks the interrupts, but when the alarm should happen my `read` from rtc0 does not return like it should based on https://man7.org/linux/man-pages/man4/rtc.4.html ("RTC functionality", last paragraph). I've tried suspending to memory instead of reading from the device but it won't wake up either.

My test program is here https://gist.github.com/bzar/f7bbdd0...8c3a4408c8054c

It hangs on line 86, waiting for the read.

Here's the relevant dmesg output for running the program.
Code:
read_alarm: 0 70/0/1 0:0:0
[mxc_rtc_alarm_enable-253]
[msp430_setalarm-798] alarm 10
read_alarm: 1 122/7/4 11:52:10
[mxc_rtc_alarm_enable-253]
[msp430_setalarm-798] alarm 10
TPS65185 temprature data = 0x1a,26
mxc_epdc_fb mxc_epdc_fb: hist_stat = 0x8, new waveform = 0x4
[ntx_get_battery_vol-1843] 88,bat=997
[msp_int-1883] MSP430 interrupt triggered !!!
bzar is offline   Reply With Quote