Command Line Linux Falcon 25.3 - ArrowElectronics/Agilex-5 GitHub Wiki
Quick Start Guide
Build Instructions
Configure the FPGA with a Device Tree Overlay
Release Notes
This Quick Start Guide describes the hardware and software setup needed to run the Yocto Linux Command-Line demo.
In this demo configuration, the Agilex® 5 E boots a Yocto Linux Distribution which uses a terminal emulator to communicate with the user.
To run the Yocto Linux Command-Line demo, follow the steps below:
- Install the Quartus Prime Pro Programmer
- Prepare and install the SD Card.
- Configure the Board for the Demo
- Flash the FPGA configuration file.
- Connect to the HPS target terminal.
- Boot log
- Access FPGA PIO from Linux
- Access FPGA and HPS Bridges
The following components are required for the demo:
- AXE5-Falcon (TEI0183) development board,
- 12VDC 40W power supply
- USB Cable (for the USB Blaster III and the HPS UART)
- 8GB SD card

Depending on the kit revision, additional components may need to be obtained. Please click on this link to review.
The MSEL2 and MSEL1 DIP switches need to be set to the ON position (left) for Boot from QSPI configuration.

- Insert the SD card in the J24 cage, on the right hand of the board.

- Attach the micro-USB cable to UART (J5) connector

- Plug the Arrow-USB-Blaster (TEI0004-02) into J34 with the USB connector facing to the right.

- Connect the power supply to the AXE5-Falcon J29 barrel connector
- Plug the AC-DC adapter into an AC outlet
- Download the FPGA jic image axe5_Falcon_top.hps.jic
Use the Intel Download cable when programming the AXE5-Falcon board from a Linux environment.
The FPGA JTAG chain will expose 1 or 2 devices when auto-detected from the programmer. Follow the appropriate instructions to program the Agilex 5 FPGA for either scenario.
Open a shell (Nios V Command Shell for Windows)
Determine the number of JTAG devices
$ jtagconfig
One JTAG device 1) Arrow-USB-Blaster [ARA31601-TEI0004] 0364F0DD A5E(C065BB32AR0|D065BB32AR0) Two JTAG devices 1) Arrow-USB-Blaster [ARA31601-TEI0004] 4BA06477 ARM_CORESIGHT_SOC_600 0364F0DD A5E(C065BB32AR0|D065BB32AR0)
Option 1: One Device
$ quartus_pgm -c 1 -m jtag -o "pvi;axe5_Falcon_top.hps.jic@1"
Option 2: Two Devices
$ quartus_pgm -c 1 -m jtag -o "pvi;axe5_Falcon_top.hps.jic@2"
Program the device
This will take a few minutes to complete.
- A wired Micro USB serial port connection between the host PC and the embedded target is required
- Launch a terminal program (like Tera Term VT or Putty) and connect using serial port
- Select 115200 baud
- Select the appropriate target COM port
Press the 'NCONFIG' button to boot the demo. This will initiate the following boot process.

- The Secure Device Manager (SDM) will read the jic file. This contains the FPGA image and the U-boot First Stage Boot Loader (FSBL)
- When the FPGA is configured, the SDM will release the Arm processor cluster in the Hard Processing System (HPS) from reset.
- The Arm processor cluster then boots U-boot and Linux from the SD card
- The Linux password is root
RGB_LED2 is connected to a PIO peripheral in the FPGA. This is mapped via the HPS2FPGA Lightweight Bridge (LW HPS2FPGA) to the HPS.RGB_LED2 has been added as an LED device in Linux. This was done with the following lines of code in the Device Tree
View the LEDs as devices
$ ls /sys/class/leds
Illuminate RGB_LED2 - red
$ echo 1 > /sys/class/leds/fpga_led2_red/brightness
Turn off RGB_LED2
$ echo 0 > /sys/class/leds/fpga_led2_red/brightness
Reboot the linux system. Halt at the u-boot prompt
Reload the FPGA core image
$ load mmc 0:1 ${loadaddr} ghrd.core.rbf;
$ fpga load 0 ${loadaddr} ${filesize};
$ bridge enable;
Open Quartus and load the compiled Project
$ File --> Open Project. Select axe5_Falcon_top.
$ Tools --> System Debugging Tools --> System Console

