Flashing and Booting from an EMMC module on an Odroid XU4 can be tricky. This is because you need a bootloader placed on a hidden Partition of the eMMC memory module. When you clean or flash an EMMC module with normal tools like Etcher or Rufus, you might delete the hidden partition that had the bootloader and the XU4 will simply not boot from your image even if the image you flashed is bootable.
While there are recovery images you can download that have the bootloader needed on it, most images you flash after that will still not contain the bootloader and you would be back to square 1.
The best was found to create a properly bootable EMMC is as follows:
- If your EMMC module does not boot, its best to first do a recovery process as described on https://wiki.odroid.com/accessory/emmc/recovery_xu4, then see if your EMMC boots to android. You might be able to skip this step 1 but its still recommended. Then go to step 2.
- Flash the image your want to boot from on to your EMMC module and see if it boots. if it does then you are set. if not, go to step 3.
- Flash the image your want to boot from on BOTH an SD card and your EMMC module.
- With the XU4 off and switch set to boot from SD, insert both them flashed EMMC and SD card on your XU4
- Turn on your XU4 and let it boot from SD
- SSH into the XU4 or get to a terminal window on it and login
- At the prompt type: ls /dev/mmc* and hit enter
- Your will see all the partitions on both the SD and the EMMC device. Both will start with mmc so don’t get confused by that. Almost always, your EMMC module are the mmc words that have blk0 and blkboot0 in them and your SD card will be the other one, probably the ones that have blk1 or blk2 in the name. In the Batocera environment I was testing, my SD card happens to be the one with blk2 in them. This will be important as it will get used in steps below
What we are going to do now is use the linux dd command to copy the boot partition from your SD card to the appropriate area on the EMMC. Your EMMC device we want to write to is typically mmcblk0boot0 and it will be protected. So we first have to unlock it, then use the dd command as follows:
- Type echo 0 > /sys/block/mmcblk0boot0/force_ro and hit enter. This will unlock and give us access to the partition.
- Now type dd if=/dev/mmcblk2 of=/dev/mmcblkboot0 bs=512 skip=1 seek=0 count=16381
The last step might take a few seconds or minute. Once you see no more activity, you can now lock the partition again.
- Type echo 1 > /sys/block/mmcblk0boot0/force_ro and hit enter.
Now shutdown your XU4 and remove the SD card and flip the switch to boot from your EMMC!
This is what worked for me. Here is a screenshot of my session after step 4 of the first part.