Flashing the ODROID-U2’s eMMC card without a reader

Why?

In the quest for the ideal XBMC set-top box, I’ve bought an ODROID-U2. It’s a small devboard with an Exynos 4412 quad-core Cortex-A9 processor. Pretty much the same chipset as the Samsung Galaxy S3 or the Note 2, which should be more than enough to power XBMC I figured. (Note: At this point it doesn’t run XBMC flawless yet, the menus work great and much faster than on the RPi or the Pivos XIOS DS, 720p content seems to work fine, but 1080 still stutters a bit. However, that’ll supposedly get fixed once XBMC upgrades to multi-core ffmpeg or the video decoder will be implemented)

While the ODROID will boot from MicroSD perfectly, there’s another option called eMMC that is supposedly much faster. If you buy it from them, it’ll include a small converter to microSD so you can flash it with a computer. However, as it turns out this converter is absolute garbage. it’s too big to fit into a regular uSD-SD converter, and even after I filed it down to the appropriate size, it still didn’t work.

So I had this nice box, with Android 4.0 pre-installed, but the one method to upgrade was broken.

Luckily, there’s another way to upgrade by booting to Ubuntu from a microSD card, and access the eMMC module on-board from there. I’ll detail how I did it here.

What will you need?

You’ll need the following to complete this:

  • The ODROID-U2 itself.
  • a microSD card loaded with an Ubuntu image for the ODROID-U2.
  • The “USB-UART Module Kit
  • an eMMC image for your eMMC card.
  • Some way to get the files from and to the ODROID. (USB-stick, network+ssh, etc)

Step 1: Boot to Ubuntu

  • Attach the USB-UART module to the ODROID and to your PC
  • Connect to the USB-UART module using either hyperterm or putty
    • (Windows 7) Start -> Computer (right click) -> Properties, click “Device manager” in the left bar. Look under”Ports (COM & LPT)”, search for “Silicon Labs CP210x USB to UART Bridge”, the part at the end inbetween brackets is the COM port. in my case COM5.
    • Start Putty
    • Select “Serial”, under serial line enter the COM port, e.g. COM5. under speed sneter 115200
    • On the left go to Connection -> Serial
    • Ensure that the following options are set:
      • Speed (baud): 115200
      • Data bits: 8
      • Stop bits: 1
      • Parity: None
      • Flow control: None
  • DETACH the eMMC card, and insert the uSD card. This is to force the system to boot from SD instead of eMMC
  • Power-on the ODROID-U2, and on the computer in Putty keep hitting enter until you see a few lines of “Exynos4412 #”
  • Make sure you see the line “Checking Boot Mode … SDMMC”. If it states EMMC, reset again without the eMMC attached.
  • At this point, attach the eMMC card. This is to make sure Ubuntu does actually recognize the eMMC, while the bootloader never saw it attached.
  • type “boot” and hit enter in the terminal
  • After a lot of data you should get a shell with “root@linaro-ubuntu-desktop:~#”, congratulations, you’re in 🙂
  • Mind you that it’s normal if there’s other data on the terminal being spat out, like “[   91.529517] NOHZ: local_softirq_pending 08” or “[   80.665871] HKDK4412: CPUFREQ Policy setted to 1.7Ghz at boot”

Check everything

  • type “ls /dev/mmcblk*” and hit enter
  • Do you see at least /dev/mmcblk0 and /dev/mmcblk1 ? if not, something went wrong and the eMMC wasn’t recognized
  • type “mount -l” and hit enter
  • Look for the first line, it should look like this:
    /dev/mmcblk1p2 on / type ext4 (rw,errors=remount-ro) [rootfs]
    This line means that Ubuntu runs from mmcblk1,  and the eMMC will probably be on mmcblk0. if that line reads /dev/mmcblk0… it’s the other way round.
    In this post I’ll assume the SD is at mmcblk1 and the eMMC is at mmcblk0. If it’s the other way around for you, remember to swap those around in any commands you type.
  • do “df -h” and check to see if you have enough diskspace somewhere to store the images. In my case, / had more than 3GB free, so I’m using that.
    Note that you can’t use anything on the eMMC itself, so nothing that starts with /dev/mmcblk0 should be used.

Unmount everything

  • Do “mount -l | grep /dev/mmcblk0”
  • And for each line, do “umount /dev/mmcblk0p…” (the first part of the line)
  • This is to ensure that Ubuntu isn’t writing to the eMMC by itself.

Backups

