cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
618 Views
Registered: ‎10-10-2018

zcu102 pmod emio gpio linux sysfs

Hello,

I have a zcu102 board and I want to use pmod (J55_1 as PMOD_0) as output direction.

I've perfomed the link from pmod to zynq as gpio emio. I want to add the support to linux gpio driver to use it.

Computation of gpio id as follow : 

We found in another thread that 338 is the base pin (not sure)
 
Bank 0 = 0 - 25 (MIO 0 - 25)
Bank 1 = 26 - 51 (MIO 26 - 51)
Bank 2 = 52 - 77 (MIO 52 - 77)
Bank 3 = 78 - 109 (EMIO 0 - 32)
Bank 4 = 110 - 141 (EMIO 33 - 64)
Bank 5 = 142 - 173 (EMIO 65 - 95)
 
So, the pin would be base_gpio + offset, or 338 + 78 = 416.
 
I've exported th gpio to user space
 
echo 416 > /sys/class/gpio/export
 
I can see /sys/class/gpio/gpio416 exported and direction is "out".
 
But, when i branch the scope , I can see that level is always set as "0".
When i do :
$>echo 1 > /sys/class/gpio/gpio416/value
$> cat  /sys/class/gpio/gpio416/value
0
 
The value is always "0" and voltage level doesn't changes.
 
Am i wrong on this computation ? can you help me please .
 
Thanks

 

 

 

 

 

0 Kudos
5 Replies
Highlighted
Xilinx Employee
Xilinx Employee
555 Views
Registered: ‎11-05-2019

 

Hello @chepner 

I can turn on the LED of ZCU102, using EMiO0.

Xilinx Wiki Linux GPIO Driver

 

# echo 416 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio416/direction
# echo 1   > /sys/class/gpio/gpio416/value

 

You may be able to narrow down the cause, if you check the design, pin assignment, IOSTANDARD.

- block design -

Capture.PNG

- xdc -

 

set_property IOSTANDARD LVCMOS33 [get_ports LED];
set_property PACKAGE_PIN AG14 [get_ports LED];

 

 

- petalinux flow -

 

$ petalinux-create -t project --template zynqMP --name XXX
$ cd XXX
$ petalinux-config --get-hw-description=<HDF Dir>
$ petalinux-build
$ petalinux-package --boot -fsbl ./zynqmp_fsbl.elf --fpga ./system.bit --u-boot ./u-boot.elf

copy BOOT.bin and image.ub to SDcard.

 

Thank you


Ka2ki
Don't forget to reply, kudo, and accept as solution.

0 Kudos
Highlighted
Contributor
Contributor
482 Views
Registered: ‎10-10-2018

hi @katsuki ,

That's exactely what we've done.

Before moving to linux and his complexity related, we try to run a standelone application to test if our ID and referancing are good but no luck.

Can you share with me a standelone application expample to target a PMOD using emio for zynq ultrascale + ?

---

Thanks

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
471 Views
Registered: ‎11-05-2019

 

Hi @chepner 

 

As you proceed with the development, it is better to get over yourself.

First of all, you can try LED on ZCU102 instead of PMOD.

 

Thanks,


Ka2ki
Don't forget to reply, kudo, and accept as solution.

0 Kudos
Highlighted
Contributor
Contributor
419 Views
Registered: ‎10-10-2018

Hi @katsuki ,

I've tried LED over this pin but no luck nothing happened.

Do you have any other suggestion please ?

Thanks

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
388 Views
Registered: ‎11-05-2019

 

Hello @chepner 

 

It seems that the GPiO setting of PS or the setting of XDC pin are wrong.

If you are familiar with the Baremetal app, such as Hello World, you should check with the Baremetal app before checking with Petalinux.

 

Thank you


Ka2ki
Don't forget to reply, kudo, and accept as solution.

0 Kudos