GPIO access from userspace denied

Hey everyone,

I have a very simple issue I think. I’ve been playing around with the gpio ports from userspace using sysfs.

I’ve been running 2.6.28-omap1 a version that I got from special computing when I first bought my sdhc card. I only use that one when I need something that works already. Using that version I had created a script to access the port 149 and port 7 on the beagleboard.

echo 149 > /sys/class/gpio/export
echo “in” > /sys/class/gpio/gpio149/direction
echo 1 > /sys/class/gpio/gpio149/value

You guys know the drill. So my script simply activates the usr1 led when I press on the user button. Pretty simple stuff and it works on that kernel version.

Now I’ve build angstrom using openembedded. Kernel 2.6.29-r35 and Angstrom-console-image-glibc-ipk-2009-stable filesystem. When I load this and run this same script I can’t get access port 149 and 7 anymore. I’ve tried others like 148 and this one works.

I know that port 7 is user button and port 149 is usr1 led. So what I’m thinking it might be something relate to the fact that those port are being currently used I can’t export them but I haven’t found any info backing up this idea

Would anyone know what I could do to get this running with my version of angstrom. I’ve verified that CONFIG_GENERIC_GPIO=y and it is. What am I doing wrong here? I worked with the older version with not with .29 .

I know that it’s not the script that’s behaving wrong since I also have a compiled c version of that same code and that one doesn’t work either. Also if I look at the return value after manually doing this command “echo 7 > /sys/class/gpio/export; echo $?” I get a 1.

Thanks for the help everyone.


I think that the led and the user button are not mapped as GPIO, but
as led and button in /sys/class.

So in kernel 2.6.28-omap1 there we mapped as GPIO and in 2.6.29 they are not? Because my script works on the old kernel.

So if I wanted to create a kernel module to play around with these, would port 149 and 7 look the same at the kernel layer? Meaning could I play around with them as I do with port 148 for example?