LED Blinker (use of the FPGA Bridge)
This Linux demo shows the use of the FPGA Bridge

14 Aug 2017 - 13:59 | Version 8 |


This project relies on a Linux application to blink a few LED's, connected to the SoC, on the FPGA side and on the Hard Processor side. The FPGA is programmed using the Quartus Programmer, and the Linux OS, preloader and u-boot are on an SD card.

The instructions below will take you thru the steps of programming the FPGA, the SD card and fire up the demo.


In order to deploy the demo, you will need the following:
  • the SoCFPGA DevKit (RevB or later) with its power supply,
  • a computer, either running Linux or Windows,
  • SD card image deployment tool, 'dd' on Linux or ImageWriter on Windows (see the section 'Links'),
  • the SiLabs USB-to-Serial adapter drivers (Windows and DevKit RevB only, see the section 'Links'. The Linux kernel v3.0 or later provides the driver, cp210x.ko),
  • a serial terminal, like minicom or teraterm.
  • a microSD card of at least 2GB,
  • an microSD card reader,
  • the Quartus Programmer (see the section 'Links'),
  • Two USB cables,


Board Configuration

Make sure the board jumper shunts and switches are configured as shown on the pictures below. No other jumper shunts are required and shall not be used.

Jumper Shunts

Jumper Shunts

Dip Switches

Dip Switches

Installation of the software components

S/W Component Installation Instructions
Quartus Programmer Run the installer
SiLabs driver See the support page
USB Blaster II driver See the instructions
ImageWriter No installation required, the program can be
executed from any directory

Programming the FPGA

Connect a USB cable to the USB connector J37 (USB Blaster II).

USB Blaster II Connector

Power on the board.

Download the FPGA bit stream attached to this page. Run the following command:

          quartus_pgm -c USB-BlasterII -m jtag -o p;cv_soc_g.sof

Programming the SD card.

Download the SD card image attached to this page and insert it into your SD card reader.

The next step is Operating System specific.

With Linux

Find out which device your SD card has been assigned to. There are different ways to do so, one is shown here:

          user $ cat /proc/partitions

There will be one matching the size of your card. We'll assume the device node is /dev/sdz.

Next, make sure to un-mount any file system that was automatically mounted by your Linux distribution, when the SD card was mounted.

          user $ sudo umount /dev/sdz*

Finally, the SD card image can be deployed to the SD card

          user $ gunzip -c autodemo.img.gz | sudo dd of=/dev/sdz bs=512 conv=fsync

Your SD card is now ready.

With Windows

Uncompress the image file.

Start the utility ImageWriter, see the following screen shot for details.

Screen shot of Image Writer

Once you have selected the image file, select the device letter assigned to the SD card and click 'Write'.

Booting Linux

Insert an SD cable into the USB connector J7 and connect the cable to your PC. Fire up your serial terminal (minicom, teraterm, etc),

Insert the microSD card into the microSD slot and press the warm reset button.

You should see Linux boot messages in the serial terminal.

Once the boot is done, you should see LED's blinking at different frequencies.

Architecture of the demo

Here's the block diagram of the design in the FPGA and its connections to the Hard Processor.

demo architecture

The purpose of the demo is to demonstrate the use of the bridges connecting the FPGA with the Hard Processor (HPS).

There are two bridges used:
  • the high-speed bridge, used to connect the HPS to the memory chips connected to the FPGA (FPGA SDRAM).
    Note that the HPS memory interface could have been used as well,
  • The lightweight bridge is used to access the GPIO's connected to the LED's,
On the HPS side, here's what is used:
  • The HPS GPIO is used to control other LED's,
  • The mass storage used is an SD card,


Item Link Comment
Quartus Programmer https://www.altera.com/download/software/prog-software Utility to program Altera FPGA's. Versions of Linux and
Windows exist. Free of Charge.
USB Blaster II drivers http://www.altera.com/download/drivers/usb-blaster/dri-usb-blaster-vista.html USB Blaster II drivers for Windows 7. Free of charge.
Note that versions for other Windows versions exist.
SiLabs Serial Adapter Drivers Documents/Software/CP210x_VCP_Windows.zip and Documents/Software/an335sw.zip See Silicon Labs' support page for instructions
ImageWriter https://launchpad.net/win32-image-writer Windows Utility, to write and SD card image to an SD card
Free of Charge

Give us your feedback

© 1999-2018 RocketBoards.org by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Privacy.