08-29-2019 03:12 PM - edited 08-29-2019 03:14 PM
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:
and 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.
09-10-2019 05:44 PM
08-29-2019 09:30 PM
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.
08-30-2019 12:06 PM
09-01-2019 01:17 PM
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?
09-02-2019 03:12 AM
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
09-02-2019 04:14 AM
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
09-02-2019 01:01 PM
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.
09-10-2019 09:30 AM
09-10-2019 05:44 PM