set GPIO of i.mx6q-sbd BSP3.14.28 problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

set GPIO of i.mx6q-sbd BSP3.14.28 problem

Jump to solution
686 Views
zhenli
Contributor II

hello

   I'm   trying  to set GPIO of  i.mx6q-sbd ,BSP 3.14.28,but don't know how to do it.

   i don't have any idea about device tree,any examples i can learn to setup?

      

Thank you .

Labels (3)
0 Kudos
1 Solution
425 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Zhen Li,

I would recommend looking at the following documents regarding device tree configuration, which are very easy interesting and easy to follow and probably will serve as a starting point for configuring your device tree.

Basic Device Tree for the Udoo Board

You may also find the following thread useful, it is related to the i.MX51 but the device tree logic remains the same.

Re: i.MX51 Device Tree GPIO as output

I hope this helps!

Regards,

View solution in original post

0 Kudos
2 Replies
426 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Zhen Li,

I would recommend looking at the following documents regarding device tree configuration, which are very easy interesting and easy to follow and probably will serve as a starting point for configuring your device tree.

Basic Device Tree for the Udoo Board

You may also find the following thread useful, it is related to the i.MX51 but the device tree logic remains the same.

Re: i.MX51 Device Tree GPIO as output

I hope this helps!

Regards,

0 Kudos
425 Views
zhenli
Contributor II

hello gusarambula

     Thanks for your help.it's helpful!!!

     I know how to set GPIO now,but how to use it after that?

     I shuold add driver file or code so that  can created to make a GPIO entry available for applications?which files?

  

     "However, this only sets up the mux and pad control.  It does not set up the GPIO state (input vs. output, current pin level, etc.).  For that, it looks like you have to wait for the kernel to come up.  In order to expose a GPIO to user space, you must first "export" it by writing the pin number you want exported to /sys/class/gpio/export.  This in turn creates a subdirectory named /sys/class/gpio/gpio<nn>, where <nn> is the pin number.  In there are various files that let you configure the GPIO pin the way you need it.  However, everything under /sys is owned and writable only by root, so you (probably) need to make those entries writable by non-privileged applications."

     Re: i.MX51 Device Tree GPIO as output

   I can't find /sys/class/gpio/export in my code.

   What should i do now?

  

   Thank you very very very very much!

0 Kudos