Visible to Intel only — GUID: ewa1404735806345
Ixiasoft
Visible to Intel only — GUID: ewa1404735806345
Ixiasoft
1.5.2. Creating an SD Flash Card Image
The steps below describe the procedure for creating the linux_sd_card_image.tgz image from the Golden System Reference Design (GSRD) SD flash card image:
- Download and unpack the GSRD SD flash card image version 17.0 from Rocketboards.org.
- Mount the file allocation table (fat32) and extended file system (ext3) partitions in this image as loop-back devices. To mount a partition, perform the following steps:
- Determine the byte start of the partition within the image by invoking the /sbin/fdisk -lu image_file command.
For example, partition number 1 of type W95 FAT has a block offset of 2121728. With 512 bytes per block, the byte offset is 512 bytes x 2121728 = 1086324736 bytes.
- Identify a free loop device (for example, /dev/loop0) by typing the losetup -f command.
- Assuming /dev/loop0 is the free loop device, assign your flash card image to the loop block device by invoking the losetup /dev/loop0 image_file -0 1086324736 command.
- Mount the loop device by invoking the mount /dev/loop0 /media/disk1 command.
Within the image file, /media/disk1 is now a mounted fat32 partition.
- Repeat steps a to d for the ext3 partition.
- Determine the byte start of the partition within the image by invoking the /sbin/fdisk -lu image_file command.
- Download the Cyclone V SoC FPGA version of the Intel® FPGA Runtime Environment for OpenCL package from the Download Center on the Altera website.
- Click the Download button beside Intel® Quartus® Prime software edition.
- Specify the release version, the operating system, and the download method.
- Click the Additional Software tab, and select to download Intel® FPGA Runtime Environment for OpenCL Linux Cyclone V SoC TGZ.
- After you download the aocl-rte-<version>.arm32.tgz file, unpack it to a directory that you own.
- Place the unpacked aocl-rte-<version>.arm32 directory into the /home/root/opencl_arm32_rte directory on the ext3 partition of the image file.
- Delete the hardware folder(s) of your Custom Platform, and then place the Custom Platform into the board subdirectory of /home/root/opencl_arm32_rte.
- Create the init_opencl.sh file in the /home/root directory with the following content:
export INTELFPGAOCLSDKROOT=/home/root/opencl_arm32_rte export AOCL_BOARD_PACKAGE_ROOT=$INTELFPGAOCLSDKROOT/board/<board_name> export PATH=$INTELFPGAOCLSDKROOT/bin:$PATH export LD_LIBRARY_PATH=$INTELFPGAOCLSDKROOT/host/arm32/lib:$LD_LIBRARY_PATH insmod $AOCL_BOARD_PACKAGE_ROOT/driver/aclsoc_drv.ko
The SDK user runs the source ./init_opencl.sh command to load the environment variables and the OpenCL Linux kernel driver.
- If you need to update the preloader, the DTS files, or the Linux kernel, you need the arm-linux-gnueabihf-gcc compiler from the SoC EDS. Follow the instructions outlined in the Intel® SoC FPGA Embedded Design Suite User Guide to acquire the software, recompile them, and update the relevant files on the mounted fat32 partition.
Attention: It is most likely that you need to update the preloader if your Custom Platform has different pin usages than those in c5soc.Remember:
If you recompile the Linux kernel, recompile the Linux kernel driver with the same Linux kernel source files. If there is a mismatch between the Linux kernel driver and the Linux kernel, the driver will not load. Also, you must enable the CMA.
Refer to Recompiling the Linux Kernel for more information.
- Compile the hello_world OpenCL example design using your Custom Platform support. Rename the .rbf file that the Intel® FPGA SDK for OpenCL™ Offline Compiler generates as opencl.rbf, and place it on the fat32 partition within the SD flash card image.
You can download the hello_world example design from the OpenCL Design Examples page on the Altera website.
- After you store all the necessary files onto the flash card image, invoke the following commands:
- sync
- unmount /media/disk1
- unmount <ext3_partition_directory>
where <ext3_partition_directory> is the directory name you use for mounting the ext3 partition in 2 (for example, /media/disk2).
- losetup -d /dev/loop0
- losetup -d /dev/loop1
- Compress the SD flash card image by invoking the following command:
tar cvfz <my_linux_sd_card_image>.tgz linux_sd_card_image
- Deliver the <my_linux_sd_card_image>.tgz file inside the root directory of your Custom Platform.
- To test your SD flash card image, perform the following tasks:
- Write the resulting uncompressed image onto a micro SD flash card.
- Insert the micro SD flash card into the SoC FPGA board.
- Power up the board.
- Invoke the aocl diagnose utility command.