eMMC, what is it?
Is a chip used in embedded device. A lot of devices like TV, routers, SoC are using such chip to be used as storage.
These chips are very similar with SD/micro SD cards. If you use a passive adapter to convert eMMC to micro SD and then insert it into a normal micro SD card, you will be able to see only the parititon / partitions in “User Data Area” of the eMMC.
Then you will ask: what is “User Data Area”?
The eMMC is a little bit different than SD/micro SD. eMMC contains more than one “area”. Here you can find some more information: https://www.pengutronix.de/en/blog/2020-10-15-anpassen-einer-emmc.html
This is how an eMMC looks like:

When we are using micro SD to boot any SoC devices we have to use some space between sector 1 (512 bytes offset) up 2048 (1MB offset), or even more. In Raspberry Pi they are using a free space up to sector 16383 (8MB offset). Then the first BootFS partition is configured.
In eMMC there is another configuration. As you can see there is a partition named Boot#0, Boot#1 and RPMB, called in Linux /dev/mmcblk0boot0, /dev/mmcblk0boot1 and /dev/mmcblk0rpmb.
We don’t care too much about RPMB, in SoC I didn’t used. But what is important is /dev/mmcblk0boot0. Some devices can have a button / switch to select from which boot partition you want to boot: boot0 or boot1.
Odroid XU4 is booting only from partition boot0.
How do I read a eMMC?
To read an eMMC is similarity how you read a micro SD card. There are compatible, but with some differences.
To read an eMMC chip there are 2 possibilities: PCB adapter with eMMC connector and micro SD connection or a special eMMC reader.
Option 1: PCB adapter from eMMC to micro SD
If you are using a passive adapter like this:


and you connect to a normal micro SD card reader, you will see only partitions on “User Data Area” which normally contains BootFS and RootFS! You will never see partitions Boot#0, Boot#1 and RPMB!
Because I want to build my own U-boot for Odroid XU4 using EFI, I wanted to reprogram Boot#0 partition.
Not knowing this information regarding for normal card reader which are not able to expose Boot#0, Boot#1 and RPMB partitions, I’ve wrote the BL1, BL2, U-boot and TZSW on eMMC.
Guess what happen? 🙂 Yep, the BootFS and RootFS where deleted, because this specific combination wrote these 4 firmware in “User Data Area”. Lucky that I did a backup of full “User Data Area” to an image.
In eMMC these 4 firmware are not residing in “User Data Area”, they are residing in Boot#0 partition!
Even in U-Boot for Odroid XU4 is written: normal card readers will not expose Boot#0, Boot#1 and RPMB partitions to OS.
Then you are asking: how can I expose these partitions to modify my U-Boot? The answer is: you have to use a special eMMC card reader. But the next question is: which one?
Option 2: dedicated eMMC card reader
Then I’ve went on internet and search for “eMMC card readers”. I found this one from the title: Allnet Rock Pi 4 Adapter USB 3.0 to EMMC.
Well, I said, if is specially made for Rock Pi4 and compatible with Odroid XU4, let’s try it.


Then you connect the eMMC on card reader slot, insert into USB port and you will see this:
[191922.401672] usb 8-4.3: new SuperSpeed USB device number 44 using xhci_hcd
[191922.419832] usb 8-4.3: New USB device found, idVendor=05e3, idProduct=0756, bcdDevice=18.55
[191922.419836] usb 8-4.3: New USB device strings: Mfr=3, Product=4, SerialNumber=5
[191922.419838] usb 8-4.3: Product: UFD
[191922.419840] usb 8-4.3: Manufacturer: Genesys
[191922.419841] usb 8-4.3: SerialNumber: 00000000XXXXXXXX
[191922.420471] usb-storage 8-4.3:1.0: USB Mass Storage device detected
[191922.420592] scsi host11: usb-storage 8-4.3:1.0
[191923.443497] scsi 11:0:0:0: Direct-Access Genesys UFD 1855 PQ: 0 ANSI: 6
[191923.443755] sd 11:0:0:0: Attached scsi generic sg0 type 0
[191923.556862] sd 11:0:0:0: [sda] Spinning up disk…
[191924.561510] …not responding…
[191926.939302] sd 11:0:0:0: [sda] 61071360 512-byte logical blocks: (31.3 GB/29.1 GiB)
[191926.939633] sd 11:0:0:0: [sda] Write Protect is off
[191926.939636] sd 11:0:0:0: [sda] Mode Sense: 23 00 00 00
[191926.939968] sd 11:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[191926.994269] sda: sda1 sda2
[191926.994423] sd 11:0:0:0: [sda] Attached SCSI removable disk
$ ls /dev/disk/by-id/usb-Genesys_UFD_0000000090000172-0\:0*
/dev/disk/by-id/usb-Genesys_UFD_0000000090000172-0:0
/dev/disk/by-id/usb-Genesys_UFD_0000000090000172-0:0-part1
/dev/disk/by-id/usb-Genesys_UFD_0000000090000172-0:0-part2
Then you look into /dev directory to check if there is any mmcblk0.. and nothing :(.
As you can see from the output shows the eMMC as “SCSI disk” and it maps it as /dev/sda.
This device is using a chip GL3227E which doesn’t expose hidden partitions like Boot#0, Boot#1 and RPMB.

So, if you want to rewrite your booting firmware, DON’T BUY THIS card reader! Is not useful! I’ve tried to search on internet if this device expose these hidden partitions and I couldn’t find anything. Neither “doesn’t expose hidden partitions” nor “is expose hidden partitions”.
So I had to use the method “trial and error”, because the manufactures are not writing such information into device description.
This one I will return it because is behave exactly like the passive PCB from eMMC to micro SD card.
Is there any alternatives?
Yes, seems there is another alternative. Looking for it I found on GitHub a project based on Realtek RTS5170.
Here is the description for this chip: https://github.com/ignasurba/mmcblkNX .
Seems this chip is one of the chips which can read eMMC and expose /dev/mmcblk0 format of the eMMC.
I’ve ordered one from Aliexpress and I’m waiting for it and I will do a review of that eMMC reader in a separate post.
