backup data realtime

Post Reply
tam1111574
Posts: 107
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4
Has thanked: 1 time
Been thanked: 0
Contact:

backup data realtime

Unread post by tam1111574 » Sat May 04, 2019 12:19 pm

Hi Odroid,
I 'm using Odroid Xu4 to my production.
Now I need to find the way to backup data real time suck as counter. Now I save backup data to eMMC each 50 ms after that I run command sync but I think the eMMC can damage in long time.
I need only backup the counter (1 - 20000000). In another my project, I have a RTC IC, I backup counter in some volatile memory in RTC, the RTC can work about 3 year via 3V lion battery.
I see Odroid Xu4 have a lion battery to backup date time, Can I backup counter same as the my method (RTC IC) or another advise for me. ?

Thank and best regards.

User avatar
odroid
Site Admin
Posts: 30667
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 98 times
Contact:

Re: backup data realtime

Unread post by odroid » Tue May 07, 2019 9:36 am

The RTC block is a part of the PMIC S2MPS11.
But there is no scratchpad RAM in the RTC block unfortunately.

You need 25 bits NV-register to save the counter value. Right?
If yes, you can do a little bit complicated bit manipulation with the unused Alarm 1 registers in the RTC block probably.
https://github.com/hardkernel/linux/blo ... sung/rtc.h
These users thanked the author odroid for the post:
tam1111574 (Fri May 10, 2019 12:46 pm)

tam1111574
Posts: 107
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: backup data realtime

Unread post by tam1111574 » Fri May 10, 2019 1:29 pm

Yes.. Odroid, I need only some Non voltage Resister to save the counter.

With the Alarm 1 resgister, How can I use it ?. because I'm newbie in Linux kernel.

User avatar
odroid
Site Admin
Posts: 30667
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 98 times
Contact:

Re: backup data realtime

Unread post by odroid » Fri May 10, 2019 1:59 pm

If you have no experience of kernel driver development, it will be very painful.

Instead of developing a device driver, try to access the Alarm 0 register via /sys/class/rtc/rtc0/wakealarm from user-land application.
https://wiki.odroid.com/odroid-xu4/appl ... _wakealarm

This sample C code would be helpful for implementing a 25bit manipulation via wake.time structure.
https://github.com/karelzak/util-linux/ ... /rtcwake.c

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest