VAR-SOM-MX6 NAND Flash Burning Dart: Difference between revisions

From Variscite Wiki
No edit summary
m (Reverted edits by Eran (talk) to last revision by Ron)
 
Line 2: Line 2:
= Introduction =
= Introduction =
Variscite DART-MX6 SOM uses eMMC to boot.  
Variscite DART-MX6 SOM uses eMMC to boot.  
{{note| NOTE:<br>This Wiki is only valid for DART-MX6.|info}}
{{note| NOTE:<br>This WIKI is only valid for DART-MX6.|info}}


== Yocto Build results ==
== Yocto Build results ==
The resulted images are located at tmp/deploy/images/var-som-mx6.<br>
The resulted images are locaated in tmp/deploy/images/var-som-mx6.<br/>Looking at tmp/deploy/images/var-som-mx6 you will find 6 main files that are linked to the actual file<br/>
Looking at tmp/deploy/images/var-som-mx6 you will find the following five required files for a complete system:<br/>
SPL, U-Boot, uImage, dtb file, file system image file.<br>


{| class="wikitable"
{| class="wikitable"
Line 14: Line 12:
! scope="col" | How to use<br/>
! scope="col" | How to use<br/>
|-
|-
| style="padding: 5px;"| fsl-image-gui-var-som-mx6.tar.bz2
| fsl-image-qt5-minimal-var-som-mx6.ext3<br/>
| style="padding: 5px;"| Tarball of the rootfs
| Not in Use<br/>
|-
|-
| style="padding: 5px;"| uImage
| fsl-image-qt5-minimal-var-som-mx6.sdcard
| style="padding: 5px;"| Linux kernel image
| This image is for SD-Card boot. Default u-boot is built for SDCARD. Booting from SD-Card is explained in details below. See section 8.1 below for the sdcard structure.
|-
|-
| style="padding: 5px;"| SPL-sd
| fsl-image-qt5-minimal-var-som-mx6.tar.bz2
| style="padding: 5px;"| SPL for SD/eMMC
| Used to create an NFS root file system on the host. See apendix for setting an NFS server
|-
|-
| style="padding: 5px;"| u-boot-sd-2015.04-r0.img
| fsl-image-qt5-minimal-var-som-mx6.ubi
| style="padding: 5px;"| U-Boot for SD/eMMC
| Use the sdcard created above. Copy the file into it and use the following commands to flash them into nand.<br/>Coping files (mount the sd-card created above first):
|-
| uImage
| Linux kernel image
|-
| SPL-nand,u-boot-nand-2014.04-r0.img
| SPl and u-boot built for nand
|-
| SPL-sd,u-boot-sd-2014.04-r0.img
| SPl and u-boot built for sdcard/eMMC
|-
|-
! scope="col" | Device Tree Name<br/>
! scope="col" | Device Tree Name<br/>
Line 32: Line 39:
! scope="col" | Evaluation Kit name<br/>
! scope="col" | Evaluation Kit name<br/>
|-
|-
| style="padding: 5px;"| uImage-imx6q-var-dart.dtb
| uImage-imx6q-var-som.dtb
| style="padding: 5px;"| VAR-SOM-SOLO / VAR-SOM-DUAL
| VAR-SOM-MX6_V2 (Quad / Dual)
| style="padding: 5px;"| VAR-DT6CustomBoard
| VAR-MX6CustomBoard
| style="padding: 5px;"| Capacitive LVDS touch
| Capacitive/Resistive touch
| style="padding: 5px;"| VAR-DVK-DT6<br>VAR-STK-DT6
| VAR-DVK-MX6_V2-PRO<br/>VAR-STK-MX6_V2
|-
| uImage-imx6q-var-som-vsc.dtb
| VAR-SOM-MX6_V2 (Quad / Dual)
| VAR-SOLOCustomBoard
| Capacitive LVDS touch
| N/A
|-
| uImage-imx6dl-var-som.dtb
| VAR-SOM-MX6_V2 (DualLite/ Solo)
| VAR-MX6CustomBoard
| Capacitive/Resistive touch
| N/A
|-
| uImage-imx6dl-var-som-solo-vsc.dtb
| VAR-SOM-SOLO / VAR-SOM-DUAL
| VAR-SOLOCustomBoard
| Capacitive LVDS touch
| VAR-DVK-SOLO/DUAL VAR-STK-SOLO/DUAL
|-
| uImage-imx6dl-var-som-solo.dtb
| VAR-SOM-SOLO / VAR-SOM-DUAL
| VAR-MX6CustomBoard
| Capacitive/Resistive touch
| N/A
|-
| uImage-imx6q-var-dart.dtb
| VAR-SOM-SOLO / VAR-SOM-DUAL
| VAR-DT6CustomBoard
| Capacitive LVDS touch
| VAR-STK-DT6.VAR-DVK-DT6
|-
|-
|}
|}
 
