I am using Beagle board xm A3 which running with ubuntu 12.04 but when i am trying to read GPIO( e.g. expansion connector signal GPIO_157) using user or driver method.I am not able to read GPIO port.
So please let me know how can i read GPIO port from Expansion connector of Beagle Board xm using ubuntu? (Beagle Board xm reference manual page 108 )
I can’t give you really detailed help, but I hope I can provide enough to point you the right way.
You need to be sure the pin is configured to read by setting the pin Mux (as root), that the pin is exported via sysfs, and that the user that is trying to read the pin has read permission (I think that is the default, but you should double-check). The hardest part (I think) is figuring out what the pin is called by the OS for setting the Mux; my guess from the SRM (I have a Beaglebone, not the BB xm) is that it is /sys/kernel/debug/omap_mux/mcbsp1_fsr , but you will have to have a look and see. I set the pin mux on boot from /etc/rc.local. My Beaglebone-specific /etc/rc.local, which uses P8_04 for digital output and P8_11 for digital input is excerpted here:
`
Keep in mind that any examples for Angstrom may not work verbatim for Ubuntu, because usually the code you write is executed as the root user on Angstrom and therefore issues pertaining to file permissions are absent. There may be more BB xm -specific information out there; I just know that sometimes I had to extrapolate from what I read pertaining to the Beageboard to Beaglebone for my uses.