AnsweredAssumed Answered

Vybrid GPIO on /sys/class/gpio does not switch properly

Question asked by Johannes Traxler on Feb 26, 2015
Latest reply on Mar 19, 2015 by Timesys Support

I have a GPIO (PTE8 - Pin Nr. 113) exported via the /sys/class/gpio device tree and configured as OUTPUT direction.

From my C-Code I do the following

 

int fd = open ("/sys/class/gpio/gpio113/value", O_WRONLY);

...

while (1)
{
     ...
     write (fd, "1", 1);
     ...
     ...
     write (fd, "0", 1);
     ...
}

 

The problem is, that write() does not work every time. It seems as if the value is not written into the Port-Register of the processor. I did measurements with a scope directly on the processor pin and the value showed 1 after the second write statement in line 11, but it should be 0. In the same step I checked in shell with "cat /sys/class/gpio/gpio113/value" and here the value is also shown as 0. When I then typed "echo 0 > /sys/class/gpio/gpio113/value" in the shell the pin went to 0. I also tried to modify the driver strength in IOMUX to 25Ohm, 50Ohm and 150Ohm and explicitely set OBE to high, but the behaviour is the same - sometimes it work - sometimes not!

 

Do you have an advice for me?

 

Thanks in advance,

Johannes

Outcomes