The purpose of this article is to cross-compile a demo for the ARM in the HPS of the DE-25 FPGA Dev Kit
Please refer to the previous article Part 6 where the ARM Cross Compiler was installed in a Linux host before proceeding with this article. Make sure all the files from the SoC directory are present from the examples in the SoC of the resources CD from Part 1. In this case we will be covering the hps_lcd,
with the following demo files,
font.c gpio_lib.h LCD_Driver.c lcd_graphic.h LCD_Hw.c LCD_Lib.h main.c Makefile font.h gpio_lib.c hps_lcd.map LCD_Driver.h lcd_graphic.c LCD_Hw.h LCD_Lib.c terasic_os_includes.h
For illustration purposes of this demo, only modify the main.c program to use the desired text to be displayed in the LCD display.
In order to cross-compile this demo please proceed with the following command,
digikey_coffee_cup: ~$ export CROSS_COMPILE=aarch64-none-linux-gnu-
Now proceed with make as shown next,
digikey_coffee_cup: ~$ make
aarch64-none-linux-gnu-gcc -g -O0 -Werror -Wall -c main.c -o main.o
aarch64-none-linux-gnu-gcc -g -O0 -Werror -Wall -c font.c -o font.o
aarch64-none-linux-gnu-gcc -g -O0 -Werror -Wall -c LCD_Driver.c -o LCD_Driver.o
aarch64-none-linux-gnu-gcc -g -O0 -Werror -Wall -c lcd_graphic.c -o lcd_graphic.o
aarch64-none-linux-gnu-gcc -g -O0 -Werror -Wall -c LCD_Hw.c -o LCD_Hw.o
aarch64-none-linux-gnu-gcc -g -O0 -Werror -Wall -c LCD_Lib.c -o LCD_Lib.o
aarch64-none-linux-gnu-gcc -g -O0 -Werror -Wall -c gpio_lib.c -o gpio_lib.o
aarch64-none-linux-gnu-gcc -g -O0 -Werror -Wall main.o font.o LCD_Driver.o lcd_graphic.o LCD_Hw.o LCD_Lib.o gpio_lib.o -o hps_lcd
aarch64-none-linux-gnu-nm hps_lcd > hps_lcd.map
In order to run this ARM executable in the HPS in the DE-25 FPGA Dev Kit. Proceed to copy the hps_lcd binary via SSH to the DE-25 FPGA Dev Kit from the Linux host via SSH the WiFi Router as outlined in a previous article Part 5. The following scp command copies the file from the Linux host to the DE-25 HPS via SSH (Please change the IP address and path as needed),
digikey_coffee_cup: ~$ scp hps_lcd terasic@192.168.1.131:/home/terasic/SoC
Execute the ARM binary for the HPS in the SSH or PuTTY terminal connection as desired,
The LCD now displays the message as expected. This completes the HPS demo for the LCD in the DE-25 FPGA Dev Kit. The DE-25 FPGA Dev Kit is a powerful platform featuring an HPS/FPGA Agilex 5 (available as D-Series and E-Series depending on the case) capable of implementing Tensor AI slices,
that go beyond what traditional/classical old school DSP slices implemented in the past,
and it is available at DigiKey.
Have a wonderful day!




