APF9328 APF27 APF51 OPOS6UL SP FPGA configuration: Difference between revisions
From ArmadeusWiki
m (KevinJ moved page APF9328 APF27 APF51 FPGA configuration to APF9328 APF27 APF51 OPOS6UL SP FPGA configuration) |
|||
Line 16: | Line 16: | ||
{{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. <br> For the APF51 and U-Boot versions 2013.04 or later you can also use .bit files with the U-Boot command: <pre class="apf"> BIOS> fpga loadb </pre>}} | {{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. <br> For the APF51 and U-Boot versions 2013.04 or later you can also use .bit files with the U-Boot command: <pre class="apf"> BIOS> fpga loadb </pre>}} | ||
* Load FPGA firmware image file with U-Boot through Ethernet: | * '''Step 1''': instal/copy your firmware to /tftpboot | ||
** manually: <pre class="host"> $ cp myfirmware.bin /tftpboot/apfXX-firmware.bin (where apfXX is the name of your board: apf27, apf51 or apf9328)</pre> | |||
** using the armadeus BSP: <pre class="host"> $ make menuconfig</pre> | |||
*:<pre class="config">Package Selection for the target ---> Armadeus specific tools/utilities ---></pre> | |||
** specify the path to the FPGA firmware: | |||
<pre line class="config"> | |||
[*] 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 | |||
</pre> | |||
**<pre class="host"> $ cp buildroot/output/images/* /tftpboot </pre> | |||
* '''Step 2''': Load FPGA firmware image file with U-Boot through Ethernet: | |||
<pre class="apf"> | <pre class="apf"> | ||
BIOS> tftpboot ${loadaddr} fpgafirmware.bin | BIOS> tftpboot ${loadaddr} fpgafirmware.bin | ||
Line 24: | Line 37: | ||
then you can type the c command to reconnect to the terminal | then you can type the c command to reconnect to the terminal | ||
* Test your new FPGA firmware's downloading: | * '''Step 3''': Test your new FPGA firmware's downloading: | ||
** for .bin binary files <pre class="apf">BIOS> fpga load 0 ${loadaddr} ${filesize}</pre> | ** for .bin binary files <pre class="apf">BIOS> fpga load 0 ${loadaddr} ${filesize}</pre> | ||
** for .bit binary files <pre class="apf">BIOS> fpga loadb 0 ${loadaddr} ${filesize}</pre> | ** for .bit binary files <pre class="apf">BIOS> fpga loadb 0 ${loadaddr} ${filesize}</pre> | ||
=== 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: | |||
<pre class="apf"> | |||
BIOS> run download_firmware | |||
BIOS> run load_firmware | |||
</pre> | |||
=== Autoloading === | |||
When you are satisfied with your firmware, you can write it in flash make it "autoloaded" at power up: | |||
{{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}} | |||
<pre class="apf"> | |||
BIOS> run update_firmware | |||
BIOS> setenv firmware_autoload 1 | |||
BIOS> saveenv | |||
</pre> | |||
{{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 }} |
Revision as of 15:02, 3 October 2025
Configuring from Linux
Please use the FPGA loader linux driver.
Configuring from uBoot
- 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:
- manually:
[*] 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}
- for .bin binary files
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:
BIOS> run update_firmware BIOS> setenv firmware_autoload 1 BIOS> saveenv