List all JTAG masters
$ get_service_paths master
Select and open the fpga_master
select node 2 for f2h bridge transfers
$ set f2h_f2s_master [lindex [get_service_paths master] 2]
**OR**
select node 3 for f2s bridge transfers
$ set f2h_f2s_master [lindex [get_service_paths master] 3]
$ open_service master $f2h_f2s_master
Write a test pattern (u-boot)
$ mtest 0x84000000 0x84000100 0x12345600 1
Flush the data cache into DRAM (u-boot)
$ dcache flush
Verify the data from HPS (u-boot)
$ md.l 0x84000000 0x40
Verify the data from the FPGA (System Console)
$ master_read_32 $f2h_f2s_master 0x84000000 0x040
Flush the data cache into DRAM (u-boot)
$ dcache flush
Write data from the FPGA to HPS DRAM (System Console)
$ master_write_32 $f2h_f2s_master 0x84000000 0x98765432
Verify the data from HPS (u-boot)
$ md.l 0x84000000 1
Close the jtag master (System Console)
$ close_service master $f2h_f2s_master
FPGA peripherals are connected to a local JTAG master and an LWH2F bridge for HPS master access.
RGB_LED2 is connected to a PIO peripheral in the FPGA. This is mapped to the HPS via the LWH2F Bridge. The LWH2F bridge has a base address of 0x2000 0000 within the HPS memory map. Its span is defined in Platform Designer. The PIO has a local address of 0x0800 0050.
The address of the PIO, accessible from the HPS, is 0x2000 0000 LWH2F Bridge address + 0x0800 0050 PIO offset address in the FPGA ----------- 0x2800 0050
Select and open the fpga_master
select node 0 for access to the FPGA Only JTAG master
$ set fpga_only_master [lindex [get_service_paths master] 0]
$ open_service master $fpga_only_master
Turn on RGB_LED2 - red
$ mw.l 0x28000050 0x03 (u-boot)
Turn on RGB_LED2 - green
$ mw.l 0x28000050 0x05 (u-boot)
Turn on RGB_LED2 - blue
$ mw.l 0x28000050 0x06 (u-boot)
Verify the data from the FPGA (System Console)
$ master_read_32 $fpga_only_master 0x08000050 1
Turn off RGB_LED2
$ mw.l 0x28000050 0x07 (u-boot)
A FPGA External Memory Interface (EMIF) is connected to a local JTAG EMIF master and an H2F bridge for HPS master access. This is mapped to the HPS via the H2F Bridge. The H2F bridge has a base address of 0x4000 0000 within the HPS memory map. Its span is defined in Platform Designer. The EMIF has a local address of 0x0000 0000. A one-gigabyte LPDDR4 device is connected to the EMIF controller in the FPGA.
Select and open the fpga_emif_only_master
select node 1 for access to the FPGA Only JTAG master
$ set fpga_emif_only_master [lindex [get_service_paths master] 1]
$ open_service master $fpga_emif_only_master
Write a test pattern (u-boot)
$ mtest 0x40000000 0x40000100 0x12345600 1
Verify the data from HPS (u-boot)
$ md.l 0x40000000 0x40
Verify the data from the FPGA (System Console)
$ master_read_32 $fpga_emif_only_master 0x00000000 0x040
Write data to the FPGA DRAM (System Console)
$ master_write_32 $fpga_emif_only_master 0x00000000 0x98765432
Verify the data from HPS (u-boot)
$ md.l 0x40000000 1
This build flow is derived from the instructions on the Building Bootloader for Agilex 5 page on RocketBoards
Release Contents
Prerequisites
Set up the Environment
Build the Golden Hardware Reference Design
Build Arm Trusted Firmware
Build u-boot
Build the Linux kernel
Download or Build the Yocto Rootfs
Create an Integrated SOF file
Create an Integrated JIC file
Build the SD Card Image
Downloading via JTAG
| Component | Location | Branch | Tag/Commit ID |
|---|---|---|---|
| GHRD | https://github.com/ArrowElectronics/ghrd-socfpga | master | QPDS25.3_REL_GSRD_PR/d7f20d009cbe3c136f0d7c5058aec52f41742ece |
| Linux | https://github.com/ArrowElectronics/linux-socfpga | socfpga-6.12.11-lts | QPDS25.1_REL_GSRD_PR/b57126d05dcb9abaa5854ae8a866c6499b87d750 |
| U-Boot | https://github.com/ArrowElectronics/u-boot-socfpga | socfpga_v2025.01 | QPDS25.1_REL_GSRD_PR/8f306de87f592181b3cb55c8e224309b6c6ec001 |
| Arm Trusted Firmware | https://github.com/ArrowElectronics/arm-trusted-firmware | socfpga_v2.12.0 | QPDS25.3_REL_GSRD_PR/58e71a6f67a332c9e3cecf7fdaab80fbc3d40238 |
- Host machine running Linux (for Quartus, ATF, U-Boot, Linux & Yocto). Ubuntu 22.04 was used, but other versions may work too. For Quartus only, optionally, a Host Machine running Windows.
- Internet connection to download the tools and clone the repositories from github. If you are behind a firewall you will need your system administrator to enable you to get to the git trees.
- Quartus Prime Pro version 25.3
Open a shell
$ sudo rm -rf agilex_5
$ mkdir agilex_5
$ cd agilex_5
$ export TOP_FOLDER=`pwd`
Download and setup the the toolchain as follows:
$ cd $TOP_FOLDER
$ wget https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz
$ tar xf gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz
$ rm -f gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz
$ export PATH=`pwd`/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/bin:$PATH
$ export ARCH=arm64
$ export CROSS_COMPILE=aarch64-none-linux-gnu-
This can be built under Windows or Linux.
Open a shell (niosv command shell for Windows)
For Linux, specify the path to the Quartus installation
$ export PATH="<path to >/intelFPGA_pro/25.3/quartus/bin64:$PATH"
Clone the repository
$ cd $TOP_FOLDER
$ git clone -b QPDS25.1_REL_GSRD_PR https://github.com/ArrowElectronics/ghrd-socfpga ghrd-socfpga
$ cd ghrd-socfpga/axe5_falcon_ghrd
Open Quartus and load the Project
$ File --> Open Project. Select axe5_falcon_top.
Add pin assignments
$ View --> Console
$ In the Tcl Console window type 'source sources/axe5_falcon_pin_assignment.tcl' and press Enter
Compile the Quartus project
$ Processing --> Start Compilation
The following file is created:
- $TOP_FOLDER/ghrd-socfpga/axe5_Falcon_ghrd/output_files/axe5_falcon_top.sof
$ cd $TOP_FOLDER
$ rm -rf arm-trusted-firmware
$ git clone -b QPDS25.3_REL_GSRD_PR https://github.com/ArrowElectronics/arm-trusted-firmware arm-trusted-firmware
$ cd arm-trusted-firmware
$ make -j 48 PLAT=agilex5 bl31
The following file is created:
- $TOP_FOLDER/arm-trusted-firmware/build/agilex5/release/bl31.bin (used for u-boot.itb generation)
$ cd $TOP_FOLDER
$ rm -rf u-boot-socfpga
$ git clone -b QPDS25.3_REL_GSRD_PR https://github.com/ArrowElectronics/u-boot-socfpga u-boot-socfpga
$ cd u-boot-socfpga
enable dwarf4 debug info, for compatibility with arm ds
$ sed -i 's/PLATFORM_CPPFLAGS += -D__ARM__/PLATFORM_CPPFLAGS += -D__ARM__ -gdwarf-4/g' arch/arm/config.mk
only boot from SD, do not try QSPI and NAND
$ sed -i 's/u-boot,spl-boot-order.*/u-boot\,spl-boot-order = \&mmc;/g' arch/arm/dts/socfpga_agilex5_axe5_falcon-u-boot.dtsi
disable NAND in the device tree
$ sed -i '/&nand {/!b;n;c\\tstatus = "disabled";' arch/arm/dts/socfpga_agilex5_axe5_falcon-u-boot.dtsi
link to atf
$ ln -s ../arm-trusted-firmware/build/agilex5/release/bl31.bin
build U-Boot
$ make clean && make mrproper
$ make socfpga_agilex5_defconfig
use created custom configuration file to merge with the default configuration obtained in .config file.
$ ./scripts/kconfig/merge_config.sh -O . -m .config config-fragment-Falcon
$ make -j 64
The following files are created:
- $TOP_FOLDER/u-boot-socfpga/u-boot.itb
- $TOP_FOLDER/u-boot-socfpga/spl/u-boot-spl-dtb.hex
Download and compile Linux
$ cd $TOP_FOLDER
$ rm -rf linux-socfpga
$ git clone -b QPDS25.3_REL_GSRD_PR https://github.com/ArrowElectronics/linux-socfpga linux-socfpga
$ cd linux-socfpga
add arrow dts folder as Makefile option
$ sed -i '$ a subdir-y += arrow' arch/arm64/boot/dts/Makefile
$ make defconfig
use created custom configuration file to merge with the default configuration obtained in .config file.
./scripts/kconfig/merge_config.sh -O ./ ./.config ./config-fragment-falcon
make oldconfig
$ make -j 64 Image && make arrow/socfpga_agilex5_axe5_falcon.dtb
The following files are created:
- $TOP_FOLDER/linux-socfpga/arch/arm64/boot/Image
- $TOP_FOLDER/linux-socfpga/arch/arm64/boot/dts/arrow/socfpga_agilex5_axe5_falcon.dtb
The rootfs has been built and can be downloaded from the links below. Download both files and place them in the following folder
- $TOP_FOLDER/yocto/build/tmp/deploy/images/agilex5/
core-image-minimal-agilex5.rootfs-20240513114121.tar.gz
core-image-minimal-agilex5.rootfs.tar.gz
Use these instructions on Rocketboards to build the Rootfs. This is useful if you'd like to customize packages included in the rootfs.
The following file is created:
- $TOP_FOLDER/yocto/build/tmp/deploy/images/agilex5/core-image-minimal-agilex5.rootfs.tar.gz
This section presents how to add the FSBL to the SOF file which is the output of the hardware project compilation. This creates a new SOF file which can be used to configure the device through the Quartus Programmer. This is useful during development, as it takes much less time than writing a configuration image to QSPI.
$ export PATH="<path to >/intelFPGA_pro/25.3/quartus/bin:$PATH"
$ cd $TOP_FOLDER/ghrd-socfpga/axe5_falcon_ghrd/output_files/
$ quartus_pfg -c axe5_Falcon_top.sof axe5_falcon_top_hps.sof -o hps_path=$TOP_FOLDER/u-boot-socfpga/spl/u-boot-spl-dtb.hex
$ open a Nios V Command Shell
$ cd <path to>/ghrd-socfpga/axe5_falcon_ghrd/output_files/
$ copy u-boot-spl.ihex from the linux host to the output_files directory
$ quartus_pfg -c axe5_falcon_top.sof axe5_Falcon_top_hps.sof -o hps_path=u-boot-spl-dtb.hex
This section shows how to take the integrated sof file and create a jic file that can be programmed into the SDM QSPI flash. Note that downloading a sof file will not support the functionality of the linux reboot command or the HPS COLD RESET due to SDM requirements. It is useful to flash the QSPI when these functions are necessary.
$ export PATH="<path to >/intelFPGA_pro/25.3/quartus/bin64:$PATH"
$ cd $TOP_FOLDER/ghrd-socfpga/axe5_falcon_ghrd/output_files/
$ quartus_pfg -c axe5_Falcon_top.sof axe5_falcon_top.jic -o hps=on -o device=MT25QU02G -o flash_loader=A5ED065BB32AE5SR0 -o hps_path=$TOP_FOLDER/u-boot-socfpga/spl/u-boot-spl-dtb.hex -o mode=ASX4
$ open a Nios V Command Shell
$ cd <path to>/ghrd-socfpga/axe5_falcon_ghrd/output_files/
$ copy u-boot-spl.ihex from linux host to the output_files directory
$ quartus_pfg -c axe5_Falcon_top.sof axe5_Falcon_top.jic -o hps=on -o device=MT25QU02G -o flash_loader=A5ED065BB32AE5SR0 -o hps_path=u-boot-spl-dtb.hex -o mode=ASX4
The following files are created:
- $TOP_FOLDER/ghrd-socfpga/axe5_Falcon_ghrd/output_files/axe5_falcon_top.hps.jic
- $TOP_FOLDER/ghrd-socfpga/axe5_Falcon_ghrd/output_files/axe5_falcon_top.core.rbf (rename it to ghrd.core.rbf)
The Agilex™ 5 device has two JTAG device IDs for the ARM SoC and FPGA respectively. The Secure Device Manager will determine whether to expose one or both.
Determine the number of JTAG devices.
$ jtagconfig
Two devices: 1) Arrow-USB-Blaster [ARA31601-TEI0004] 4BA06477 ARM_CORESIGHT_SOC_600 0364F0DD A5E(C065BB32AR0|D065BB32AR0) One device: 1) Arrow-USB-Blaster [ARA31601-TEI0004] 0364F0DD A5E(C065BB32AR0|D065BB32AR0) Substitute @n below with @1 for one device and @2 for two devices.
Download the sof.
$ quartus_pgm -c 1 -m jtag -o "p;axe5_falcon_top_hps.sof@n"
Flash the QSPI. Use the Intel Download cable when programming the AXE5-Falcon board from a Linux environment.
$ quartus_pgm -c 1 -m jtag -o "pvi;axe5_falcon_top.hps.jic@n"
Determine the device associated with the SD card on the host. Run the command below before and after inserting the SD card. The new drive letter will show up as /dev/sdx/ where x represents the actual letter (a,b,c,d etc). Substitute the letter x with the actual letter in the dd commands listed below.
$ cat /proc/partitions
$ cd $TOP_FOLDER
$ sudo rm -rf sd_card && mkdir sd_card && cd sd_card
$ wget https://releases.rocketboards.org/release/2020.11/gsrd/tools/make_sdimage_p3.py
$ # remove mkfs.fat parameter which has some issues on Ubuntu 22.04
$ sed -i 's/\"\-F 32\",//g' make_sdimage_p3.py
$ chmod +x make_sdimage_p3.py
$ mkdir fatfs && cd fatfs
$ cp $TOP_FOLDER/ghrd-socfpga/axe5_falcon_ghrd/output_files/ghrd.core.rbf .
$ cp $TOP_FOLDER/u-boot-socfpga/u-boot.itb .
$ cp $TOP_FOLDER/linux-socfpga/arch/arm64/boot/Image .
$ cp $TOP_FOLDER/linux-socfpga/arch/arm64/boot/dts/arrow/socfpga_agilex5_axe5_falcon.dtb .
$ cd ..
$ mkdir rootfs && cd rootfs
$ sudo tar xf $TOP_FOLDER/yocto/build/tmp/deploy/images/agilex5/core-image-minimal-agilex5.rootfs.tar.gz
$ cd ..
$ sudo python3 make_sdimage_p3.py -f \
-P fatfs/*,num=1,format=fat32,size=512M \
-P rootfs/*,num=2,format=ext3,size=512M \
-s 1024M \
-n sdcard.img
$ sudo chmod 777 sdcard.img
$ cd ..
Use dd utility to write the SD image to the SD card. Substitute the letter x with the actual drive letter discovered above.
$ sudo dd if=$TOP_FOLDER/sd_card/sdcard.img of=/dev/sdx bs=1M status=progress
Flush the changes to the SD card.
$ sudo sync
$ cd $TOP_FOLDER/u-boot-socfpga
comment out default bootcommand
$ sed -i 's|CONFIG_BOOTCOMMAND=|# &|' config-fragment-falcon
add new bootcommand. no reference to fpga peripherals
$ echo 'CONFIG_BOOTCOMMAND="mmc rescan; mw.l 10d13224 14; mw.l 10d13228 14; mw.l 10d1323c 14; mw.l 10d13234 14; mw.l 10d13248 14;
mw.l 10d1324C 14; mw.l 0x10D11028 0x01027fb0 1; mw.l 0x10c03304 0x410 1; mw.l 0x10c03300 0x00000410; mw.l 0x10c03300 0x00000000;
mw.l 0x10c03300 0x00000410; fatload mmc 0:1 82000000 Image;fatload mmc 0:1 86000000 socfpga_agilex5_axe5_falcon.dtb;
setenv bootargs console=ttyS0,115200 root=\${mmcroot} rw rootwait;booti 0x82000000 - 0x86000000"' >> config-fragment-falcon
build U-Boot
$ make clean && make mrproper
$ make socfpga_agilex5_defconfig
use created custom configuration file to merge with the default configuration obtained in .config file.
$ ./scripts/kconfig/merge_config.sh -O . -m .config config-fragment-falcon
$ make -j 64
$ cd $TOP_FOLDER/linux-socfpga
omit the ghrd devicetree
$ sed -i 's|#include "socfpga_agilex_ghrd.dtsi"|// &|' arch/arm64/boot/dts/arrow/socfpga_agilex5_axe5_falcon.dts
disable the emac routed through the fpga
$ sed -i '/&gmac0 {/,/}/{s/status = "okay"/status = "disabled"/}' arch/arm64/boot/dts/arrow/socfpga_agilex5_axe5_falcon.dts
modify the defconfig to support overlays
$ make defconfig
use created custom configuration file to merge with the default configuration obtained in .config file.
$ ./scripts/kconfig/merge_config.sh -O ./ ./.config ./config-fragment-falcon-overlay
$ make -j 64 Image && make arrow/socfpga_agilex5_axe5_falcon.dtb && make arrow/overlay.dtb
create the /lib/firmware directory on the linux partition of the SD card
copy the following files to the /lib/firmware directory on the linux partition of the SD card
$ ghrd.core.rbf
$ overlay.dtb
copy the updated u-boot file to the FAT partition of the SD card
$ u-boot.itb
copy the updated linux files to the FAT partition of the SD card
$ Image
$ sopcfpga_agilex5_axe5_falcon.dtb
$ overlay.dtb
load the overlay
$ mkdir /sys/kernel/config/device-tree/overlays/0
$ cd /lib/firmware/
$ echo overlay.dtb > /sys/kernel/config/device-tree/overlays/0/path
access the fpga led
$ devmem2 0x28000030 w 0x06
access the system id peripheral
$ devmem2 0x28000000 w
- Quick Start
- Added "Access FPGA and HPS Bridges" section
- Build
- Changed boot operation from FPGA first to HPS first.
- HPS EMAC2 enabled. To enable in linux, edit /etc/network/interface and reboot to utilize.
- U-boot build flow modified.
- defconfig - uses standard socfpga_agilex5_defconfig file plus custom config fragment for customization.
- config fragment defines custom bootcommand for the Falcon board.
- boot script flow removed.
- Linux build flow modified.
- defconfig - uses standard defconfig file plus custom config fragment for customization.
- kernel.itb flow removed.
- Added "Configure the FPGA with a Device Tree Overlay" section