GPIO not functioning..

Hi all,
I have a beagleboard clone [DEV 3530] .. i compiled the kernel given
by them according to the instructions in the manual..

i wrote a shell script as follows:

echo 72 > /sys/class/gpio/export

while [ "1" = "1" ]; do
echo "high" > /sys/class/gpio/gpio72/direction
sleep 2
echo "low" > /sys/class/gpio/gpio72/direction
sleep 2

echo 72 > /sys/class/gpio/unexport

this code is getting executed but, i could not see any output on

i built my angstrom for a different board [ omp3evm ], but the kernel
is built for the same board, does it have any issues with gpio



echo 72 > /sys/class/gpio/export
echo “out” > /sys/class/gpio/gpio72/direction
echo “1” > /sys/class/gpio/gpio72/value
echo 72 > /sys/class/gpio/unexport

Thanks and Regards

Thanks and regards

some one’s help is needed…

Could you please also show an example for input?

Set digital or analog?
Analog out?


@Nikhil, i made the changes said by you.
But, still i could not see any output.
What must have gone wrong?

possibile error…

Hi yaswanth,

I suspect you are not doing the PINMUX configuration…
You have to select the PINMUX so that the GPIO’s are selected and then follow the steps explained by nikhil…

hope this helps…

lokesh Kumar

I do not believe that there is any problem with the PIN mux.
Yaswanth, you should probably take a look at the following website:

There is a brief explanation with nice examples and how to use the
GPIOs in Linux.

@Fredrico, i had written my code following that link … but, i still get the error.
@ lokesh, how do we pinmux it? Doesn’t kernel take care of that ? Do we need to do it ourselves?

Thank you

For selecting particular gpio pin the following steps to be done

  1. set the pinmux value for particular GPIO pin. you can get pinmux values from
    Ref. guide .
  2. Then follow below steps

echo 72 > /sys/class/gpio/export
echo “out” > /sys/class/gpio/gpio72/direction
echo “1” > /sys/class/gpio/gpio72/value
echo 72 > /sys/class/gpio/unexport

hope this helps …

yeah. But, how to do it in shell scripting?
GPIO Documentation doesn’t give any info about pinmux… does it?

You could do pinmux setting in the shell script with the devmem2 utility.
See following blog post, which explains it. It's all really in Ref.Guide.

Hope this helps,

Hi Yaswanth

Yes … the GPIO Documentation will not give you any information about pinmux…
You have to search in the Reference Guide or any other Documentation which explains about PINMUX of that processor usually it should be in Reference Guide…

and if you want to initalize pinmux in shell scripting then you have devmem command which you can use it…

Thankyou, i will let you guys know the result after i try using devmem