It’s always a good idea to have a backup, so we’ll make one. You can skip this step, but I believe it’s better to be safe than sorry.
In my case, I needed about 600mb free to make a backup of my 8GB eMMC card. If you have more data on there, it could be much bigger. Seeing as I had some room on /, I do this to generate a backup:

  • cd /
  • dd if=/dev/mmcblk0 | gzip -4 > backup.gz

This will take a few minutes. I believe for my 8GB card it took about 15 minutes. If you want to have an estimate, first let it run for 30 seconds or so, and hit Ctrl+c, it should spit out how fast it’s copying. use that to calculate how long it’ll take, and run it again to finish it.

If you want to put that backup back for whatever reason, use the following commands:

  • cd /
  • gzip -d -c backup.gz | dd of=/dev/mmcblk0 bs=8M

Actual flashing

  • First get a list of files in the zipfile with: “unzip -l OdroidU2_eMMC_8G_image_04-Jan-2013.zip”
  • Ensure there is only one .img file in there
  • run: unzip -p <zipfile> <imgfile> | dd of=/dev/mmcblk0 bs=8M
    for example: unzip -p OdroidU2_eMMC_8G_image_04-Jan-2013.zip ODROID-U2.img | dd of=/dev/mmcblk0 bs=8M
    Note that you don’t have to unzip the file first, you can unzip it directly to your eMMC.
    The ctrl+c trick mentioned in the backups to gauge the speed doesn’t work here. For me it did about 17.9 MB/second, and the whole flash of 2.8GB took about 3 minutes.
  • TADAA! You’re done!
  • type “shutdown -h now” to shut down the box neatly.

10 thoughts on “Flashing the ODROID-U2’s eMMC card without a reader”

  1. Nice tutorial. I actually bought an Raspi for the purpose of running xbmc. But after reading this i am tinking this device would have been a better choice.

    Oh well, i didn’t try my raspi at all, yet. So lets first start with that…

    1. For now the Raspberry Pi is the better choice. It’s less powerful, but at least everything works (including hardware video decoding, if you pay the few dollars extra), and has a full OpenElec image. The ODroid-U2 at this point has CyanogenMod support, but XBMC on Android isn’t all that user-friendly, and has no hardware acceleration. The Ubuntu image doesn’t have a good enough graphics driver to run XBMC yet, so that’s not possible either.

      In the future though, the ODroid-U2 certainly has potential. The MFC video-decoding unit should be able to hardware accelerate most video, and anything that can’t be hardware accelerated should run fine if all four cores are used. From what I’ve seen so far the hardware also has support for HDMI-CEC, as well as 3D Frame packing. But again, none of that is actually working on the software side of things.

      At this point though, having tried three devices (Raspberry Pi, Pivos XIOS DS, and the ODroid-U2), only the Pivos is in active use in my home. The raspberry pi’s menus are *horribly* slow, to me non-working. The ODroid doesn’t have hardware decoding and needs a lot of workarounds to get rid of the Android bars. The Pivos has slow menus, but they’re still workable, and it plays almost anything. On top of that it has a factory-approved XBMC image that just works (most of the time).

  2. I actually managed to flash the eMMC through the U2, without using the UART. I simply started the U2 with a microSD loaded with Ubuntu. Just as the blue LED started flashing I connected the eMMC. So I managed to time it right between looking for boot loader and starting Ubuntu 🙂
    I was lucky and made it the first time I tried. When I wanted to reproduce it I had to retry a couple of times.

    I consider this a rather hackish solution. It’s not completely reliable, and maybe you even can damage your hardware by doing it. I was desperate and didn’t have much choise. Good luck!

    1. could you tell me exactly how long did you waited after the blue LED started flashing? all I get is no boot and indefinetly flashing blue led, or a succesful boot but no eMMC

  3. I am not able to get the blue lights indicating ubuntu has loaded and I am not able to get PuTTY to talk with the U2. A few questions *Where did you download your version of ubuntu *Is there anything special I need to do to the card before I load ubuntu to it *Does PuTTY work correctly on a Win8 64 machine?

  4. I have not been able to get my Odroid-U2 to boot into Ubuntu.
    I have written the Linaro build of Ubuntu to my microSD card, but it doesn’t seem to want to boot from it.

  5. Confirming that I too was able to flash eMMC from the odroid-u2 using the hack phr33 describes.

  6. me too: “Confirming that I too was able to flash eMMC from the odroid-u2 using the hack phr33 describes.”

    – put bootable sd card in (for me ubuntu)
    – put the emmc ON the slot (not IN)
    – plug in power cord
    – after 1 second, press the emmc into place
    – boot from sd and flash a new os onto /dev/mmcblk1
    – …
    – profit

Leave a Reply

Your email address will not be published. Required fields are marked *