{"id":200,"date":"2013-01-06T12:58:12","date_gmt":"2013-01-06T17:58:12","guid":{"rendered":"http:\/\/fw.hardijzer.nl\/?p=200"},"modified":"2013-01-06T12:58:12","modified_gmt":"2013-01-06T17:58:12","slug":"flashing-the-odroid-u2s-emmc-card-without-a-reader","status":"publish","type":"post","link":"https:\/\/fw.hardijzer.nl\/?p=200","title":{"rendered":"Flashing the ODROID-U2&#8217;s eMMC card without a reader"},"content":{"rendered":"<h3>Why?<\/h3>\n<p>In the quest for the ideal XBMC set-top box, I&#8217;ve bought an <a title=\"Hardkernel's ODROID-U2\" href=\"http:\/\/www.hardkernel.com\/renewal_2011\/products\/prdt_info.php\">ODROID-U2<\/a>. It&#8217;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&#8217;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&#8217;ll supposedly get fixed once XBMC upgrades to multi-core ffmpeg or the video decoder will be implemented)<\/p>\n<p>While the ODROID will boot from MicroSD perfectly, there&#8217;s another option called eMMC that is supposedly much faster. If you buy it from them, it&#8217;ll include a small converter to microSD so you can flash it with a computer. However, as it turns out <a title=\"ODroid forums: emmc reader not working\" href=\"http:\/\/odroid.foros-phpbb.com\/t1949-emmc-reader-not-working\">this converter is absolute garbage<\/a>. it&#8217;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&#8217;t work.<\/p>\n<p>So I had this nice box, with Android 4.0 pre-installed, but the one method to upgrade was broken.<\/p>\n<p>Luckily, there&#8217;s another way to upgrade by booting to Ubuntu from a microSD card, and access the eMMC module on-board from there. I&#8217;ll detail how I did it here.<\/p>\n<p><!--more--><\/p>\n<h3>What will you need?<\/h3>\n<p>You&#8217;ll need the following to complete this:<\/p>\n<ul>\n<li>The ODROID-U2 itself.<\/li>\n<li>a microSD card loaded with an Ubuntu image for the ODROID-U2.<\/li>\n<li>The &#8220;<a title=\"USB-UART Module Kit\" href=\"http:\/\/www.hardkernel.com\/renewal_2011\/shop\/good_buy_view.php?lang=en&amp;g_code=G134111883934\">USB-UART Module Kit<\/a>&#8220;<\/li>\n<li>an eMMC image for your eMMC card.<\/li>\n<li>Some way to get the files from and to the ODROID. (USB-stick, network+ssh, etc)<\/li>\n<\/ul>\n<h3>Step 1: Boot to Ubuntu<\/h3>\n<ul>\n<li>Attach the USB-UART module to the ODROID and to your PC<\/li>\n<li>Connect to the USB-UART module using either hyperterm or <a title=\"Putty Download Page\" href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\">putty<\/a>\n<ul>\n<li>(Windows 7) Start -&gt; Computer (right click) -&gt; Properties, click &#8220;Device manager&#8221; in the left bar. Look under&#8221;Ports (COM &amp; LPT)&#8221;, search for &#8220;Silicon Labs CP210x USB to UART Bridge&#8221;, the part at the end inbetween brackets is the COM port. in my case COM5.<\/li>\n<li>Start Putty<\/li>\n<li>Select &#8220;Serial&#8221;, under serial line enter the COM port, e.g. COM5. under speed sneter 115200<\/li>\n<li>On the left go to Connection -&gt; Serial<\/li>\n<li>Ensure that the following options are set:\n<ul>\n<li>Speed (baud): 115200<\/li>\n<li>Data bits: 8<\/li>\n<li>Stop bits: 1<\/li>\n<li>Parity: None<\/li>\n<li>Flow control: None<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>DETACH the eMMC card, and insert the uSD card. This is to force the system to boot from SD instead of eMMC<\/li>\n<li>Power-on the ODROID-U2, and on the computer in Putty keep hitting enter until you see a few lines of &#8220;Exynos4412 #&#8221;<\/li>\n<li>Make sure you see the line &#8220;Checking Boot Mode &#8230; SDMMC&#8221;. If it states EMMC, reset again without the eMMC attached.<\/li>\n<li>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.<\/li>\n<li>type &#8220;boot&#8221; and hit enter in the terminal<\/li>\n<li>After a lot of data you should get a shell with &#8220;root@linaro-ubuntu-desktop:~#&#8221;, congratulations, you&#8217;re in \ud83d\ude42<\/li>\n<li>Mind you that it&#8217;s normal if there&#8217;s other data on the terminal being spat out, like &#8220;[ \u00a0 91.529517] NOHZ: local_softirq_pending 08&#8221; or &#8220;[ \u00a0 80.665871] HKDK4412: CPUFREQ Policy setted to 1.7Ghz at boot&#8221;<\/li>\n<\/ul>\n<h3>Check everything<\/h3>\n<ul>\n<li>type &#8220;ls \/dev\/mmcblk*&#8221; and hit enter<\/li>\n<li>Do you see at least \/dev\/mmcblk0 and \/dev\/mmcblk1 ? if not, something went wrong and the eMMC wasn&#8217;t recognized<\/li>\n<li>type &#8220;mount -l&#8221; and hit enter<\/li>\n<li>Look for the first line, it should look like this:<br \/>\n\/dev\/mmcblk1p2 on \/ type ext4 (rw,errors=remount-ro) [rootfs]<br \/>\nThis line means that Ubuntu runs from mmcblk1, \u00a0and the eMMC will probably be on mmcblk0. if that line reads \/dev\/mmcblk0&#8230; it&#8217;s the other way round.<br \/>\nIn this post I&#8217;ll assume the SD is at mmcblk1 and the eMMC is at mmcblk0. If it&#8217;s the other way around for you, remember to swap those around in any commands you type.<\/li>\n<li>do &#8220;df -h&#8221; and check to see if you have enough diskspace somewhere to store the images. In my case, \/ had more than 3GB free, so I&#8217;m using that.<br \/>\nNote that you can&#8217;t use anything on the eMMC itself, so nothing that starts with \/dev\/mmcblk0 should be used.<\/li>\n<\/ul>\n<h3>Unmount everything<\/h3>\n<ul>\n<li>Do &#8220;mount -l | grep \/dev\/mmcblk0&#8221;<\/li>\n<li>And for each line, do &#8220;umount \/dev\/mmcblk0p&#8230;&#8221; (the first part of the line)<\/li>\n<li>This is to ensure that Ubuntu isn&#8217;t writing to the eMMC by itself.<\/li>\n<\/ul>\n<h3>Backups<\/h3>\n<p>It&#8217;s always a good idea to have a backup, so we&#8217;ll make one. You can skip this step, but I believe it&#8217;s better to be safe than sorry.<br \/>\nIn 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:<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">cd \/<br \/>\n<\/span><\/li>\n<li>dd if=\/dev\/mmcblk0 | gzip -4 &gt; backup.gz<\/li>\n<\/ul>\n<p>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&#8217;s copying. use that to calculate how long it&#8217;ll take, and run it again to finish it.<\/p>\n<p>If you want to put that backup back for whatever reason, use the following commands:<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">cd \/<\/span><\/li>\n<li>gzip -d -c backup.gz | dd of=\/dev\/mmcblk0 bs=8M<\/li>\n<\/ul>\n<h3>Actual flashing<\/h3>\n<ul>\n<li><span style=\"line-height: 13px;\">First get a list of files in the zipfile with: &#8220;unzip -l\u00a0OdroidU2_eMMC_8G_image_04-Jan-2013.zip&#8221;<\/span><\/li>\n<li>Ensure there is only one .img file in there<\/li>\n<li><span style=\"line-height: 13px;\">run: unzip -p &lt;zipfile&gt; &lt;imgfile&gt; | dd of=\/dev\/mmcblk0 bs=8M<br \/>\nfor example: unzip -p OdroidU2_eMMC_8G_image_04-Jan-2013.zip ODROID-U2.img | dd of=\/dev\/mmcblk0 bs=8M<br \/>\nNote that you don&#8217;t have to unzip the file first, you can unzip it directly to your eMMC.<br \/>\nThe ctrl+c trick mentioned in the backups to gauge the speed doesn&#8217;t work here. For me it did about 17.9 MB\/second, and the whole flash of 2.8GB took about 3 minutes.<\/span><\/li>\n<li>TADAA! You&#8217;re done!<\/li>\n<li>type &#8220;shutdown -h now&#8221; to shut down the box neatly.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Why? In the quest for the ideal XBMC set-top box, I&#8217;ve bought an ODROID-U2. It&#8217;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 &hellip; <a href=\"https:\/\/fw.hardijzer.nl\/?p=200\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Flashing the ODROID-U2&#8217;s eMMC card without a reader<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[],"class_list":["post-200","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=200"}],"version-history":[{"count":3,"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fw.hardijzer.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}