Very interesting. I can confirm this also works for me. C code that would 
formerly fail with a "Bus Error" accessing GPIO2 and GPIO3 via /dev/mem and 
mmap() has no problems if any GPIO is exported from that bank via SYSFS. It 
would seem that the driver is setting the CLKCTRL on the bank. 

Thanks for this. Besides being a useful way of enabling the CLKCTRL it is 
also one of those tricky little gotchas to watch out for that could make 
code work just fine in a test env but fail seemingly randomly out in the 
world.

On Wednesday, 29 October 2014 18:40:35 UTC, Andrew Henderson wrote:
>
> I have found that accessing GPIOs via mmap() of /dev/mem works without 
> accessing additional control register settings if you export one GPIO pin 
> in each bank so that the GPIO kernel driver "unlocks" each bank and wakes 
> it up.  GPIO1 is awake by default, but you can get the other GPIO0, GPIO2, 
> and GPIO3 working via the following commands:
>
> echo 5 > /sys/class/gpio/export
> echo 65 > /sys/class/gpio/export
> echo 105 > /sys/class/gpio/export
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to