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
9,418 Views
Registered: ‎01-10-2014

Blink LEDs in Linux on Zynq through /dev/mem

Jump to solution

Hello everyone!

I have Linux booted on my Zynq Mini ITX board.

I've added axi_gpio IP to my design and wrote an .xdc file so that its outputs are assigned to LEDs present on my board. But when I write to axi_gpio's base address through /dev/mem, nothing happens and my LEDs do not flash.

Is there something else I should do before it works?

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
15,315 Views
Registered: ‎01-21-2014

Re: Blink LEDs in Linux on Zynq through /dev/mem

Jump to solution

The first thing I would do is load up a standalone application and verify that you can access the LED's that way. If you can, at least you know your hardware is setup correcty. If that works, then you should be able to use /dev/mem or even the Linux gpio driver. There are many example of touching various HW registers in the PL out there, it's pretty straightforward. 

 

Regards, 

Terry

 

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
15,316 Views
Registered: ‎01-21-2014

Re: Blink LEDs in Linux on Zynq through /dev/mem

Jump to solution

The first thing I would do is load up a standalone application and verify that you can access the LED's that way. If you can, at least you know your hardware is setup correcty. If that works, then you should be able to use /dev/mem or even the Linux gpio driver. There are many example of touching various HW registers in the PL out there, it's pretty straightforward. 

 

Regards, 

Terry

 

0 Kudos
Adventurer
Adventurer
9,406 Views
Registered: ‎01-10-2014

Re: Blink LEDs in Linux on Zynq through /dev/mem

Jump to solution
Thank you,
I was a bit too fast asking this question. I managed to do this using uio according to this tutorial:
http://fpgacpu.wordpress.com/2013/05/28/how-to-design-and-access-a-memory-mapped-device-part-two/
0 Kudos
Visitor nymitr
Visitor
9,361 Views
Registered: ‎06-17-2014

Re: Blink LEDs in Linux on Zynq through /dev/mem

Jump to solution

linux kernel has driver to leds connected to gpio lines.  https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/leds-gpio.txt

 

0 Kudos
Adventurer
Adventurer
9,301 Views
Registered: ‎03-27-2014

Re: Blink LEDs in Linux on Zynq through /dev/mem

Jump to solution

Does this require any changes to PL? Can the Linux kernel drive the LEDs on ZC706 with just the PS? Any pointers? Thanks!

0 Kudos
Adventurer
Adventurer
9,295 Views
Registered: ‎01-10-2014

Re: Blink LEDs in Linux on Zynq through /dev/mem

Jump to solution

I connected my Zynq PS to output pins via axi_gpio. So you have to connect axi_gpio to PS via axi_interconnect core and then make axi_gpio output ports external. You will also have to assign them to hardware LED ports in .xdc. I did it on Zynq Mini ITX board according to this design:

Embedded Standalone OS (Bare-Metal) Reference Design ITX

from this page:

http://zedboard.org/support/design/2056/17

 

You will also have to make a device tree entry for your axi_gpio leds. It's written how to do that in the tutorial I've posted above.

0 Kudos