Skip to content

Commit

Permalink
Merge pull request #153 from Pratiksha0102/vaaman_develop
Browse files Browse the repository at this point in the history
vaaman: Add instructions for programming FPGA via command line
  • Loading branch information
bojle authored Jun 27, 2024
2 parents 3d7c980 + c5c9323 commit b97947c
Showing 1 changed file with 64 additions and 124 deletions.
188 changes: 64 additions & 124 deletions source/vaaman-fpga.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,130 +4,70 @@
Vaaman FPGA Programming
#########################

The FPGA configuration is stored in a flash IC on the board. The flash
IC is Win-bond's W25Q128. The flash IC is connected to the FPGA via a
SPI bus.

The flash IC can be programmed internally using the `flashcp` tool. This
tool is available in the Vaaman Linux System Images.

or

The flash IC can be programmed externally using the JTAG or SPI
interface. This requires the `USB-to-JTAG` or `USB-to-SPI` Module.

*********************************
Uploading HEX files to Flash IC
*********************************

**To configure the FPGA using the flash IC, follow these steps:**

Hardware Connections
====================

Locate the 10-pin headers on the Vaaman board. These can be found from
the schematic.

Ensure the Vaaman board is powered On.

Connect the USB-to-SPI Module to the Vaaman board.

While connecting the Programmer module, make sure to follow the
indicated color code as shown in the image.

.. image:: _static/images/FPGA_SPI_PROG.webp
:width: 50%

Download the HEX file
=====================

Download the DEMO HEX file from the :ref:`downloads` page.

Unzip the downloaded file.

Programming the Flash IC using Efinity
======================================

Open Efinity 2021.2 or later.

Inside the Efinity IDE

- Refresh USB Target as shown in the image.
- Select the Bitstream file to be programmed. (The bitstream file is
available in the unzipped folder)
- Select the SPI Flash Programming mode. (SPI Active)
- Start the programming process.

.. image:: _static/images/vaaman-efinity-programmer-spi.webp
:width: 50%

Wait for the programming to complete. When the programming is complete,
the FPGA will be configured with the bitstream.

Verify the FPGA configuration
=============================

Once the programming is complete, you will observe the orange LED on the
Vaaman board blinking.

This indicates that the FPGA is configured with the bitstream.

.. image:: _static/images/vaaman-fpga-user-leds.webp
:width: 50%

.. tip::

Additionally, you will notice that the four green LEDs on the Vaaman
board will be blinking in a sequence.

*********************************
Uploading BIT files to Flash IC
*********************************

To upload the BIT file to the flash IC, follow the steps mentioned
below:

Hardware Connections
====================

Locate the 10-pin headers on the Vaaman board. These can be found from
the schematic.

Ensure the Vaaman board is powered On.

Connect the USB-to-JTAG Module to the Vaaman board.

While connecting the Programmer module, make sure to follow the
indicated color code as shown in the image.

.. image:: _static/images/FPGA_JTAG_PROG.webp
:width: 50%

Download the BIT file
=====================

Download the DEMO BIT file from the :ref:`downloads` page.

Unzip the downloaded file.

Programming the Flash using Efinity
===================================

Open Efinity 2021.2 or later.

Inside the Efinity IDE

- Refresh USB Target as shown in the image.
- Select the Bitstream file to be programmed. (The bitstream file is
available in the unzipped folder)
- Select the JTAG Programming mode.
- Start the programming process.

.. image:: _static/images/vaaman-efinity-programmer-jtag.webp
:width: 50%

Wait for the programming to complete. When the programming is complete,
the FPGA will be configured with the bitstream.
.. tab-set::

.. tab-item:: Uploading BIT files to FPGA

To upload the BIT file to the FPGA, follow the steps mentioned
below:

1. Hardware Connections

Locate the 10-pin headers on the Vaaman board. These can be found from
the schematic.

Ensure the Vaaman board is powered On.

Connect the USB-to-JTAG Module to the Vaaman board.

While connecting the Programmer module, make sure to follow the
indicated color code as shown in the image.

.. image:: _static/images/FPGA_JTAG_PROG.webp
:width: 50%

2. Download the BIT file

Download the DEMO BIT file from the `Simple LED Blink Bit Demo <_static/files/sample_led_blink_t120_demo_bit.zip>`_

Unzip the downloaded file.

3. Programming the Flash using Efinity

Open Efinity 2021.2 or later.

Inside the Efinity IDE

- Refresh USB Target as shown in the image.
- Select the Bitstream file to be programmed. (The bitstream file is
available in the unzipped folder)
- Select the JTAG Programming mode.
- Start the programming process.

.. image:: _static/images/vaaman-efinity-programmer-jtag.webp
:width: 50%

Wait for the programming to complete. When the programming is complete,
the FPGA will be configured with the bitstream.

.. tab-item:: Configure fpga from linux command

- Download the HEX file
- Download the DEMO HEX file from `Simple LED Blink Hex Demo <_static/files/sample_led_blink_t120_demo_hex.zip>`_
- Unzip the downloaded file.

- To program the FPGA from the command line, enter the command:

.. code-block:: bash
sudo vaaman-ctl -i <path/to/sample_led_blink_t120_demo_hex.hex>
- You can get the usage information of the vaaman-ctl tool by using the command:

.. code-block:: bash
sudo vaaman-ctl -h
Verify the FPGA configuration
=============================
Expand Down

0 comments on commit b97947c

Please sign in to comment.