Libre Computer AML-S905X-CC eMMC Flashing via MicroSD Card and u-boot

This method is an alternative to the recommended way of flashing eMMC. This method only works on Amlogic boards, board models beginning with AML-.

There are 2 ways to flash the eMMC. The two methods below require a MicroSD card. For the other methods that does not need a MicroSD card, please see eMMC Flashing from Linux via pyamlboot.

Requirements

  • Proper Power Supply
  • eMMC module attached
  • MicroSD card
  • Display or UART connection

Flashing via u-boot UMS

  • USB Type A to USB Type A cable
  • USB Keyboard or UART connection
  1. Flash a MicroSD card with one of our images or libretech-flash-tool.
  2. Interrupt u-boot by pressing any key when you see Hit any key to stop autoboot:
  3. Emulate a USB flash drive with the eMMC by interrupting u-boot and running: ums 0 mmc 0
  4. Plug the USB Type A to USB Type A cable from the top USB port next to Ethernet into a computer’s USB Type A port. The eMMC device should appear as a flash drive.
  5. Use a bit-accurate flash tool to write an image to the eMMC.
2 Likes

Instructions on this thread missing?

Updated the instructions.

i am trying to " 1. Interrupt u-boot by pressing any key when you see `Hit any key to stop autoboot:" but I see message it just boots right into ubuntu. I am using the most current ubuntu image from the website.

Please help. By the instructions this should be so simple, but it appears not.

BLUF: I completed Method 2 without an eMMC attached to my AML-S905X-CC (2GB). Have I just filled a buffer? Should I clear out that memory? If so, how can I go about doing that?

I received an error after sending the command in Method 2 Step 4:
This where and what I sent:

~/Documents$ sudo dd if=ubuntu-22.04.1-preinstalled-desktop-arm64+aml-s905x-cc.img of=/dev/mmcblk0 bs=1M

The error message I received was:

dd:error writing ‘/dev/mmc/blk0’: No space left on device
818+0 records in
817+0 records out
856891392 bytes (857 MB, 817 MiB) copied, 18.1939 s, 47.1 MB/s

At this point I realized that I didn’t actually have a eMMC board attached - I thought that it was just one of the several ICs soldered to the board.

Can anyone help me with the questions included in the BLUF? Please and thank you.

Have you tried just working through Method 2?

i have tired method 2 and the Drive does not show up at all, if I use Gnome Disk Utility i do not see the drive at all. if i try to use dd it just tell me the drive is full which i suspect means it does not detect it. So on another thread, I saw where it said to just try using the [Libre Computer AML-S905X-CC eMMC Flashing Steps from Linux] and just configure and write image to disk while attached to your AML-S905X-cc board. I tried this and it did work for the 2 32GB emmc cards i had for my S905X-cc and also for the H5 trantium(spelling probably off) but for the 128GB it worked to begin with but when i tried to boot the ROC-RK3328-CC from the 128GB emmc module it started to boot where i saw ubuntu start screen but then went to a terminal interface and any command i try to enter just say unknown command. So I thought it could be the image so i tried again still the same. now the drive will no longer show up after running sudo pyamlboot/run.sh aml-s905x-cc ums-emmc.
Not sure what to try next.
what gets me is no matter how I ask I don’t get an answer to how i can tell if it is connected and or even being reconized.
I was hoing someone from librecomputer might respond with some information but no reply yet

You can interrupt boot if your USB keyboard is recognized or via UART connection.

Make sure you are using eMMC 4.x for Tritium and eMMC 5.x for everything else.

You need to let us know exactly what you see via either a photo or copying the log.

If you no long see the eMMC module, check the pins for damage. eMMC are very prone to damage is meant for permanent attachment and not meant for being moved around.

thank you for the information.

is there a specfic key to hit like with Dell and F2?

So the 2 32GB emmc were 5.x and the 128GB emmc was 4.x. I missed that just say 128GB.

this is a copy of the log but may not matter as it was a emmc 4.x but if you see anything and could explain what it means by invalid build .

roc@roc-rh3328-cc:~$ lsusb

Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 002 Device 002: ID 1b8e:c003 Amlogic, Inc. GX-CHIP

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 005 Device 002: ID 04f2:0939 Chicony Electronics Co., Ltd Amazon Basics mouse

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 046d:c31c Logitech, Inc. Keyboard K120

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

roc@roc-rh3328-cc:~$ lsusb

Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 005 Device 002: ID 04f2:0939 Chicony Electronics Co., Ltd Amazon Basics mouse

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 046d:c31c Logitech, Inc. Keyboard K120

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

roc@roc-rh3328-cc:~$ ls /dev/mmcblk*

