Skip to content

TEI0022 Build Update the SD Card

nnaufel edited this page Sep 18, 2020 · 6 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. The easiest way to achieve this is to copy the complete SD card image as described here.

Table of Contents

  1. Copy the Preloader and uboot images to the SD card
  2. Copy the FPGA image to the SD card
  3. Copy the Linux kernel image to the SD card
  4. Copy the devicetree file to the SD card

Copy the Preloader and uboot images to the SD card

Note: This must be done on a Linux host.

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

  1. 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)

     $ cat /proc/partitions
    
  2. Navigate to the Preloader image folder

     $ cd <where bsp-editor was invoked from>/software/spl_bsp	
    
  3. Use dd utility to write the Preloader image to the SD card binary partition. Use soceds1 as the password when prompted.

     $ sudo dd if=preloader-mkpimage.bin of=/dev/sdx3 bs=64k seek=0		
    
  4. Navigate to the uboot image folder

     $ cd <where bsp-editor was invoked from>/software/spl_bsp/uboot-socfpga
    
  5. Use dd utility to write the uboot image to the SD card binary partition. Use soceds1 as the password when prompted.

     $ sudo dd if=u-boot.img of=/dev/sdx3 bs=64k seek=4 
    
  6. Use sync utility to flush the changes to the SD card.

     $ sudo sync  
    
  7. Eject the mounted drive before removing the SD card media.

Copy the FPGA image to the SD card

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

The following step are done on the Windows PC where the hdl project was compiled

  1. Open a Nios II Embedded Command Shell
  1. Navigate to the FPGA image folder

     $ cd <compiled-project-directory>/output_files 
    
  2. Convert the FPGA image file to the RBF format

     $ quartus_cpf -c -o bitstream_compression=on system_top.sof soc_system.rbf
    

Copy the RBF file to the SD card

Note: This can be done on a Linux or Windows host

  1. Insert the SD card into the host computer

  2. Open a File browser such as 'Files' in Ubuntu or 'Windows Explorer' in Windows. Navigate to the output_files folder in the SD card FAT (may be labeled BOOT) partition in the browser.

  3. Open a second File browser. Navigate to the FPGA image folder

     $ cd <compiled-project-directory>/output_files
    
  4. Drop and drag the soc_system.rbf file into the output_files folder of the FAT partition of the SD card.

  5. Eject the mounted drive before removing the SD card media if using a Linux host.

Copy the Linux kernel image to the SD card

Note: This must be done on a Linux host.

  1. Insert the SD card into the host computer

  2. Open a File browser such as 'Files' in Ubuntu. Navigate to the SD card FAT partition in the browser.

  3. Open a second File browser. Navigate to the kernel image folder located at <linux-repo-directory>/linux/arch/arm/boot

  4. Drop and drag the zImage file to the FAT partition of the SD card.

  5. Eject the mounted drive before removing the SD card media.

Copy the devicetree file to the SD card

Note: This must be done on a Linux host.

  1. Insert the SD card into the host computer

  2. Open a File browser such as 'Files' in Ubuntu. Navigate to the SD card FAT partition in the browser.

  3. Open a second File browser. Navigate to the devicetree image folder located at <linux-repo-directory>/linux/arch/arm/boot/dts

  4. Rename the file socfpga_cyclone5_tei0022_arrow_ghrd.dtb to soc_system.dtb

  5. Drop and drag the soc_system.dtb file to the FAT partition of the SD card.

  6. Eject the mounted drive before removing the SD card media.



Return to Build the GHRD

Clone this wiki locally