== NAND recovery file tree ==
== eMMC Flashing scripts==
We copy the image files into the NAND recovery utility. We also change the names of the products above.
If you followed the [[VAR-SOM-MX6 Yocto Jethro R4 Build Yocto release#Create_an_extended_SD_card |Create an extended SD card]] steps, the [[#eMMC flashing scripts |eMMC flashing scripts]] will be included in your SD card. <br>
The NAND recovery utlity contains Android and Yocto.
The [[#eMMC flashing scripts |eMMC flashing scripts]] are easy-to-use example scripts for burning images into eMMC.<br>
 
=== eMMC images locations ===
Following is the directory structure on your SD card, which elaborates the files' location that the below flashing scripts are expecting:
<pre>
<pre>
/opt/images/
/media/rootfs/opt/images/
├── Android
│  └── Emmc
│      ├── boot.img
│      ├── boot-imx6q-var-dart.img
│      ├── boot-som-mx6dl-c.img
│      ├── boot-som-mx6dl-r.img
│      ├── boot-som-mx6q-c.img
│      ├── boot-som-mx6q-r.img
│      ├── boot-som-mx6q-vsc.img
│      ├── boot-som-solo-c.img
│      ├── boot-som-solo-r.img
│      ├── boot-som-solo-vsc.img
│      ├── recovery.img
│      ├── recovery-imx6q-var-dart.img
│      ├── recovery-som-mx6dl-c.img
│      ├── recovery-som-mx6dl-r.img
│      ├── recovery-som-mx6q-c.img
│      ├── recovery-som-mx6q-r.img
│      ├── recovery-som-mx6q-vsc.img
│      ├── recovery-som-solo-c.img
│      ├── recovery-som-solo-r.img
│      ├── recovery-som-solo-vsc.img
│      ├── SPL
│      ├── SPL.mmc
│      ├── SPL.new
│      ├── system.img
│      ├── u-boot-var-imx6-nand.img
│      └── u-boot-var-imx6-sd.img
└── Yocto
└── Yocto
    ├── rootfs.tar.bz2
    ├── rootfs.ubi.img
    ├── SPL
     ├── SPL.mmc
     ├── SPL.mmc
     ├── rootfs.tar.bz2
     ├── u-boot.img
     ├── u-boot.img.mmc
     ├── u-boot.img.mmc
     ├── uImage
     ├── uImage
     └── uImage-imx6q-var-dart.dtb
    ├── uImage-imx6dl-var-som.dtb
    ├── uImage-imx6dl-var-som-solo.dtb
    ├── uImage-imx6dl-var-som-solo-vsc.dtb
    ├── uImage-imx6q-var-dart.dtb
    ├── uImage-imx6q-var-som.dtb
     └── uImage-imx6q-var-som-vsc.dtb
</pre>
</pre>


== Prepare images for NAND flash / eMMC flashing ==
<pre>
Plug the bootable SD card into your host machine.
Script files located on /media/rootfs/sbin/
Then your host machine should mount the rootfs partition on /media/rootfs.<br>
android-emmc.sh
Copy all the mentioned yocto-built binaries to the SD card:
mkmmc_yocto.sh   
<br>
yocto-dart.sh 
* <span style="color:red">Note:</span> If you followed the [[VAR-SOM-MX6 Yocto Jethro R4 Build Yocto release#Create an extended SD card |Create an extended SD card]] steps, the [[#eMMC flashing scripts|eMMC flashing scripts]] and all relevant binaries are already included in your SD card, and the below commands are redundant!<br>
yocto-nand.sh
mkmmc_android.sh
nand-recovery.sh
yocto-emmc.sh
</pre>


== Copy Yocto files into SDCARD ==
Plug the NAND recovery SDCARD into your host machine.
Then your host machine should mount the rootfs partition on /media/rootfs.
<pre>
<pre>
$ export YOCTO_IMGS_PATH=~/var-som-mx6-yocto-jethro/tmp/deploy/images/var-som-mx6
$ export YOCTO_ROOT=~/var-som-mx6-yocto-fido
$ export P2_MOUNT_DIR=/media/rootfs/


Linux:
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage /media/rootfs/opt/images/Yocto
$ sudo cp ${YOCTO_IMGS_PATH}/uImage ${P2_MOUNT_DIR}/opt/images/Yocto/
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/fsl-image-qt5-var-som-mx6.tar.bz2 /media/rootfs/opt/images/Yocto/rootfs.tar.bz2
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/fsl-image-qt5-minimal-var-som-mx6.ubi /media/rootfs/opt/images/Yocto/rootfs.ubi.img


SPL/U-Boot:
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6dl-var-som-solo.dtb /media/rootfs/opt/images/Yocto/
$ sudo cp ${YOCTO_IMGS_PATH}/SPL-sd ${P2_MOUNT_DIR}/opt/images/Yocto/SPL.mmc
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6dl-var-som-solo-vsc.dtb /media/rootfs/opt/images/Yocto/
$ sudo cp ${YOCTO_IMGS_PATH}/u-boot-sd-2015.04-r0.img ${P2_MOUNT_DIR}/opt/images/Yocto/u-boot.img.mmc
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6dl-var-som.dtb /media/rootfs/opt/images/Yocto/
 
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6q-var-som.dtb /media/rootfs/opt/images/Yocto/
File System:
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6q-var-som-vsc.dtb /media/rootfs/opt/images/Yocto/
$ sudo cp ${YOCTO_IMGS_PATH}/fsl-image-gui-var-som-mx6.tar.bz2 ${P2_MOUNT_DIR}/opt/images/Yocto/rootfs.tar.bz2
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6q-var-dart.dtb /media/rootfs/opt/images/Yocto/
 
Device Tree:
$ sudo cp ${YOCTO_IMGS_PATH}/uImage-imx6q-var-dart.dtb ${P2_MOUNT_DIR}/opt/images/Yocto/
</pre>
</pre>


== eMMC flashing scripts ==
== Flash File System to eMMC ==
The flashing scripts are located on the SD card at /usr/bin/:
Flashing eMMC is a complex task. It requires several steps including partition, format and untar the file system.
<pre>
We highly recommend to use our provided scripts to perform this task.
install_yocto.sh - Flash Yocto into NAND flash or eMMC (Run and follow usage instructions to install Yocto to DART eMMC)
Assuming that you use our NAND recovery utility.
(install_yocto_emmc.sh - This script is being called by install_yocto.sh - it should not be called directly!)
</pre>


== Manual step-by-step flashing to eMMC ==
Make sure the eMMC is not mounted.
Flashing eMMC requires several steps including flashing of U-Boot and the Linux kernel, partition, format and untar of the file system.
We recommend to use our provided scripts to perform this task.<br>
<br>
<pre>
<pre>
$ export node=/dev/mmcblk2
$ cd /opt/images/Yocto
$ cd /opt/images/Yocto
$ umount /dev/mmcblk1p*
$ node=/dev/mmcblk2
</pre>
</pre>


Make sure the eMMC is not mounted:
Delete all partition from the eMMC.
<pre>
<pre>
$ umount ${node}p*
$ fdisk ${node} <<EOF
d
1
d
2
d
3
d
w
EOF
 
$ sync
</pre>
</pre>


Delete current data on eMMC:
Delete MBR
<pre>
<pre>
$ dd if=/dev/zero of=${node}p1 bs=1024 count=1024
$ dd if=/dev/zero of=${node} bs=512 count=1000
$ dd if=/dev/zero of=${node}p2 bs=1024 count=1024
$ dd if=/dev/zero of=${node}p3 bs=1024 count=1024
$ dd if=/dev/zero of=${node}p4 bs=1024 count=1024
$ dd if=/dev/zero of=${node}p5 bs=1024 count=1024
$ dd if=/dev/zero of=${node}p6 bs=1024 count=1024
$ dd if=/dev/zero of=${node}p7 bs=1024 count=1024
$ sync
$ (echo d; echo 1; echo d; echo 2; echo d; echo 3; echo d; echo w) | fdisk $node
$ sync
$ dd if=/dev/zero of=$node bs=1M count=4
$ sync
$ sync
</pre>
</pre>


Create partition table:
Call fdisk to create partition table
<pre>
<pre>
$ (echo n; echo p; echo 1; echo 8192; echo 24575; echo t; echo c; \
$ fdisk /dev/mmcblk2 <<EOF
  echo n; echo p; echo 2; echo 24576; echo; \
n
  echo p; echo w) | fdisk -u $node
p
$ sync
1
8192
24575
t
c
n
p
2
24576
 
p
w
EOF
 
</pre>
</pre>


Format the partitions:
Format eMMC
<pre>
<pre>
$ mkfs.vfat ${node}p1 -n BOOT-VARSOM
$ umount /run/media/mmcblk2p1 2>/dev/null
$ mkfs.ext4 ${node}p2 -L rootfs
$ umount /run/media/mmcblk2p2 2>/dev/null
$ mkfs.vfat /dev/mmcblk2p1 -nBOT_varsomi
$ mkfs.ext4 /dev/mmcblk2p2 -Lrootfs
$ sync
$ sync
</pre>
</pre>


Flash SPL and U-Boot
 
Flash u-boot
<pre>
<pre>
$ sudo dd if=SPL.mmc of=${node} bs=1K seek=1; sync
$ cd /opt/images/Yocto
$ sudo dd if=u-boot.img.mmc of=${node} bs=1K seek=69; sync
$ sudo dd if=u-boot.img.mmc of=/dev/mmcblk2 bs=1K seek=69; sync
$ sudo dd if=SPL.mmc of=/dev/mmcblk2 bs=1K seek=1; sync
</pre>
</pre>
 
Flash Yocto BOOT partition
Flash the Linux kernel to the BOOT partition
<pre>
<pre>
$ mkdir /run/media/mmcblk2p1
$ mkdir -p /tmp/media/mmcblk2p1
$ mount -t vfat ${node}p1 /run/media/mmcblk2p1
$ mount -t vfat /dev/mmcblk2p1  /tmp/media/mmcblk2p1
$ cp uImage-imx6q-var-dart.dtb /run/media/mmcblk2p1/imx6q-var-dart.dtb
$ cp uImage-imx6q-var-dart.dtb /tmp/media/mmcblk2p1/imx6q-var-dart.dtb
$ cp uImage /run/media/mmcblk2p1/uImage
$ cp uImage /tmp/media/mmcblk2p1/uImage
$ sync
$ umount /tmp/media/mmcblk2p1
$ umount /tmp/media/mmcblk2p1
</pre>
</pre>


Flash the rootfs:
Flashing Yocto Root file System
<pre>
<pre>
$ mkdir /run/media/mmcblk2p1
$ mount /dev/mmcblk2p2  /tmp/media/mmcblk2p2
$ mount ${node}p2 /run/media/mmcblk2p2
$ mkdir -p /tmp/media/mmcblk2p2
$ tar xvpf rootfs.tar.bz2 -C /run/media/mmcblk2p2
$ rm -rf /tmp/media/mmcblk2p2/*
$ sync
$ tar xvpf rootfs.tar.bz2 -C /tmp/media/mmcblk2p2/
$ umount /run/media/mmcblk2p2
$ umount /tmp/media/mmcblk2p2
</pre>
</pre>


= Summary =
= Summary =
This page is only valid for DART-MX6.
We describe the results of Yocto build, how to copy it to SDCARD and how to flash it to eMMC.
We described the results of a Yocto build, how to copy it to a bootable SD card and how to flash it to eMMC.<br>
This page is only valid for DART-MX6.
With our extended SD card and our recovery SD card we provide an installation script located at /usr/bin/install_yocto.sh. It is much safer to use it instead of flashing the system manually.<br>
With the NAND recovery utility we provide a set of scripts located on /sbin and listed below. It is much safer to use them instead of the manual operation.
<br/>/media/rootfs/sbin/:
<br/>android-emmc.sh mkmmc_yocto.sh yocto-dart.sh yocto-nand.sh mkmmc_android.sh nand-recovery.sh yocto-emmc.sh.
Some of the scripts are used by the others. <br/>Please use:
* android-emmc.sh to flash Android int eMMC
* yocto-dart.sh To flash Yocto into eMMC on DART-MX6
* yocto-nand.sh To flash Yocto into NAND (not relevant on DART-MX6)
* yocto-emmc.sh To flash Yocto into eMMC (not relevant on DART-MX6)

Latest revision as of 18:48, 31 July 2016

VAR-SOM-MX6 - eMMC Flash Burning Dart

Introduction

Variscite DART-MX6 SOM uses eMMC to boot.

NOTE:
This WIKI is only valid for DART-MX6.

Yocto Build results

The resulted images are locaated in tmp/deploy/images/var-som-mx6.
Looking at tmp/deploy/images/var-som-mx6 you will find 6 main files that are linked to the actual file

Image Name
How to use
fsl-image-qt5-minimal-var-som-mx6.ext3
Not in Use
fsl-image-qt5-minimal-var-som-mx6.sdcard This image is for SD-Card boot. Default u-boot is built for SDCARD. Booting from SD-Card is explained in details below. See section 8.1 below for the sdcard structure.
fsl-image-qt5-minimal-var-som-mx6.tar.bz2 Used to create an NFS root file system on the host. See apendix for setting an NFS server
fsl-image-qt5-minimal-var-som-mx6.ubi Use the sdcard created above. Copy the file into it and use the following commands to flash them into nand.
Coping files (mount the sd-card created above first):
uImage Linux kernel image
SPL-nand,u-boot-nand-2014.04-r0.img SPl and u-boot built for nand
SPL-sd,u-boot-sd-2014.04-r0.img SPl and u-boot built for sdcard/eMMC
Device Tree Name
SOM type
Carrier Board type
LCD Type
Evaluation Kit name
uImage-imx6q-var-som.dtb VAR-SOM-MX6_V2 (Quad / Dual) VAR-MX6CustomBoard Capacitive/Resistive touch VAR-DVK-MX6_V2-PRO
VAR-STK-MX6_V2
uImage-imx6q-var-som-vsc.dtb VAR-SOM-MX6_V2 (Quad / Dual) VAR-SOLOCustomBoard Capacitive LVDS touch N/A
uImage-imx6dl-var-som.dtb VAR-SOM-MX6_V2 (DualLite/ Solo) VAR-MX6CustomBoard Capacitive/Resistive touch N/A
uImage-imx6dl-var-som-solo-vsc.dtb VAR-SOM-SOLO / VAR-SOM-DUAL VAR-SOLOCustomBoard Capacitive LVDS touch VAR-DVK-SOLO/DUAL VAR-STK-SOLO/DUAL
uImage-imx6dl-var-som-solo.dtb VAR-SOM-SOLO / VAR-SOM-DUAL VAR-MX6CustomBoard Capacitive/Resistive touch N/A
uImage-imx6q-var-dart.dtb VAR-SOM-SOLO / VAR-SOM-DUAL VAR-DT6CustomBoard Capacitive LVDS touch VAR-STK-DT6.VAR-DVK-DT6

NAND recovery file tree

We copy the image files into the NAND recovery utility. We also change the names of the products above. The NAND recovery utlity contains Android and Yocto.

/media/rootfs/opt/images/
├── Android
│   └── Emmc
│       ├── boot.img
│       ├── boot-imx6q-var-dart.img
│       ├── boot-som-mx6dl-c.img
│       ├── boot-som-mx6dl-r.img
│       ├── boot-som-mx6q-c.img
│       ├── boot-som-mx6q-r.img
│       ├── boot-som-mx6q-vsc.img
│       ├── boot-som-solo-c.img
│       ├── boot-som-solo-r.img
│       ├── boot-som-solo-vsc.img
│       ├── recovery.img
│       ├── recovery-imx6q-var-dart.img
│       ├── recovery-som-mx6dl-c.img
│       ├── recovery-som-mx6dl-r.img
│       ├── recovery-som-mx6q-c.img
│       ├── recovery-som-mx6q-r.img
│       ├── recovery-som-mx6q-vsc.img
│       ├── recovery-som-solo-c.img
│       ├── recovery-som-solo-r.img
│       ├── recovery-som-solo-vsc.img
│       ├── SPL
│       ├── SPL.mmc
│       ├── SPL.new
│       ├── system.img
│       ├── u-boot-var-imx6-nand.img
│       └── u-boot-var-imx6-sd.img
└── Yocto
    ├── rootfs.tar.bz2
    ├── rootfs.ubi.img
    ├── SPL
    ├── SPL.mmc
    ├── u-boot.img
    ├── u-boot.img.mmc
    ├── uImage
    ├── uImage-imx6dl-var-som.dtb
    ├── uImage-imx6dl-var-som-solo.dtb
    ├── uImage-imx6dl-var-som-solo-vsc.dtb
    ├── uImage-imx6q-var-dart.dtb
    ├── uImage-imx6q-var-som.dtb
    └── uImage-imx6q-var-som-vsc.dtb
Script files located on /media/rootfs/sbin/
android-emmc.sh
mkmmc_yocto.sh    
yocto-dart.sh  
yocto-nand.sh
mkmmc_android.sh
nand-recovery.sh
yocto-emmc.sh

Copy Yocto files into SDCARD

Plug the NAND recovery SDCARD into your host machine. Then your host machine should mount the rootfs partition on /media/rootfs.

$ export YOCTO_ROOT=~/var-som-mx6-yocto-fido

$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage /media/rootfs/opt/images/Yocto
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/fsl-image-qt5-var-som-mx6.tar.bz2 /media/rootfs/opt/images/Yocto/rootfs.tar.bz2
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/fsl-image-qt5-minimal-var-som-mx6.ubi /media/rootfs/opt/images/Yocto/rootfs.ubi.img

$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6dl-var-som-solo.dtb /media/rootfs/opt/images/Yocto/
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6dl-var-som-solo-vsc.dtb /media/rootfs/opt/images/Yocto/
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6dl-var-som.dtb /media/rootfs/opt/images/Yocto/
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6q-var-som.dtb /media/rootfs/opt/images/Yocto/
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6q-var-som-vsc.dtb /media/rootfs/opt/images/Yocto/
$ sudo cp ${YOCTO_ROOT}/build_x11/tmp/deploy/images/var-som-mx6/uImage-imx6q-var-dart.dtb /media/rootfs/opt/images/Yocto/

Flash File System to eMMC

Flashing eMMC is a complex task. It requires several steps including partition, format and untar the file system. We highly recommend to use our provided scripts to perform this task. Assuming that you use our NAND recovery utility.

Make sure the eMMC is not mounted.

$ cd /opt/images/Yocto
$ umount /dev/mmcblk1p*
$ node=/dev/mmcblk2 

Delete all partition from the eMMC.

$ fdisk ${node} <<EOF
d
1
d
2
d
3
d
w
EOF

$ sync 

Delete MBR

$ dd if=/dev/zero of=${node} bs=512 count=1000
$ sync

Call fdisk to create partition table

$ fdisk /dev/mmcblk2 <<EOF 
n
p
1
8192
24575
t
c
n
p
2
24576

p
w
EOF

Format eMMC

$ umount /run/media/mmcblk2p1 2>/dev/null
$ umount /run/media/mmcblk2p2 2>/dev/null
$ mkfs.vfat /dev/mmcblk2p1 -nBOT_varsomi
$ mkfs.ext4 /dev/mmcblk2p2 -Lrootfs
$ sync


Flash u-boot

$ cd /opt/images/Yocto
$ sudo dd if=u-boot.img.mmc of=/dev/mmcblk2 bs=1K seek=69; sync
$ sudo dd if=SPL.mmc of=/dev/mmcblk2 bs=1K seek=1; sync

Flash Yocto BOOT partition

$ mkdir -p /tmp/media/mmcblk2p1
$ mount -t vfat /dev/mmcblk2p1  /tmp/media/mmcblk2p1
$ cp uImage-imx6q-var-dart.dtb /tmp/media/mmcblk2p1/imx6q-var-dart.dtb
$ cp uImage /tmp/media/mmcblk2p1/uImage
$ umount /tmp/media/mmcblk2p1

Flashing Yocto Root file System

$ mount /dev/mmcblk2p2  /tmp/media/mmcblk2p2
$ mkdir -p /tmp/media/mmcblk2p2
$ rm -rf /tmp/media/mmcblk2p2/*
$ tar xvpf rootfs.tar.bz2 -C /tmp/media/mmcblk2p2/
$ umount /tmp/media/mmcblk2p2

Summary

We describe the results of Yocto build, how to copy it to SDCARD and how to flash it to eMMC. This page is only valid for DART-MX6. With the NAND recovery utility we provide a set of scripts located on /sbin and listed below. It is much safer to use them instead of the manual operation.
/media/rootfs/sbin/:
android-emmc.sh mkmmc_yocto.sh yocto-dart.sh yocto-nand.sh mkmmc_android.sh nand-recovery.sh yocto-emmc.sh. Some of the scripts are used by the others.
Please use:

  • android-emmc.sh to flash Android int eMMC
  • yocto-dart.sh To flash Yocto into eMMC on DART-MX6
  • yocto-nand.sh To flash Yocto into NAND (not relevant on DART-MX6)
  • yocto-emmc.sh To flash Yocto into eMMC (not relevant on DART-MX6)