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: 
Adventurer
Adventurer
328 Views
Registered: ‎02-06-2018

Simple LED on Zynq MPSoc

Jump to solution

Hi

I'm studying the architecture of Zynq Ultrascale+ MPSoC and my evaluation board is ZCU111 and I want to perform a task as simple as a blinking LED and I've got to a confusion point.

So far I have understood that, to make a LED blink, you don't really need a FPGA bitstream (for PL) and You need to build petalinux and add gpio drivers and by changing/echoing flags to /sys/class/gpio* you can make a led blink. Is that correct? 

 

How about controling a LED through FPGA bitstream and GPIO IP block? Let's say I have made the following simple design:

Screenshot_2019-08-29_15-06-38.pngand I echo to /sys/class/gpio*. Does it use the design above or I should perform AXI communications with AXI GPIO block to use the actual AXI design shown above?

Can both designs (having GPIO LED drivers in kernel, and GPIO IP block) exist at the same time?

 

In advance, I would thank you for answering these questions. I have got confused.

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
106 Views
Registered: ‎02-06-2018

Re: Simple LED on Zynq MPSoc

Jump to solution
So I finally solved the issue by following:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841846/AXI+GPIO

Now, I can trigger LEDs.
0 Kudos
8 Replies
Moderator
Moderator
284 Views
Registered: ‎06-27-2017

Re: Simple LED on Zynq MPSoc

Jump to solution

Hi @arashr ,

 

Yes, you need bitstream as you have added any IP along with ZynqMP.

Please refer to UG1209 and chapter 6 for system examples which included GPIO.

Also refer below posts which may helpful for you.

https://forums.xilinx.com/t5/Embedded-Boot-and-Configuration/Configuring-GPIO-on-ZYNQ-Ultrascale/td-p/895007

https://forums.xilinx.com/t5/Embedded-Development-Tools/Set-MIO-GPIO-pin-on-ZynqMP-from-FSBL/td-p/804177

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.
0 Kudos
Adventurer
Adventurer
268 Views
Registered: ‎02-06-2018

Re: Simple LED on Zynq MPSoc

Jump to solution
@gudishak these are great! Thank you. I'll go through them and if I could solve my issue, I'll accept your response.
0 Kudos
Adventurer
Adventurer
233 Views
Registered: ‎02-06-2018

Re: Simple LED on Zynq MPSoc

Jump to solution

 

According to the blockdiagram below, APU and PL have access to GPIO independently, so why do I need to have a PL bitstream to operate GPIO? Can't PS operate it without a bitstream?

 

Screenshot_2019-09-01_13-10-39.png

 

 

 

0 Kudos
Moderator
Moderator
211 Views
Registered: ‎09-12-2007

Re: Simple LED on Zynq MPSoc

Jump to solution

There is a PS GPIO on the Zynq Ultrascale Processor Subsystem that you can use to toggle LEDs.

You can enable this in the Vivado IPI

0 Kudos
Moderator
Moderator
204 Views
Registered: ‎09-12-2007

Re: Simple LED on Zynq MPSoc

Jump to solution

Also if you are using Petalinux, then I would recommend using the BSP for the ZCU111 to create the project

petalinux-create -t project -s <path to bsp>.bsp

 

This has the PS GPIO enabled. There is also pre-built images here so you dont need to build the image. You can boot straight away,

and test on your zcu111 board

0 Kudos
Adventurer
Adventurer
181 Views
Registered: ‎02-06-2018

Re: Simple LED on Zynq MPSoc

Jump to solution

Thanks @stephenm . I do use BSP file and I exactly use the petalinux-create command that you suggested to create the petalinux project and yes, GPIOs are active by default.

Following Atlassian.net Linux GPIO Driver which I assume is what you mean by PS GPIO, I still cannot trigger a LED. Here is what I did:

# ls /sys/class/gpio/
export  gpiochip309  gpiochip325  gpiochip499  gpiochip507  unexport

Here I "cat" the label of each of those gpiochips and I get:

#cat /sys/class/gpio/gpiochip309/label -> tca6416
#cat /sys/class/gpio/gpiochip325/label -> zynqmp_gpio
#cat /sys/class/gpio/gpiochip499/label -> /amba_pl@0/gpio@a00c1000
#cat /sys/class/gpio/gpiochip507/label -> /amba_pl@0/gpio@a00c0000

So I chose 325 and did

# echo 325 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio325/direction
# cat /sys/class/gpio/gpio325/direction 
out
# echo 1 > /sys/class/gpio/gpio325/value
# cat /sys/class/gpio/gpio325/value 
0

So the value of the file "value" does not change and no LED is triggered.

0 Kudos
Adventurer
Adventurer
125 Views
Registered: ‎02-06-2018

Re: Simple LED on Zynq MPSoc

Jump to solution
I still haven't been able to figure it out, does anyone have any suggestions?
0 Kudos
Adventurer
Adventurer
107 Views
Registered: ‎02-06-2018

Re: Simple LED on Zynq MPSoc

Jump to solution
So I finally solved the issue by following:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841846/AXI+GPIO

Now, I can trigger LEDs.
0 Kudos