Quantcast
Channel: Boundary Devices
Viewing all articles
Browse latest Browse all 391

Programming eMMC on i.MX platforms

$
0
0

This post intends to answer the question of programming the eMMC memory you can find on our devices.

Although there are many different approaches available based on Linux or the MFG Tools, this post will focus on two solutions provided under U-Boot.

Solution #1: Using Fastboot

Here is a quick summary:

  • Connect the board serial output (console) to your computer
    • On the host machine, start a terminal software such as minicom for Linux or TeraTerm for Windows
    • Set the connection baudrate to 115200 with no hardware flow control
  • Power up the board and stop auto-boot process to get U-Boot prompt
    • Simply enter any character on the terminal software to stop auto-boot
  • Go into Fastboot Mode on the Board
    • This can be done by simply using the following command in u-boot on the board:
=> fastboot 0
  • Flash the gpt and other partitions using the fastboot tool. For example for Ubuntu. (You can use the providesd flash_fastboot.sh script for Android)
boundary@boundary:~/$ sudo fastboot flash gpt gpt_8G.img
boundary@boundary:~/$ sudo fastboot flash rootfs rootfs_8G.simg

Solution #2: Using U-Boot USB Mass Storage Gadget

This feature is fully explained here:

Here is a quick summary:

  • Plug a micro-USB cable from your host machine to the target
  • Connect the board serial output (console) to your computer
    • On the host machine, start a terminal software such as minicom for Linux or TeraTerm for Windows
    • Set the connection baudrate to 115200 with no hardware flow control
  • Power up the board and stop auto-boot process to get U-Boot prompt
    • Simply enter any character on the terminal software to stop auto-boot
  • Enable the UMS Gadget for the eMMC . (If your emmc is mmc 1, use 1 instead of 0)
    • Inside uboot type the following command:
=> ums mmc 0
  • At this stage you should now see a new USB drive attached, you can now flash it
    • On Linux you can simply use the dd utility
~/$ zcat [your image name].img.gz | sudo dd of=/dev/sdX bs=1M
    • On Windows we recommend using Alex Page’s USB Image Tool.
      • In addition, you can use the etcher utility to flash the eMMC: balena-etcher

Solution #3: Auto Programming in Uboot Using SD Card or USB Flash Drive

Here is a quick summary:

  • Get the autoprogram_emmc package using the following command:
boundary@boundary:~/$ wget -r -np -nH -R "index.html*" \
linode.boundarydevices.com/autoprogram_emmc/
boundary@boundary:~/$ cd autoprogram_emmc/ && chmod +x *.sh
  • Copy your image file to the same directory as scripts. (Lets assume your image file name is ubuntu.img.gz)
  • Determine whether your eMMC is “mmc 0” or “mmc 1” using the following command in uboot:
=> mmc list
FSL_SDHC: 0 (eMMC)
FSL_SDHC: 1 (SD)
  • Run the following command on your host machine: (here we assume that emmc is: mmc 0)
 ~/autoprogram_emmc$ ./create_autoprogram_image.sh 0 ubuntu.img.gz out.img
  • At this stage the out.img image is created, you can now flash it onto your SD Card or USB flash drive:
    • On Linux we recommend the dd utility
 ~/autoprogram_emmc$ sudo dd if=out.img of=/dev/sdX bs=1M
    • On Windows we recommend using Alex Page’s USB Image Tool
      • In addition, you can use the etcher utility to flash the eMMC: balena-etcher 
  • Put the SD Card or USB flash drive onto the board, turn on the board, and let it automatically flash emmc. You can also monitor the process through serial console.

Solution #4: Using U-Boot ‘gzwrite’ command manually

This feature is fully explained here:

Here is a quick summary:

    • Connect the board serial output (console) to your computer
      • On the host machine, start a terminal software such as minicom for Linux or TeraTerm for Windows
      • Set the connection baudrate to 115200 with no hardware flow control
    • Power up the board and stop auto-boot process to get U-Boot prompt
      • Simply enter any character on the terminal software to stop auto-boot
    • Load the gzipped image into RAM
      • This can be done by reading the image from USB, TFTP or MMC
      • Below is an example if the image is copied on a SD Card
=> load mmc 0 10008000 my.img.gz
  • Once loaded, you can flash the image onto the eMMC
=> gzwrite mmc 1 10008000 0x$filesize 100000 0

The post Programming eMMC on i.MX platforms appeared first on Boundary Devices.


Viewing all articles
Browse latest Browse all 391

Trending Articles