Skip to end of metadata
Go to start of metadata

Creating a bootable SD card requires an SD card reader operational under Linux to format and access the Linux partition of the card. If you do not have SD card access under Linux then copying the bootloader and mounting the root filesystem on SD/MMC card will not be possible.

If using pre-built images provided by PHYTEC, the exact image names are listed in the instructions below. If you have built your own images, then the images are located in:  $YOCTO_DIR/build/tmp/deploy/images/<MACHINE NAME>/ 

Flashing A Complete Image:

  1.  Determine the SD card device name
    1. The SD card device name is of the form /dev/sd[b|c|d|e]. Run the following without and with the SD card connected:

      ls /dev/sd*
    2. The device that appeared on the call to ls with the SD card but not the call without is the SD card device.

  2. Unmount all partitions of the SD card, using the SD card device name from Step 1: 

    umount /dev/sd[b|c|d|e]*
  3. Load the SD card image onto the SD card from the linux command line. This will format the appropriate partitions, as well as add U-Boot, the kernel image, and the root filesystem to the card.

    1. From the directory that contains the '.sdcard' file, execute the following command:

      sudo dd if=fsl-image-gui-<MACHINE_NAME>.sdcard of=/dev/sd[b|c|d|e] bs=1MB && sync

Updating Individual Parts Of An Image:

Once the SD card has been formatted, you can update the kernel, root filesystem, and u-boot individually as well:

Kernel

  1. If modifying the kernel, remove the existing zImage and device tree binary files:

    rm /media/<user>/Boot\ imx7-p/zImage
    rm /media/<user>/Boot\ imx7-p/<MACHINE NAME>.dtb
  2.  Load the new Linux kernel and device tree binary to the SD Card:
     

    cp zImage /media/<user>/Boot\ imx7-p/; sync
    cp zImage-<MACHINE NAME>.dtb /media/<user>/Boot\ imx7-p/<MACHINE NAME>.dtb; sync

Root Filesystem

  1. If modifying the root filesystem, remove the existing:

    sudo rm -rf /media/<user>/<rootfs partition>/*
  2. Load the new filesystem to the SD Card:

    sudo tar -jxf fsl-image-gui-<MACHINE NAME>.tar.bz2 -C /media/<user>/<rootfs partition>/; sync

Bootloader

  1. Flash u-boot to the SD card:

    sudo dd if=u-boot.imx of=/dev/sd[b|c|d|e] bs=512 seek=2 conv=fsync