AnsweredAssumed Answered

[iMX6SL] [GPIO] How to use the GPIO from userspace

Question asked by Sunny Bhayani on Aug 20, 2015
Latest reply on Aug 20, 2015 by Sunny Bhayani





I want to toggle a free GPIO i.e. GPIO1_14 from userspace /sys/class/gpio.


But when I export this GPIO1_14 by the below steps, I do not see the values getting to '1':


     echo 14 > /sys/class/gpio/export

     echo out > /sys/class/gpio/gpio14/direction

     echo 1 > /sys/class/gpio/gpio14/value


Please do let me know if I need to do anything else for the same.


I am probing the MX6SL_PAD_EPDC_D7_GPIO_1_14 pad on the board.


I went through the below discussion:

Re: Using GPIO's on IMX6 SLEVK


I wrote a kernel module exporting the GPIO1_14, but I am getting seg_fault for the same probably because I need to get a virtual address for this GPIO1_14.

But I am not sure how to get this address in kernel code.