AnsweredAssumed Answered

How to partion eMMc on i.MX6DL properly?

Question asked by arnt on Mar 8, 2018
Latest reply on Mar 15, 2018 by Diego Adrian Cuevas

Hi all!


I am trying to flash Android 7 to a i.MX6DL-based design. Our design is really close to the SABRE SD reference design, although we added a larger eMMC. The device has previously been used with Android 4.4.2, thus we know the hardware to be working. 


In Mfgtool/Linux

When I attempt to flash the device, according to the Android Users Guide, using the prebuilt images (including U-Boot), and the UCL2 command included in the Android 7 Mfgtool, I get the following error in the console:

UTP: executing "dd if=$FILE of=/dev/mmcblk3"
67+0 records in
67+0 records out
34304 bytes (34 kB, 34 KiB) copied, 0.014494 s, 2.4 MB/s
UTP: sending Success to kernel for command $ dd if=$FILE of=/dev/mmcblk3.
utp_poll: pass returned.
UTP: received command '$ hdparm -z /dev/mmcblk3'
UTP: executing "hdparm -z /dev/mmcblk3"


 re-reading partition table
Alternate GPT is invalid, using primary GPT.
 mmcblk3: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11
UTP: sending Success to kernel for command $ hdparm -z /dev/mmcblk3.
utp_poll: pass returned.
UTP: received command '$ gdisk -l /dev/mmcblk3 '
UTP: executing "gdisk -l /dev/mmcblk3 "
GPT fdisk (gdisk) version 1.0.1


Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.


Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.


Warning! One or more CRCs don't match. You should repair the disk!


Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged


Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
Disk /dev/mmcblk3: 30777344 sectors, 14.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): CFF91002-E965-4B01-AD31-B9AB2DC9C7ED
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 29360094
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)


Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048           67583   32.0 MiB    FFFF  boot
   2           67584          133119   32.0 MiB    8300  recovery
   3          133120         3278847   1.5 GiB     FFFF  system
   4         3278848         4327423   512.0 MiB   FFFF  cache
   5         4327424         4343807   8.0 MiB     FFFF  device
   6         4343808         4351999   4.0 MiB     FFFF  misc
   7         4352000         4356095   2.0 MiB     FFFF  datafooter
   8         4356096         4360191   2.0 MiB     FFFF  metadata
   9         4360192         4362239   1024.0 KiB  FFFF  presistdata
  10         4362240        29356031   11.9 GiB    FFFF  userdata
  11        29356032        29358079   1024.0 KiB  0700  fbmisc
UTP: sending Success to kernel for command $ gdisk -l /dev/mmcblk3 .


The corresponding UCL commands are


    <CMD state="Updater" type="push" body="send" file="files/android/%folder%/partition-table.img" >Sending and writting partition-table.img</CMD>
    <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%">write gpt table to mmc</CMD>
    <CMD state="Updater" type="push" body="$ hdparm -z /dev/mmcblk%mmc%">Dectecting emmc partition</CMD>
    <CMD state="Updater" type="push" body="$ gdisk -l /dev/mmcblk%mmc% ">List emmc partition</CMD>

I have tried fixing the GPT using the repair tools in "gdisk -l /dev/mmcblk3 ", but I didt not have any luck.

In U-Boot

The partitions are found by U-Boot, and I can ls, but it can't find the 'boot' partition:

=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device
=> mmc part


Partition Map for MMC device 2  --   Partition Type: EFI


Part    Start LBA       End LBA         Name
        Type GUID
        Partition GUID
  1     0x00000800      0x000107ff      "boot"
        attrs:  0x0000000000000000
        type:   bb499290-b57e-49f6-bf41-190386693794
        guid:   11e6daa8-fe04-4d0f-9baf-31d2863a0c3f
  2     0x00010800      0x000207ff      "recovery"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
        guid:   d042a9a0-3543-4b61-aac8-857f9ca188e3
  3     0x00020800      0x003207ff      "system"
        attrs:  0x0000000000000000
        type:   0f2778c4-5cc1-4300-8670-6c88b7e57ed6
        guid:   d4237e41-0dd2-43e2-98ec-5a76195ca291
  4     0x00320800      0x004207ff      "cache"
        attrs:  0x0000000000000000
        type:   aa3434b2-ddc3-4065-8b1a-18e99ea15cb7
        guid:   7eca1e29-fb4b-42d2-a667-3b2eb2fb5e04
  5     0x00420800      0x004247ff      "device"
        attrs:  0x0000000000000000
        type:   1fd63daf-8583-4772-8e79-3d69d8477de5
        guid:   2aa3f905-e815-4ce7-ab95-3d4f75b55c55
  6     0x00424800      0x004267ff      "misc"
        attrs:  0x0000000000000000
        type:   6b2378b0-0fbc-4aa9-a4f6-4d6e17281c47
        guid:   515bd199-3e38-4186-a49e-556176a759df
  7     0x00426800      0x004277ff      "datafooter"
        attrs:  0x0000000000000000
        type:   314f99d5-b2bf-4883-8d03-e2f2ce507d6a
        guid:   dc98ed0e-01ea-4ea7-bc70-6abbd33e3cf1
  8     0x00427800      0x004287ff      "metadata"
        attrs:  0x0000000000000000
        type:   b598858a-5fe3-418e-b8c4-824b41f4adfc
        guid:   a15b907e-a02b-4ff8-8eff-e1becb14c1f8
  9     0x00428800      0x00428fff      "presistdata"
        attrs:  0x0000000000000000
        type:   e99d84d7-2c1b-44cf-8c58-effae2dc2558
        guid:   1cdaf5fc-7b54-4e94-b851-82f8eec93ff9
 10     0x00429000      0x01bfefff      "userdata"
        attrs:  0x0000000000000000
        type:   0bb7e6ed-4424-49c0-9372-7fbab465ab4c
        guid:   c4f6a963-6fd8-4257-ac62-1e2807bd788e
 11     0x01bff000      0x01bff7ff      "fbmisc"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   c3336e60-a380-476e-b256-f8c845b736f6
=> ext4ls mmc 2:1
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
=> ext4ls mmc 2:3
<DIR>       4096 .
<DIR>       4096 ..
<DIR>       4096 lost+found
<DIR>       4096 app
<DIR>       8192 bin
            2284 build.prop
<DIR>       4096 etc
<DIR>       4096 fake-libs
<DIR>       8192 fonts
<DIR>       4096 framework
<DIR>      12288 lib
<DIR>       4096 media
<DIR>       4096 priv-app
<DIR>       4096 usr
<DIR>       4096 vendor
<DIR>       4096 xbin
=> boota mmc2
boota mmc2
can't find partition: boot, dump the partition table
boota: cannot find 'boot' partition
The reported U-Boot version is
U-Boot 2017.03 (Dec 15 2017 - 22:25:16 +0800)
How can I fix this issue? Is there something wrong with the partitioning in the Linux environment from Mfgtools, or is this a U-Boot issue? Does anyone have any tips as to what I should check next?