AnsweredAssumed Answered

Accessing gpio_bd pins with sysfs on zc702

Question asked by mredfield on Sep 7, 2016
Latest reply on Sep 12, 2016 by larsc

I'm using an FMCOMMS5 board with the ZC702.

 

I set it up based on the instructions here:

https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/quickstart/zynq

 

I have linux running from an SD card, and IIO Scope works well. Now I'd like to use some of the ZC702s switches and LEDs for debug purposes.

 

I tried getting access to them through sysfs, but I'm having issues with that. To start with, I just tried to turn on the LED connected to PMOD2_1.

 

According to 'hdl\projects\common\zc702\zc702_system_constr.xdc', this should be connected to gpio_bd[6]. I then got the base gpio number by checking gpiochip:

 

# ls /sys/class/gpio/gpiochip*
gpiochip906

 

So the base is 906, and gpio_bd[6] should be 906+6. I then try:

 

# echo 912 > /sys/class/gpio/export 
# echo out > /sys/class/gpio/gpio912/direction
# echo 1 > /sys/class/gpio/gpio912/value

 

But I don't see the corresponding LED light up. I've tried similar things with other gpio, and also tried using the gpio connected to buttons and switches as inputs, but I haven't had any success.

 

What am I doing wrong here?

Outcomes