Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: azuolas on October 16, 2013, 11:38:23 AM

Title: GPIO as Output isue
Post by: azuolas on October 16, 2013, 11:38:23 AM
hi,

I am using gpioMMap.h for iMX233-micro GPIO control. I want to use pins 24-27(GPIO 92 91 23 25 according to https://docs.google.com/spreadsheet/ccc?key=0AspkrcYcY5bWdFB6WC1xRlp5bFRjc1hwVnlQZDVmeUE#gid=0 ) as outputs. pins 26 and 27 work fine. pin 25 on startup is in high state. I can change state to low level, but I can't it set back to High level. pin 24 do not take any action. could it be that kernel does not allow to control these pins? I am using default imx23-olinuxino.dts file. if it is not kernel, what should I check?
Title: Re: GPIO as Output isue
Post by: Fadil Berisha on October 16, 2013, 02:23:16 PM
Quote from: azuolas on October 16, 2013, 11:38:23 AM
could it be that kernel does not allow to control these pins? I am using default imx23-olinuxino.dts file.

Hi azuolas,

Yes. Kernel allow you to export pin state on user space only for pins declared on imx23-olinuxino.dts as GPIO. You need to adapt imx23-olinuxino.dts for your needs, recompile dts file and create new image to boot your board.
Does this answer your question?

Fadil Berisha



Title: Re: GPIO as Output isue
Post by: azuolas on October 16, 2013, 06:01:05 PM
thank you Fadil Berisha,

yes, this answer my question where is the problem. but could you point me please, how the imx23-olinuxino.dts file should be modified. I am not quite familiar whit this. in my imx23-olinuxino.dts file I do not see where GPIOs 23, 25 is defined, but they work fine. how should I define GPIOs 91 and 92?
Title: Re: GPIO as Output isue
Post by: Fadil Berisha on October 16, 2013, 09:56:41 PM
Quote from: azuolas on October 16, 2013, 06:01:05 PM
thank you Fadil Berisha,

yes, this answer my question where is the problem. but could you point me please, how the imx23-olinuxino.dts file should be modified.

As answer in your question I wrote mini howto and published on my web blog page:

http://g-lab.ca/how-should-i-define-gpios/

If you  think that my answer were correct or useful in this thread, please mark it with + .

Fadil Berisha
Title: Re: GPIO as Output isue
Post by: azuolas on October 17, 2013, 01:37:04 PM
Thank you,

it is really helpful
Title: Re: GPIO as Output isue
Post by: Fadil Berisha on October 20, 2013, 06:43:13 PM
I am happy to help

Fadil Berisha
g-lab.ca