What is the proper way to flash to EMMC for roc-rk3328-cc

Hi, there does not seem to be a updated tutorial for roc-rk3328-cc for flashing firmware into EMMC.
I tried the methods based on firefly wiki. I think your latest ubuntu-22-04-1-jammy-lts firmware is so-called RAW firmware so I flashed it that way. The RkDevTool provided does not contain the loader files, so I mananged to find one online here rk33 · master · zewanz / rkbin · GitLab .
I entered MASKROM successfully, and it flashed successfully, but it does not boot. What went wrong? (No serial cable at the moment, so not sure about uboot log)

Can you provide a workflow with all necessary files that works with your latest image? (BTW I really appricate your effort to update the images years after releasing the board. That is why I got a new board now despite having newer toys, good job!)

Also, a well written instruction that tell you how to flash it after booting with a SD card would also help. I see some discussion for the S905X board, but not one for RK3328 board. I imagine steps are similar but being a linux newbie I do not want to risk it.

Any help is greatly appreciated!

I would also add that even if I used the image on SD card only, the setup procedure got stuck at
“Waiting for unattended-upgr to exit”

If you happen to have a LePotato, the easiest way would be to use the pyamlboot method to flash an image directly to the eMMC. Then, transfer the eMMC over to the renegade and it should boot.

To flash directly from the rk3328, I did the following:

  1. Flash Raspbian Lite to an SD Card on another computer.
  2. Copy the Ubuntu image to a USB thumb drive on another computer.
  3. Boot the rk3328 from the SD card (I think the eMMC takes precedence when booting - so make sure it’s been properly erased or else it might hang).
  4. From a shell prompt mount the USB thumb drive and flash the image directly to the eMMC:
    dd if=/mnt/the-ubuntu-image-name.img of=/dev/mmcblk0 bs=1M
  5. Shutdown, remove the SD card, and reboot.

I’m drawing from memory, but I think the eMMC comes up as /dev/mmcblk0 and the SD card as /dev/mmcblk1.

unattended upgrade runs on first boot and updates the packages in the background to the latest. It can take a long time but we provide a quicker way in the release notes.

You can follow the Method 2 of Libre Computer AML-S905X-CC eMMC Flashing via MicroSD Card

How does one accomplish this task? I have a Renegade board on which I installed Armbian by flashing to an SD card. I then received a new 32 GB eMMC module for the Renegade board, installed it, then used the nand-sata-install utility to copy the SD card to the eMMC.

I have decided that I want to try the official Libre Computer Ubuntu distribution. I have a Windows 11 Pro PC on which I flashed the SD Card. Since (I believe) you have correctly characterized that the eMMC device is the preferred boot device on the renegade and I am not aware that the pyamlboot utilities would work from a Windows PC, are you aware of alternative methods one might use to properly erase the eMMC storage on the Renegade? Thank you in advance for your time and consideration.

If Armbian can still boot, run:

  1. ls /dev/mmcblk*
  2. sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=1 to erase the eMMC boot sector
    It could be /dev/mmcblk0 or /dev/mmcblk1 depending on how Armbian is setup.
    Then boot off the MicroSD card either Ubuntu or Raspbian and flash via sudo dd if=image.img of=/dev/mmcblk0 bs=1M
    Reboot and remove the MicroSD card

Thank you, this worked for me. It seemed mysterious and like it should have been harder than wiping
the boot sector from the eMMC device to force things to load from the SD card. But hey - I am having fun learning how things work in the SoC world!

In case others might be wondering, here’s what my experience yielded:

  1. Armbian’s installation (a nightly dev build based on Ubuntu running kernel version 5.19.90) on the eMMC device showed the eMMC as /dev/mmcblk1. So, the first dd command as suggested (ending in “count=1”) was indeed the correct device. Still, the ‘ls /dev/mmcblk*’ command should only come back with one root device matching with the device number (probably ‘0’ or ‘1’).

  2. This forced a boot from the MicroSD card since there was no longer any boot loader capability from the point that the system starts to look for that information to find the boot loader (there seem to be tiny segments / lower level constructs on the eMMC device reserved for low level system use including a pointer to where the mass storage media first record is written)

  3. Once I successfully booted and configured from the SD fresh install, I pulled the image I wanted to load onto the running SD card install and did the ls command above again to see that I had two different devices - /dev/mmcblk0 and /dev/mmcblk1.

  4. For my own sanity, I wanted to be double-sure that I was writing to the right device before executing the dd command (please don’t see this as a lack of trust - but let’s just say I have learned the hard way at work to be careful with the dd tool - it saves time in not having to restore from backup!). I can tell which device is running the current OS from where the root and /boot filesystems are mounted. I want to target the eMMC. So, grepping the output of a mount command will tell me which device I do not want to write to (sudo mount -l | grep mmcblk). I confirmed that the command as listed is correct - the ‘of=/dev/mmcblk0’ segment of the dd command specifies the target I want, since / and /boot were mounted from the device labled /dev/mmcblk1 indicating the running system on the SD card.

  5. Attempting the ‘dd’ command from Armbian using sudo did not work. I got permission denied. I had to fully login as root to run ‘dd’. So, I got a root prompt (i.e. sudo -s). Rather than decompress the image file, I chose to use xzcat to decompress and pipe it into dd (i.e. xzcat linux.img.xz | dd of=/dev/mmcblk0 bs=1M status=progress) and added progress reporting. It took about 400 seconds +/- to load the current Libre Computer Ubuntu 22.04.1 image on to the eMMC card.

  6. Once the dd command was done, I logged out and powered off the system, removed the SD Card, and successfully booted the fresh and clean official image from the eMMC card.

Mission Accomplished! Again, a big thank you to librecomputer!

1 Like

Flashing via Ubuntu, using a Libre branded eMMC module

  • Network Connection or USB flash drive with image
  1. Flash a MicroSD card with Ubuntu.
  2. Boot the Renegade with the MicroSD card.
    a. go through the install sequence, but don’t bother with updates just yet.
    b. Go into Settings / Power and set Screen Blank to Never.
  3. Download or copy the image to the MicroSD card you are currently running on.
    a. I copied from a USB3 stick in the USB3 port and it was fairly quick.
  4. Extract the image.
  5. Verify that the eMMC is blank. I installed gPartd and yes, it was.
  6. Use dd or Gnome Disk Utility to flash the eMMC.
    The eMMC should show up as /dev/mmcblk0.
    For dd, sudo dd if=IMAGE of=/dev/mmcblk0 bs=1M. Replace IMAGE with the name of the extracted file.
    The exact command for me was:
    dd /home/user/Download/ubuntu-22.04.1-preinstalled-desktop-arm64+roc-rk3328-cc.img of=/dev/mmcblk0 bs=1M
    For me, this completed a lot faster than I thought it would. It was faster than the copy of the img file from USB3 to MicroSD.
  7. Shutdown / Power Off the Renegade.
  8. Remove the MicroSD card. And in my case, also remove the USB3 stick.
  9. Power on the Renegade and it should go through the OS install sequence from the eMMC now.
    a. Restart after everything is finished. It would hang on updates without this restart.
    b. Now is the time to perform the system updates.

libretech-flash-tool has the board-emmc bind/unbind/rebind commands that allows you to hot plug the eMMC module (carefully) and re-run the detection routine.