UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor rtapiador
Visitor
282 Views
Registered: ‎06-07-2018

ZCU-102 GPIO ACCESS WITH PETALINUX

Hello,

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.

2018.2
Summary:

  • gpio: zynq: protect direction in/out with a spinlock

We want to know, how to access to a GPIO from the user space.

Kind Regards

 

Kind Regards.

0 Kudos
2 Replies
Moderator
Moderator
117 Views
Registered: ‎09-12-2007

Re: ZCU-102 GPIO ACCESS WITH PETALINUX

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

cat /sys/class/gpio/gpiochip504

to see the amount of pins on this controller

cat /dts/class/gpio/gpiochip504/ngpio

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

0 Kudos
Visitor rtapiador
Visitor
67 Views
Registered: ‎06-07-2018

Re: ZCU-102 GPIO ACCESS WITH PETALINUX

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.

0 Kudos