12-26-2018 07:23 AM
We want to access to an AXI-GPIO module in a Ultrasale plus(ZCU102) plattform using a Petalinux OS. Following the tutorial in the Xilinx wiki, we tried the following command:
echo 511 > /sys/class/gpio/export
There were not any problem with the command above. However when we tried to run the next command the system gets completely stuck and we have to reboot the board manually.
echo out > /sys/class/gpio/gpio511/direction
We have seen that in recent versions of Petalinux there were some changes in GPIO access with spinlock protection.
We want to know, how to access to a GPIO from the user space.
01-01-2019 02:58 PM
gpio511 doesn’t seem correct. I would expect gpio504 perhaps?
Anyway, Can you do a ls /sys/class/gpio? You should see
export gpiochip330 gpiochip5xx unexport
Where gpiochip5xx would be your axi gpio controller. However, to see what controller this corresponds to, you can read the label. For example
to see the amount of pins on this controller
then to toggle a pin
echo 504 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio504/direction
echo 1 > /sys/class/gpio/gpio504/value
01-10-2019 04:20 AM
I checked everything and it is listed, the gpio 511, the value of GPIO is correct(1), However when i tried to do the echo out command all the system hangs.
I dont know what more i can do.