Wednesday 16 July 2014

erasing mmc card in u-boot

i played little bit with beaglebone black and fedora rawhide images.
i was not able to boot from sd card, because of u-boot on emmc, even i used sd card boot button.
so i looked for something like 'dd if=/dev/zero of=/dev/mmcblk0', but in uboot to erase partition table on emmc and also MLO and uboot placed somewhere on first mb of emmc.
author of u-boot recommended me to use mw + mmc write. and some good hints regarding size of words for 'mw' and size of blocks which uses 'mmc write'.
this worked perfectly:

mw $scriptaddr 0 40000;mmc write $scriptaddr 0 800

but...

fedora's u-boot has by default as first mmc device sdcard, not emmc.
i somehow forgot this small detail.
and i was supprised, that i still see 'U-Boot 2014.04" instead of 'U-Boot 2013.10' after few resets and repeating command above.

is always good to check, which mmc device is active :)