backup data realtime

Post Reply
tam1111574
Posts: 109
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4
Has thanked: 4 times
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: 32512
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 183 times
Been thanked: 349 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: 109
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4
Has thanked: 4 times
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: 32512
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 183 times
Been thanked: 349 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 counter manipulation via wake.time structure.
https://github.com/karelzak/util-linux/ ... /rtcwake.c
These users thanked the author odroid for the post:
tam1111574 (Tue May 28, 2019 10:23 pm)

tam1111574
Posts: 109
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4
Has thanked: 4 times
Been thanked: 0
Contact:

Re: backup data realtime

Unread post by tam1111574 » Tue May 28, 2019 11:06 pm

Thank you very much Odroid, I used it to backup data.. I see the value in /sys/class/rtc/rtc0/wakealarm is not lost when I have a CMOS pin.. But Does It have the limit times Read/Write ?..

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

Re: backup data realtime

Unread post by odroid » Wed May 29, 2019 10:11 am

There would be no limitation virtually.
These users thanked the author odroid for the post:
tam1111574 (Thu May 30, 2019 12:22 am)

tam1111574
Posts: 109
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4
Has thanked: 4 times
Been thanked: 0
Contact:

Re: backup data realtime

Unread post by tam1111574 » Thu May 30, 2019 12:22 am

Thank you very much Odroid. You help me save many time :D :D :D :D :D :D :D

User avatar
mad_ady
Posts: 6784
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 215 times
Been thanked: 164 times
Contact:

Re: backup data realtime

Unread post by mad_ady » Thu May 30, 2019 1:48 am

25 bits worth of time to be precise :D

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

Re: backup data realtime

Unread post by odroid » Thu May 30, 2019 9:29 am

tam1111574 wrote:
Thu May 30, 2019 12:22 am
Thank you very much Odroid. You help me save many time :D :D :D :D :D :D :D
Glad to hear I could help you.
BTW, can you tell us what you are making with XU4 roughly?
As far as I remember you are the first user who needs a frequent updating counter in a NV-RAM.
These users thanked the author odroid for the post:
tam1111574 (Thu Jul 18, 2019 7:17 pm)

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: Baidu [Spider] and 0 guests