APF9328 APF27 APF51 OPOS6UL SP FPGA configuration: Difference between revisions

From ArmadeusWiki
No edit summary
No edit summary
Line 2: Line 2:
[[Category: APF27]]
[[Category: APF27]]
[[Category: APF51]]
[[Category: APF51]]
[[Category: OPOS6UL_SP]]
[[Category: FPGA]]
[[Category: FPGA]]



Revision as of 15:35, 3 October 2025


Test bitstream

  • The FPGA bitstreams are all located in the firmware/ directory of your Armadeus BSP sources:
 $ ls firmware/
 apf_pkg  BRAMTest  bus_led  led  PS2  PS2_Opencore  servo  sram_test  wishbone_example  Xtools
  • You can make some trials with the firmware/leds/blinking_led/bin/ files.


Configuring from Linux

Please use the FPGA loader linux driver.

Warning Warning: For APF51, please use binary format .bin, bitstream format .bit doesn't work.


Configuring from uBoot

Warning Warning: for the APF9328, please check that your bitfile size is smaller than the firmware partition size (256KB) before trying the following commands or you may corrupt your Linux kernel FLASH partition !!!


Note Note: For the APF51 and U-Boot versions earlier than 2013.04, only binary file format (.bin) can be used; do not try .bit file.
For the APF51 and U-Boot versions 2013.04 or later you can also use .bit files with the U-Boot command:
 BIOS> fpga loadb 


  • Step 1: instal/copy your firmware to /tftpboot
    • manually:
       $ cp myfirmware.bin /tftpboot/apfXX-firmware.bin (where apfXX is the name of your board: apf27, apf51 or apf9328)
    • using the armadeus BSP:
       $ make menuconfig
    Package Selection for the target  --->   Armadeus specific tools/utilities  --->
    • specify the path to the FPGA firmware:
[*] FPGA Firmware 
      Firmware to install (Install a custom FPGA firmware)  --->
 ($(TOPDIR)/../firmware/leds/blinking_led/bin/blinking_led_apf27_200k.bit) FPGA binary file path
[*]   Export this file to Buildroot images folder
    •  $ cp buildroot/output/images/* /tftpboot 
  • Step 2: Load FPGA firmware image file with U-Boot through Ethernet:
 BIOS> tftpboot ${loadaddr} fpgafirmware.bin

fpgafirmware.bin is of course the name of your bitfile stored in your TFTP shared directory (/tftpboot/)

then you can type the c command to reconnect to the terminal

  • Step 3: Test your new FPGA firmware's downloading:
    • for .bin binary files
      BIOS> fpga load 0 ${loadaddr} ${filesize}
    • for .bit binary files
      BIOS> fpga loadb 0 ${loadaddr} ${filesize}

Using U-Boot scripts

For your convenience a set of U-Boot script to facilitate firmware management with the APF boards:

  • download_firmware: assuming your firmware is in /tftpboot and name apfXX-firmware.bin (where apfXX is the name of your board apf27, apf51, apf9328..) will download the firmware in RAM with the command: run download_firmware
  • flash_firmware: save the previously downloaded firmware from RAM into the flash.
  • update_firmware: will execute the previous 2 scripts in sequence.
  • load_firmware: read a firmware from the flash (there is dedication partition named firmware for this purpose) and load it into the FPGA.

Download and test your firmware image with:

 BIOS> run download_firmware
 BIOS> run load_firmware

Autoloading

When you are satisfied with your firmware, you can write it in flash make it "autoloaded" at power up:

Warning Warning: Before setting the firmware_autoload variable, be sure that your FPGA binary file is correct. If not, your board will hang up at U-Boot start and you will need to cancel the fpga download to take control of the board. see note below
 BIOS> run update_firmware
 BIOS> setenv firmware_autoload 1
 BIOS> saveenv
Note Note: (U-Boot 2012.04) you can manually cancel the firmware autoload using the following procedure: keeping <CTRL-C> pressed on the console and power up the board will start the board without downloading the FPGA firmware - This procedure can be helpfull if you have programmed a broken firmware