Albert Arquer

trying to access i.MX25 GPIO pins

Discussion created by Albert Arquer on Oct 20, 2011
Latest reply on Apr 28, 2012 by Albert Arquer

Hello again, I am now trying to access de GPIO pins of the i.MX25 PDK through the sysfs system.

(By the way, I would really appreciate it if someone could refer me to some document/tutorial explaining the working principle of this method since it is a bit of a mystery for me)

 

I am doing this on a i.MX25 PDK board (not actually the PDK from freescale but an almost identical one) and for starters, I would like to claim pin D12.

 

The thing is that I have seen in the u-boot code (board_init fuction to be precise) that this pin is actually declared as GPIO even though it is used for the FEC reset or power enable (I don't remember right now). On the board I am using, this pin is left unconnected but the code from u-boot has not been modified so it is still declared as GPIOs.

 

Well they thing is that I tried to use the pin using the typical method using as export index (4-1)*32 + 8 = 104 since the D12 pin is GPIO4[8] and I have not been able to write anything to it (even though the u-boot code really does modify it's value at boot time by asserting a low pulse for 20 us approximately, this indicates me that the pin is free to move up and down as is not a hardware problem).

 

What am i missing? I though about using the mxc_gpio_request function but since I have read on the source code that it is optional and that would require compiling an application I though I would try to avoid using it if possible.

Do I have to modify the boot loader code? is the FECs driver interfering with my calls? (I don't thing so since I really doubt those pins are actually controlled by the FEC module). 

Any ideas?

 

Thanks a lot!

Outcomes