Reading raw register
sucotronic at gmail.com
Tue Sep 27 10:28:09 EDT 2011
Thank you so much Werner :D Hopy some day I will enough skilled to reply
this questions by myself and help other people with it. Using the sample
from the openmoko has allowed me finally to determine why my Alarm clock
program didn't work; it was related with the "HIBERNATE Wakeup Control
Register" that by default its value is 0, but if you set to 1 and also set
the alarm of the RTC, the Nanonote is able to wake up by itself 'magically'.
Maybe it has to be modified the way the alarm is set, because apart of that
bit, I've found also that if I set two times the alarm (for example, with
the command echo $ALARM > /sys/class/rtc/rtc0/wakealarm) the "RTC Control
Register" get reset the Alarm related bits.
On Tue, Sep 27, 2011 at 2:41 PM, Werner Almesberger
<werner at almesberger.net>wrote:
> Suco wrote:
> > Bus error
> That's probably mmap failing and returning MAP_FAILED aka (void *) -1.
> You should check for this. If you're too lazy to check, you
> can see what happens if you run the program under "strace".
> To keep mmap happy, you need to calculate PageAddress correctly
> and maybe also increase the length to PAGE_SIZE.
> The calculation of PageAddress should probably be
> PageAddress = (off_t) hw_addr - PageOffset;
> You may also want to declare the pointer you get as "volatile".
> > I'm forgetting to add some kind of offset in the address?
> Yes, that too :-) You forgot to add PageOffset to hw_addr.
> (Careful about the item size !)
> Here's a simple read/write program that works also on the Ben:
> - Werner
> Qi Hardware Discussion List
> Mail to list (members only): discussion at lists.en.qi-hardware.com
> Subscribe or Unsubscribe:
Mi blog personal:
Sé libre, usa ubuntu:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the discussion