Skip to content

AD463x Platform Build Update the SD Card

d-samal edited this page Mar 11, 2022 · 2 revisions

In the previous sections methods are described to build the FPGA image, the Linux kernel, the Linux devicetree and finally the Preloader and uboot images. These files must be copied to the SD card in order for the system to boot. The following steps describe how to implement this. The instructions below assume that a partitioned SD card is being used.

Table of Contents

  1. Insert the SD card adapter
  2. Prepare and Install the SD Card
  3. Copy the Preloader and uboot images to the SD card
  4. Copy the FPGA image to the SD card
  5. Copy the Linux kernel image to the SD card
  6. Copy the devicetree file to the SD card
  7. Eject the SD card adapter

Insert the SD card adapter

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
  • Insert the Micro SD Card into the USB to Micro SD card Adapter.

  • Plug the USB Adapter into the host PC.

  • The VM will detect the Adapter and ask the user to choose where it should be connected

      Choose "Connect to a virtual machine" and select OK
    

Two file manager windows will open in the VM. The first called BOOT represents the FAT partition. The second called rootfs represents the Linux root file system partition. Close this partition (by clicking on the 'X' in the top left part of the window) since it will not be utilized

Prepare and Install the SD Card

Copy the root filesystem to the SD card

Exercise caution: dd targeted at an incorrect drive letter can brick your computer!

  1. Open a shell (Ctrl+Alt+T)

  2. Download the SD card image by clicking on the following hyperlink tei0022_gsrd_20220310.tar.gz. Choose the option to Save the File. The file will be placed in the Downloads folder. Allow a few minutes for the download to complete.

  3. Extract the SD card image from the binaries archive.

     $ tar -xvzf ~/Downloads/tei0022_gsrd_20220310.tar.gz  -C ~/Downloads
    
  4. Use dd utility to write the SD image to the SD card. Use soceds1 as the password when prompted. Substitute the letter x with the actual drive letter discovered above.

     $ sudo dd if=~/Downloads/tei0022_gsrd_20220310.img of=/dev/sdx bs=1M status=progress
    
  5. Use sync utility to flush the changes to the SD card.

     $ sudo sync  
    

Copy the Preloader and uboot images to the SD card

Exercise caution: dd targeted at an incorrect drive letter can brick your computer.

  1. Use dd utility to write the Preloader image to the SD card binary partition. Use soceds1 as the password when prompted.

     $ sudo dd if=~/ad463x/hdl/projects/ad463x_fmc/tei0022/software/spl_bsp/preloader-mkpimage.bin of=/dev/sdx3 bs=64k seek=0		
    
  2. Use dd utility to write the uboot image to the SD card binary partition. Use soceds1 as the password when prompted.

     $ sudo dd if=~/ad463x/hdl/projects/ad463x_fmc/tei0022/software/spl_bsp/uboot-socfpga/u-boot.img of=/dev/sdx3 bs=64k seek=4 
    
  3. Use sync utility to flush the changes to the SD card.

     $ sudo sync  
    

Copy the FPGA image to the SD card

Convert the FPGA image file to the Raw Binary Format (RBF)

  1. Open a Nios II Command Shell

     $ ~/intelFPGA_lite/20.1/nios2eds/nios2_command_shell.sh
    
  2. Convert the FPGA image file to the RBF format

     $ cd ~/ad463x/hdl/projects/ad463x_fmc/tei0022
    
     $ quartus_cpf -c -o bitstream_compression=on ad463x_fmc_tei0022.sof soc_system.rbf
    

Copy the RBF file to the SD card

    $ mkdir /media/soceds/BOOT/output_files

    $ cp /home/soceds/ad463x/hdl/projects/ad463x_fmc/tei0022/soc_system.rbf /media/soceds/BOOT/output_files

Copy the Linux kernel image to the SD card

    $ cp /home/soceds/ad463x/linux/arch/arm/boot/zImage /media/soceds/BOOT

Copy the devicetree file to the SD card

    $ mv /home/soceds/ad463x/linux/arch/arm/boot/dts/socfpga_cyclone5_tei0022_02_axi_hdmi_ad463x.dtb /home/soceds/ad463x/linux/arch/arm/boot/dts/soc_system.dtb 

    $ cp /home/soceds/ad463x/linux/arch/arm/boot/dts/soc_system.dtb /media/soceds/BOOT

Eject the SD card adapter

Note : Never remove the SD card media from the Linux host before it has been ejected.

To Eject the media :

  • Click on the eject button in the file manager partition named BOOT




Next - Run the Demonstration Standalone
Next - Run the Demonstration Remotely via Ethernet

Return to Build the Example Design
Return to AD463x Platform User Guide

Clone this wiki locally