I am using sysfs(linux L3.0.15_12.04.01_ER_source) to set a GPIO as an output with the following commands:
echo 163 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio163/direction
echo 1 > /sys/class/gpio/gpio163/value
I measured the output voltage and it works correctly. The problem is that when I do cat "/sys/class/gpio/gpio163/value". It always returns 0. Any ideas?
I was digging through the gpio driver and the gpio value is read from GPIO_PSR. If I read GPIOX_PSR with memtool also returns 0. Reading GPIO_DR returns the correct value. I am new to the imx.6 family. Is this normal?