Burning eMMC image for Mars

In the getting started guide, one process is shown for burning both SD and eMMC. Download the appropriate image from GitHub, and use Rufus or Balena Etcher to flash the image. So for the eMMC, what is the process -Rufus is a Windows tool. Is there a burner like Balena Etcher in the riscv64 repository…or an alternate tool or procedure to use?

You can use the SD card to boot the system and use the dd command to burn the eMMC image into the eMMC.

Thanks. I’ve attached an eMMC module, but when I power up, I no longer boot from the SD card. Is there a switch somewhere that controls booting options (from SD or eMMC)? Or do I need to attach the unformatted eMMMC module only after I’ve booted from the SD card? Is there any documentation on the Mars that would answer these questions?

1 Like

According to this post, the SD card and eMMC use the same path of communication, so simultaneous use isn’t possible.

Although I see the thread pertains to the Mars CM, is that also the case with the regular Mars board?

Since I can’t find any documentation, can Carbon from the Milk-V team help with my question about booting with eMMC? And are there any plans to write some documentation to add to the Getting Started guide?

We will update the documentation for Mars installation systems on eMMC later.

If you know how to use the dd command under Linux, you can first boot the system through the SD card, and then use the dd command to burn the eMMC image into the eMMC.

There is another way to install the system into eMMC.

You can refer to the following two links first, which provide the UsbFlashTool tool under Windows to install the system. Although it is a Mars CM document, the process is the same.

  1. First refer to this link to install the Windows driver of the tool.

    https://milkv.io/docs/mars/getting-started/bootloader#install-driver-for-the-burning-tool

  2. Refer to this link to install the eMMC image into eMMC

    https://milkv.io/docs/mars/compute-module/boot#mars-cm-emmc-version-image-burning

Thanks. I know how to use dd. As I wrote above, my problem is, the Mars doesn’t boot from SD with an eMMC module inserted. (It had been booting fine from SD before I inserted eMMC module.) Hence my question above: should I only install the eMMC after booting up? Or does something need to be set (a hardware switch, or some setting in the bootloader)? I saw your other post about using Windows, but I don’t have the USB to TTL cable.

@Bartleby, this may be a little late, but it may help others. I used this eMMC to USB-A interface
(Amazon.com);
and this 128G eMMC card (Amazon.com)
to successfully write an image from Ubuntu. The eMMC to USB-A adapter showed up as my ‘/dev/sdb’ device. (Yes, I know, Amazon, but it is so convenient…) I don’t know about Windows and Mac drivers; nothing needed to be done on Ubuntu, except snap the eMMC card in-place (no easy feat…), and insert the USB device.

I have a cheap bash script that I use so that I don’t have to keep typing in the same thing over and over:

#!/bin/bash -x
DEV=sdb   # This is the target device that'll receive the OS. It can't be the device you booted off of.
sudo dd bs=512M status=progress conv=fsync of=/dev/${DEV} if=mars_debian-desktop_sdk-v3.6.1_emmc_v1.0.6.img

sudo fdisk /dev/${DEV}

sudo umount /m/*; sudo rm -rf /m
sudo mkdir -p /m/${DEV}4 && sudo mount /dev/${DEV}4 /m/${DEV}4

sudo resize2fs /dev/${DEV}4

sudo mkdir -p /m/${DEV}4/home/user/Downloads/mars/
# sudo cp -puvr * /m/${DEV}4/home/user/Downloads/mars/
sudo rsync -av /home/tommy/Downloads/mars/ /m/${DEV}4/home/user/Downloads/mars

echo "sudo umount /m/*; sudo rm -rf /m when you are done”

When you get to the fdisk part to resize (it’s a gpt image, but fdisk still works as my card is under 2T - actually 128G), do a ‘d’, to delete the 4th partition; ’n’ to create a new 4th partition starting at the same starting sector, and extending to the end of the eMMC (all defaults). Then it will say "Do you want to remove the signature? [Y]es/[N]o:”. IMPORTANT!!! Reply 'N’. Then enter ‘w’ to write the new info to disk.

If anything stated here is wrong, please correct me.
YMMV and Good Luck.

1 Like

Thanks for your reply. It’s actually not too late :slight_smile: I wanted to go with the solution where I didn’t need to buy a part like the USB/eMMC adapter, or the USB to TTL cable…so I’m just waiting to hear if anybody knows about the booting issue I’m having when raw eMMC inserted (SD no longer boots.) I may end up trying your solution if I can’t get that working.

I think I failed to mention that the Ubuntu machine is not the Milk-V Mars. (My post was a little vague.)

I’m working (slowly) to see if I can boot the Mars off of the SD but mount a USB HD/SSD as the root filesystem (like the raspberry Pi before boot off of USB was supported…) Maybe ‘umount’ing the SD and removing it will allow use of the eMMC.

This really is above my pay grade. (I’m retired, so everything is, and stuff that I used to do in a day now takes me three weeks…) And it doesn’t help that I don’t know u-boot (yet).

After re-installing the eMMC module on the board, I was then able to boot from SD. So I must have not had the module attached properly before. I was able to use DD to image the eMMC. I used a 256G Orange Pi module, that someone on a VF2 forum reported worked well there. Here is a VF2 thread on the topic of eMMC performance:

I get only 37-38 MB/sec read speed. VF2 users report about 42 MB/sec, while on Lichee Pi4A someone got 230 MB/sec!