PLEASE NOTE: This article is obsolete or related to a discontinued product.

Flashing the FOX VHDL FPGA with a new hardware image

by John Crispin

This article explains how you can access the FOX VHDL FPGAs flash directly from the FOX board. No additional hardware is required ! It shows how to program a hardware image built with the Libero suite or downloaded from the ACME Systems archive

The fpga_flash tool

This command line tool is based on the source code provided by ACTEL. It has been simply ported to the Linux kernel and it has been built a small userspace tool for accessing the kernel module. The code provided by ACTEL is a full implementation and hence supports a lot of different actions.

The actions

To see which actions you can take using the tool, simply start it with the option -h
# fpga_flash -h
Usage   : ./fpga_flash -a[ACTION] -f[FILENAME] [-r] [-d]
Actions : program             - Program the device
          erase               - Erase the device
          read_idcode         - Read the devices idcode
          verify              - the devices data
          device_info         - Get the device info
          query_security      - Query the devices security settings
          print_params        - Print parameters
          erase_all           - Erase all data on device
          erase_from          - Erase From only
          program_from        - Program From only
          verify_from         - Verify From only
          program_array       - Program Array only
          erase_array         - Erase Array only
          verify_array        - Verify Array only
          data_authentication - enc_data_authentication
Reboot  : Use the parameter -r to reboot device when we are done
LOG     : Use the parameter -d to show the kernel log when we are done

Using the tool

The use of the tool is very simple. First of all you will need to copy the desired new *.stp file (the hardware image to be flashed inside the FOX VHDL board) into the FOX with scp for example. A good place to store the file inside the FOX is /var.

@idea Fox Board files that resides in /var are located in RAM so they will disappear after reboot .

To program the new stp file in the ACTEL FPGA simply do :

# fpga_flash -aprogram -fnew.stp
# dmesg
This takes exactly 39 seconds. To check if everything went well, you need to check the kernel log using dmesg.

Another useful action is device_info. This will print infos about the ACTEL FPGA to the kernel log.

# fpga_flash -adevice_info -fnew.stp
# dmesg

Additional options

As one needs to check the kernel log after any action to see what has happened, there is an option that automatically calls dmesg. Use the following command form:
# fpga_flash -aprogram -fnew.stp -d
Also, if you want to automatically reboot the system after completion, call the following command :
# fpga_flash -aprogram -fnew.stp -r

The Klone interface tool

To program the hardware image of the FOX VHDL board from the Fox you can also use the Klone web interface. It is a simple web interface that lets you browse your PC disk for the right file to program inside the FOX VHDL and that can start the programming of it inside the FPGA flash memory of the FOX VHDL. So the step of downloading into the Fox Board the *.stp file is not anymore necessary with the Klone interface.

To access the web services of the Klone application example, start your web browser and go to the FOX Board URL:

  • then browse to the *.stp file stored on your PC and click on the b>Flash button.

    The Klone interface offers also a convenient way to access the FoxBone registers inside the FOX VHDL FPGA directly from its web interface: How To change FoxBone registers from the FOX BOARD.