How to Flash the eMMC Module for the Libre Computer AML-S905X-CC (Le Potato) from Linux Using pyamlboot

In this guide, we’ll walk through the steps for flashing the eMMC module on your Le Potato board using a Linux machine and pyamlboot. This method does not require a MicroSD card, making it an efficient alternative.

Requirements

  • Le Potato board (AML-S905X-CC)
  • eMMC 5.x module attached
  • USB Type A to USB Type A cable
  • Any Linux computer (Intel preferred, AMD not recommended) or an SBC (Single Board Computer)(I used a Raspberry Pi 4)
  • Auxiliary power via MicroUSB (Recommended)

For this guide, I am assuming you have the basic understanding of how to flash a raspberry pi, are comfortable using command line prompts, and have an operating Linux computer. 

Step 1: Install pyamlboot

Begin by installing the necessary tools and cloning pyamlboot:

sudo apt install -y python3-usb
git clone --single-branch https://github.com/libre-computer-project/pyamlboot.git -b scripts

Step 2: Prepare the Board

Detach all peripherals from the Le Potato board, including the HDMI cable and any USB devices. You’ll only need the power and the USB cable to connect to the Linux machine.

  1. Connect one end of the USB Type A cable to your Linux machine. In my case, I plugged it into my raspberry pi 4
  2. Press and hold the K11/Uboot button on the Le Potato while plugging the other end of the USB Type A cable into the TOP USB port next to the Ethernet port on the board.
  3. Release the button once connected.
  4. If necessary, attach auxiliary power via MicroUSB if your machine doesn’t provide enough power. I had to plug in the Micro USB for additional power.

Step 3: Flash the eMMC

You now have two actions to take:

1. Erase the eMMC User Partition and Bootloader:

Run the following command to erase the eMMC user partition table and bootloader:

sudo pyamlboot/run.sh aml-s905x-cc erase-emmc

This command erases the first 1MB of the eMMC, which includes the partition table and bootloader.

2. Flash the eMMC via USB as a Virtual Flash Drive:

To turn the eMMC into a virtual flash drive, run the following:

sudo pyamlboot/run.sh aml-s905x-cc ums-emmc

After about 10 seconds, the eMMC will appear as a virtual flash drive on your Linux machine. You can now use tools like gnome-disk-imager or dd to flash the image directly to the eMMC.

Step 4: Flash the OS Image

Once the eMMC appears as a virtual drive, you can flash the desired operating system image. There are two ways to do this. You can use the Raspberry Pi imager or dd in the commandline. 

Method 1: Using Raspberry Pi Imager

  1. Select the OS Image:
    1. In the Raspberry Pi Imager, click on the “Choose OS” button.
    2. Select the appropriate OS image:
      1. To flash a custom image (for a Le Potato), scroll to the bottom of the list and select “Use Custom” and browse to your image file.
  2. Choose the Storage Device:
    1. Click on the “Choose Storage” button.
    2. Select the storage device (eMMC) you loaded earlier.
  3. Advanced Options (Should be skipped):
    1. This will not apply to the Le Potato image as the function is for the official Raspberry Pi images.
  4. Write the Image:
    1. Click on the “Write” button to begin flashing the image to your storage device.
    2. Wait for the process to complete. It may take a few minutes, depending on the image size and your storage speed.
  5. Verify the Flashing Process:
    1. After writing, the Raspberry Pi Imager will verify the process.
    2. Once complete, you will see a confirmation message.
  6. Eject the Storage Device:
    1. Safely disconnect the Le Potato with the attached eMMC module from the Raspberry Pi (or Linux device) and remove the additional power supply to the Le Potato.
  7. Boot the Device:
    1. Power it on the Le Potato and it should boot from the newly flashed image on the EMMC.

Method 2: using dd

Flash the OS Image

Once the eMMC appears as a virtual drive, you can flash the desired operating system image. Here’s an example using dd:

sudo dd if=path-to-your-image.img of=/dev/sdX bs=4M status=progress && sync

Replace path-to-your-image.img with the correct image path. Replace /dev/sdX with the correct device identifier for the eMMC drive.

This command is used in Unix-like operating systems to copy a disk image to a storage device, such as a USB drive. Here’s a breakdown of its components:

  • sudo: This command runs the following command with superuser (root) privileges, which is often necessary for operations that affect system hardware or files.
  • dd: This is a command-line utility for converting and copying files. It is commonly used for tasks like creating bootable USB drives or backing up entire disks.
  • if=path-to-your-image.img: This specifies the input file (if stands for “input file”). You should replace path-to-your-image.img with the actual path to the disk image you want to write.
  • of=/dev/sdX: This specifies the output file (of stands for “output file”). You need to replace /dev/sdX with the actual device identifier for your target storage device (e.g., /dev/sdb). Be very careful with this, as writing to the wrong device can result in data loss.
  • bs=4M: This sets the block size for the copy operation to 4 megabytes. Using a larger block size can speed up the copying process.
  • status=progress: This option provides periodic updates on the progress of the operation, showing how much data has been copied and the speed of the transfer .
  • && sync: The sync command is executed after the dd command completes successfully. It ensures that all data is written to the disk and that the filesystem is synchronized, which helps prevent data corruption.

Troubleshooting

  • AMD Machine Timeout: There’s a known issue with AMD machines timing out on USB transfers. For now, it’s best to use Intel-based machines or SBCs.