Mimas Artix 7 FPGA Development Board

Programming Mimas A7 using OpenOCD and XC3SProg in Windows

2400 views November 22, 2018 jyothi-as 3

Programming Mimas A7 using OpenOCD

What is OpenOCD?

OpenOCD stands for Open On-Chip Debugger. It is open-source software that supports debugging a wide variety of chips, devices, and boards using a range of supported debug interfaces. If you find a device that is not supported by OpenOCD, being open-source software, you can add support for that device in OpenOCD yourself and submit patches so that your improvements can be merged into OpenOCD for others to use. OpenOCD is used for debugging as well as in-system programming for embedded target devices. The Mimas A7 FPGA Development Board features a high-speed USB 2.0 interface that is connected to FPGA IC’s JTAG signals. So, Mimas A7 can be programmed using its onboard USB interface using OpenOCD, without the need for a separate external JTAG programmer.

SRAM Programming

The following steps will walk you through the process of configuring the Mimas A7 board using OpenOCD.

Step 1:

Download and extract the latest Windows version of OpenOCD from its website http://openocd.org to a suitable location in your system.

Step 2:

To program Mimas A7 through its USB interface, “WinUSB” drivers need to be installed instead of the default drivers installed by Windows. To install “WinUSB” drivers, download and run the latest version of “Zadig“. Go to Options click “List all devices” and select it.

Select “Mimas A7 FPGA Module(Interface 1)” as shown in the image below.

Step 3:

Select “WinUSB” drivers in the target driver to replace the “FTDIBUS” drivers. Click “Replace Driver” to install WinUSB drivers as follows.

You will see the following message if drivers were installed correctly.

Step 4:

Download numato_mimasa7.cgf from here. Save the downloaded “numato_mimasa7.cfg” file to the “openocd/scripts/board” directory.  Open Command Prompt or PowerShell in the “bin-x64” directory which is located in “openocd” folder.

Step 5:

Use the following command in Command Prompt or PowerShell to program FPGA. You need to replace <bitstream file> with the actual location of your .bit file. OpenOCD should show output similar to the image shown below if the programming process is finished successfully.

openocd.exe -f board/numato_mimasa7.cfg -c "init" -c "pld load 0 <bitstream file>" -c "shutdown"

Congratulations on successfully programming your bitstream to Mimas A7 using OpenOCD, without the need for any external JTAG hardware.

Flash Programming

Step 1: Initialization

Follow Step 1 to Step 4 from SRAM Programming using OpenOCD. Download the required JTAG SPI proxy bitstream for Mimas A7 (bscan_spi_xc7a50t.bit) to acquire the details of the onboard flash memory from here.

Step 2: Flash Programming Mimas A7 using OpenOCD

Connect Mimas A7 FPGA Development Board to the PC using aUSB Type-B cable. Run the following command in the terminal. Replace <proxy_bitstream> with the downloaded JTAG SPI proxy bitstream path. Also, replace <bitstream_file_path> with the actual .bin file path and <addr> with the offset address that the bitstream needs to be programmed onto the flash memory.

openocd.exe -f board/numato_mimasa7.cfg -c "init" -c "jtagspi_init 0 <proxy_bitstream>" -c "jtagspi_program <bitstream_file_path> <addr>"  -c "shutdown"

Recycle the power of Mimas A7 and it will boot the program from the flash memory. And that’s it we have successfully flash programmed Mimas A7 using OpenOCD.

To change the drivers back to FTDI USB drivers follow these steps:

Open Device Manager-> Universal Serial Bus Devices, select Mimas Artix 7 FPGA Module, right-click and select “Uninstall device”. In the “Uninstall Device” dialog window, select “Delete the driver software for this device.” and click “Uninstall”.


Scan for hardware changes to verify that USB Serial Converter A now comes under “Universal Serial Bus Controllers”.

 

Programming Mimas A7 using XC3SProg

What is XC3SProg?

XC3SProg is software for programming a wide variety of chips, devices, and boards. XC3SProg reads a .bit file generated by an FPGA design tool, and programs .bit into the configuration RAM of an FPGA. The Mimas A7 FPGA Development Board features a high-speed USB 2.0 interface that is connected to FPGA IC’s JTAG signals. So, Mimas A7 can be programmed using its onboard USB interface using XC3SProg, without the need for a separate external JTAG programmer.

Note: Before moving on to the section of how to configure Mimas A7 using XC3SProg, make sure that  Mimas A7 FTDI drivers are properly installed. Refer Driver Installation section of Mimas A7 User Manual to install drivers.

SRAM Programming

The following steps will walk you through the process of configuring the Mimas A7 board using XC3SProg.

Step 1:

Download XC3SProg for Mimas A7 from here to a suitable location in your system.

Step 2:

Open Command Prompt or PowerShell in the folder where you have downloaded the XC3SProg.

Step 3:

Use the following command in Command Prompt or PowerShell to program FPGA. You need to replace <bitstream file> with the actual location of your .bit file. XC3SProg should show output similar to the image shown below if the programming process finished successfully.

xc3sprog.exe -c mimas_a7 <bitstream_file>

Congratulations on successfully programming your bitstream to Mimas A7 using XC3SProg, without the need of any external JTAG hardware.

Flash Programming

Step 1: Initialization

Follow the steps 1 and 2 from SRAM Programming using xc3sprog.

Step 2: Flash Programming Mimas A7 using xc3sprog

Connect Mimas A7 FPGA Development Board to the Linux system using a USB Type-B cable. Run the following commands in the terminal. Replace <bitstream_file_path> with the actual.bit file path that is to be programmed to the flash memory.

xc3sprog -c mimas_a7 bscan_spi/bscan_mimas_a7_xc7a50tfgg484.bit
xc3sprog -c mimas_a7 -I <bitstream_file_path>

Recycle the power of Mimas A7 and it will boot the program from the flash memory. And that’s it we have successfully flash programmed Mimas A7 using xc3sprog.

 

 

Was this helpful?

Leave A Comment
*
*