/dev/mmcblk1 /dev/mmcblk1p1 /dev/mmcblk1p2

roc@roc-rh3328-cc:~$ lsusb

Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 002 Device 003: ID 1b8e:c003 Amlogic, Inc. GX-CHIP

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 005 Device 002: ID 04f2:0939 Chicony Electronics Co., Ltd Amazon Basics mouse

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 046d:c31c Logitech, Inc. Keyboard K120

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

roc@roc-rh3328-cc:~$ sudo pyamlboot/run.sh aml-s905x-cc erase-emmc

[sudo] password for roc:

/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release

warnings.warn(

/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release

warnings.warn(

Using GX Family boot parameters

ROM: 2.4 Stage: 0.0

Writing /home/roc/pyamlboot/files/libretech-cc/u-boot.bin.usb.bl2 at 0xd9000000…

[DONE]

Writing /home/roc/pyamlboot/files/usbbl2runpara_ddrinit.bin at 0xd900c000…

[DONE]

Running at 0xd9000000…

[DONE]

Waiting…

[DONE]

ROM: 2.2 Stage: 0.8

Running at 0xd900c000…

[DONE]

Waiting…

[DONE]

Writing /home/roc/pyamlboot/files/libretech-cc/u-boot.bin.usb.bl2 at 0xd9000000…

Traceback (most recent call last):

File “/home/roc/pyamlboot/./boot.py”, line 132, in

usb.load_uboot()

File “/home/roc/pyamlboot/./boot.py”, line 87, in load_uboot

self.write_file(os.path.join(self.bpath, self.BL2_FILE), self.DDR_LOAD, large = 64)

File “/home/roc/pyamlboot/./boot.py”, line 63, in write_file

self.dev.writeLargeMemory(addr, b, large, fill)

File “/home/roc/pyamlboot/pyamlboot/pyamlboot.py”, line 241, in writeLargeMemory

self._writeLargeMemory(address+offset, data[offset:offset+writeLength], \

File “/home/roc/pyamlboot/pyamlboot/pyamlboot.py”, line 215, in _writeLargeMemory

self.dev.ctrl_transfer(bmRequestType = 0x40,

File “/usr/lib/python3/dist-packages/usb/core.py”, line 1082, in ctrl_transfer

ret = self._ctx.backend.ctrl_transfer(

File “/usr/lib/python3/dist-packages/usb/backend/libusb1.py”, line 893, in ctrl_transfer

ret = _check(self.lib.libusb_control_transfer(

File “/usr/lib/python3/dist-packages/usb/backend/libusb1.py”, line 604, in _check

raise USBError(_strerror(ret), ret, _libusb_errno[ret])

usb.core.USBError: [Errno 19] No such device (it may have been disconnected)

roc@roc-rh3328-cc:~$ sudo pyamlboot/run.sh aml-s905x-cc erase-emmc

/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release

warnings.warn(

/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release

warnings.warn(

Using GX Family boot parameters

ROM: 2.4 Stage: 0.0

Writing /home/roc/pyamlboot/files/libretech-cc/u-boot.bin.usb.bl2 at 0xd9000000…

[DONE]

Writing /home/roc/pyamlboot/files/usbbl2runpara_ddrinit.bin at 0xd900c000…

[DONE]

Running at 0xd9000000…

[DONE]

Waiting…

[DONE]

ROM: 2.2 Stage: 0.8

Running at 0xd900c000…

[DONE]

Waiting…

[DONE]

Writing /home/roc/pyamlboot/files/libretech-cc/u-boot.bin.usb.bl2 at 0xd9000000…

[DONE]

Writing /home/roc/pyamlboot/files/usbbl2runpara_runfipimg.bin at 0xd900c000…

[DONE]

Writing /home/roc/pyamlboot/files/libretech-cc/u-boot.bin.usb.tpl at 0x200c000…

[DONE]

Writing scripts/libretech-cc-erase-emmc.scr at 0x8000000…

[DONE]

Running at 0xd900c000…

[DONE]

roc@roc-rh3328-cc:~$

thank your help

Any key will work at the u-boot prompt.

I have an AML-S905X-CC and I installed 2022-09-22-raspbian-bullseye-arm64+aml-s905x-cc.img.xz onto a 32GB microSD card. I have added a GenBasic WiFi 4 USB Nano, the system is connected to my WiFi, and I can connect with SSH.

Next, I installed a 32GB eMMC (5.x) and followed the instructions here using method 2 (xz -cd IMAGE.xz | sudo…) which I believe was successful. I shutdown the system, removed the microSD card and powered up again. The system does not boot successfully.

After attaching an HDMI monitor I see what looks like a normal boot sequence but it ends with:
Begin: Running /scripts/local-block ... done.
repeated many times followed by:

Gave up waiting for root file system device. Common problems:
- Boot args (cat /proc/cmdline)
- Check rootdelay= (did the system wait long enough?)
- Missing modules (cat /proc/modules: ls /dev)
ALERT! (UUID=1cd42925-4305-4a79-bb10-f50d1fda10f8 does not exist. Dropping to a shell!

and the system is unresponsive at this point. I’ve looked for solutions here but haven’t found anything yet.

Apparently, a fresh 32GB eMMC 5.x must be flashed via the procedure in Libre Computer AML-S905X-CC eMMC Flashing Steps from Linux. Using the procedure documented in this topic didn’t work (see my previous post).

I’m not sure if subsequent flashes (i.e. to change OSes) will work with this procedure now that one image has successfully been flashed. If someone knows the answer please let me know.

It does not matter which procedure you use. The goal is to have a bit-accurate flash of the image on the eMMC module. You can dd from Linux on the device or flash from an external computer using USB mass storage emulation.

You can reflash the eMMC with a different OS and it should work fine.

Is it possible to follow method 2 from the Renegade itself?

I’m wondering if I can boot a headless unit from the SD and clone that SD install to the eMMC?

Yes, it is probably the fastest way. Boot from SD, download the image, decompress, and write to eMMC.

Thanks. Now I just need to find a way to resolve my login problem.

A few observations I made regarding method 1 that might help others:

  1. Using the MicroSD card is only required if you haven’t already written a bootable image to the eMMC. If your have an existing bootable image on the eMMC and want to replace it the MicroSD is not needed.

  2. The bootloader command “ums 0 mmc 0” doesn’t always work because the eMMC card might show up as a different device number (eg. try “ums 0 mmc 1”).

  3. While most of the flashing methods mention using a Linux machine to set up the Le Potato, Windows will also work (at least with method 1). I usually use the Raspberry Pi imager with Windows as I haven’t had much luck with Win32DiskImager (keeps failing the verify step).

  1. It will always show up as mmc 0. Never as mmc 1 if you are using our software.
  2. Failure to verify because automount needs to be disabled in Windows.

I can confirm that this error DOES NOT happen due to automount not being disabled as, after disabling before any previous attempts, it still fails to verify sector 8192 . A quick search online will come up with tons of people having this issue dating back years now;

"If the SD-Card contains partitions which are accessible from Windows (FAT, FAT32, NTFS), Windows will create or change contents in the folder “System Volume Information” after writing or reading (because volume is locked for writing and reading and unlocked after this), so verification fails because content on SD-Card meanwhile was changed by Windows before you start the Verify.

Make sure that Windows does not change or create “System Volume Information” !"

Using GPEDIT Do not allow locations on removable drives to be added to libraries setting

  1. In Windows 10/8.1 Pro & Enterprise Editions, press Windows Key + R combination, type put gpedit.msc in Run dialog box and hit Enter to open the Local Group Policy Editor

  2. Navigate here;

Computer Configuration → Administrative Templates → Windows Components → Search

  1. In the right pane, look for the setting named Do not allow locations on removable drives to be added to libraries and double click to open

  2. Click on Enabled and then click Apply followed by OK . Close the Local Group Policy Editor and restart the machine, plug in the USB and plug out. You should no longer get error when verifying and nothing should get changed with file/folder structure etc.

Hope this helps and glad to be able to offer a solution for my first post here.

Sources:
sorceforge /p/win32diskimager/tickets/50/?page=1

the windows club /prevent-system-volume-information-folder-usb

2 Likes

Hi, I have a Libre Computer Board ROC-RK3328-CC (Renegade) and a Libre Computer 32GB eMMC 5.x Module. I am trying to follow the instructions to flash the eMMC via MicroSD Card with no success.

I flashed a 32 GB Samsung Evo Plus SD card with this image: ubuntu-22.04.2-preinstalled-desktop-arm64+roc-rk3328-cc.img using Win32DiskImager under Windows 10.

I connect the eMMC to the Renegade and power it up.

I stop the autoboot by hitting any key during bootup and get to the command prompt that looks like this: “=>”

After that I type: “ums 0 mmc 0” and get the following error: “Unknown command ‘ums’ - try ‘help’”

Can anyone help me to figure out what I am doing wrong? It seems odd that uboot doesn’t even know about the ums command at all. This seems to be independent of if the eMMC is working or even installed.

I would appreciate any help with this as I would really like to get ubuntu running on the renegade with eMMC.