any reason not to expect /sys/class/gpio/ not to work with ubuntu? my pin stays high, even after "echo 0 > ..."

BeagleBoardxM with Ubuntu from

http://elinux.org/BeagleBoardUbuntu#Demo_Image

I'm trying to control a pin on the expansion header, following both

http://blog.makezine.com/2009/02/03/blinking-leds-with-the-beagle-board/

and

http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#Getting_access_to_a_GPIO

Indeed, I have /sys/class/gpio/

but not /sys/class/gpio/gpio168. No problem,

# echo 168 > export
# ls
...
gpio168
# cd gpio168
# echo "out">direction
# echo "0" value
0 value
# echo "1" value
1 value

but in all cases I measure 1.8 V on pin 24.

I did not mess with the mux, but neither did the two instructions above (makezine and avrfreaks). Should I have?

How can I verify what the mux settings are?

What am I doing wrong?

Michael

The default mux has most pins configured in their mode 0, instead of GPIO mode.
You can try using one of the pins that are GPIO by default, 157-159,
161-162, or 136-139. 136-139 can also work as inputs.
See beagle.h for default mux:
http://git.denx.de/?p=u-boot.git;a=blob;f=board/ti/beagle/beagle.h;hb=HEAD
And you can check what your current pin config is in /sys/kernel/debug/omap_mux
Pin names: http://www.elinux.org/BeagleBoardPinMux#Pin_Mux_Cross_Reference_Table
and in the beagleboard manual
The only way to change the mux is to recompile:
http://www.elinux.org/BeagleBoardPinMux#Setting_Mux_Through_u-boot
The tutorial doesn't do mux because the pin 168 used to be configured
as GPIO before, but has been changed to mode 0 since then.

Thanks. I'll test this, and I'll also try to get the authors of those
other two pages (one is a friend) to update theirs.

Hi Igor,

Your solution was exactly what I needed. I summarized my results and documented your input here, in case it is of use to others:

http://michaelshiloh.pbworks.com/w/page/51941968/BeagleBoard