You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

LED with Xilinx Zynq

Linux on Zynq is of course useable for much more sophisticated tasks then controlling a LED, but the basic functions should also be available?

One might think. I did. But not always are the simple things so simple.

But when I tried it the first the time, it ended up in an several days long story.

Step 1: Get some Zynq based board. One my desk was a ZYNQ XC7Z7045-FFG900 based board. That should do? There is a LED on MIO7, so from hardware side, it is prepared. Getting Linux working, well that also simple. Start Vivado, new project, build, export to SDK, add FSBL, build BOOT.BIN, adding u-boot.elf. Done. Works first try.

Does the LED work too?

cd /sys/class
cd leds

and nothing, LED class is not there. Not compiled in. Bad luck.

 

 

Zedboard OOB Design.

The SD Card images delivered with zedboard (and available as OOB SD Card images) include a kernel 3.09 with GPIO-LEDS enabled on MIO7 with default trigger set to MMC (SD Card) activity. Writing none to LED trigger would allow direct programmatic control over MIO7 LED on zedboard (labelled LD9!). 

As newer Linux kernels for Xilinx seem to have the GPIO LED class not enabled by default it may not be possible to use Linux LED class on zedboard (if using standard kernels).

LED with RPi

The user LED on RPi is labelled ACT, and it is controllable directly using Linux LED subsystem, as default it is assigned to SD Card activity, that is why it is labelled "ACT".

First you nee to be root.

sudo -i<ENTER>
password root<ENTER>

set password for root and reboot and log in as root.

cd /sys/class/leds/led0
cat none > trigger

Now we are ready to control the user LED on Raspberry

cat 1 > brightness
cat 0 > brightness
cat heartbeat > trigger

The above 3 lines show how to control the LED on, off and set to blink..! It works that way at least with the NOOBS distribution.

 

  • No labels