Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Zero/install/eMMC"

< Zero‎ | install
Line 14: Line 14:
 
* A PC/laptop running Windows, Linux, or macOS
 
* A PC/laptop running Windows, Linux, or macOS
 
* USB A to C cable or C to C cable, depending on your host
 
* USB A to C cable or C to C cable, depending on your host
* A supported Linux image, or
+
* A supported Linux image
* [https://dl.radxa.com/zero/images/android/ Android 9 image], which should be unzipped after downloading, and you will find files like this in the folder:
+
    $ ls
+
    android-info.txt  dtbo.img      flash-all.sh  product.img  vbmeta.img
+
    boot.img          dt.img        logo.img      recovery.img  vendor.img
+
    bootloader.img    flash-all.bat  odm.img      system.img
+
<code>bootloader.img</code> will be needed later to run Zero in fastboot mode.
+
  
 
== Windows ==
 
== Windows ==
Line 28: Line 22:
 
Please follow [[Zero/install/eMMC_erase#Windows | this guide]] to wipe eMMC. Do not close RZ USB Boot Helper when you finish.
 
Please follow [[Zero/install/eMMC_erase#Windows | this guide]] to wipe eMMC. Do not close RZ USB Boot Helper when you finish.
  
===== Step 2A: Flash Linux images =====
+
===== Step 2: Flash Linux images =====
  
 
First download the [https://dl.radxa.com/zero/images/loader/rz-udisk-loader.bin RZ USB disk loader], select <code>rz-udisk-loader.bin</code> in RZ USB Boot Helper, and click '''Run'''.
 
First download the [https://dl.radxa.com/zero/images/loader/rz-udisk-loader.bin RZ USB disk loader], select <code>rz-udisk-loader.bin</code> in RZ USB Boot Helper, and click '''Run'''.
Line 35: Line 29:
  
 
You can now flash your Linux image using balenaEtcher similar to [[Zero/getting_started#Write_Image | flash microSD card]]. Except you don't have to insert a card this time. Choose the new device detected in Step 2 as your target drive and proceed as normal.
 
You can now flash your Linux image using balenaEtcher similar to [[Zero/getting_started#Write_Image | flash microSD card]]. Except you don't have to insert a card this time. Choose the new device detected in Step 2 as your target drive and proceed as normal.
 
===== Step 2B: Flash Android 9 =====
 
 
Select extracted <code>bootloader.img</code> in RZ USB Boot Helper, and click '''Run''' to run Radxa Zero in fastboot mode.
 
 
Then Open Windows PowerShell from the Start Menu and execute this command to install <code>fastboot</code> tool:
 
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/install.ps1'))
 
 
Execute <code>flash-all.bat</code> from extracted Android 9 image folder to flash all partitions to eMMC.
 
 
If Zero did not reboot automatically after flashing, you should reconnect USB cable to reboot it.
 
  
 
== Linux & macOS ==
 
== Linux & macOS ==
Line 52: Line 35:
 
===== Step 1: Wipe eMMC =====
 
===== Step 1: Wipe eMMC =====
  
Please follow [[Zero/install/eMMC_erase#Linux_.26_macOS | this guide]] to wipe eMMC. Please follow till the end of the guide so you are in the correct mode for next step.
+
Please follow [[Zero/install/eMMC_erase#Linux_.26_macOS | this guide]] to wipe eMMC. Please make sure you are back in maskrom mode.
  
===== Step 2A: Flash Linux images =====
+
===== Step 2: Flash Linux images =====
  
 
Download the USB disk loader and run it on Zero
 
Download the USB disk loader and run it on Zero
Line 129: Line 112:
  
 
Carefully Eject the Zero USB drive and unplug and plug the power, Zero should boot the new image now.
 
Carefully Eject the Zero USB drive and unplug and plug the power, Zero should boot the new image now.
 
===== Step 2B: Flash Android 9 =====
 
 
Nexus Tools is an installer for the Android SDK Platform Tools package, which includes ADB, Fastboot, and other applications. We use Nexus Tools to install fastboot. If you already have fastboot installed, you can skip this step.
 
 
    bash <(curl -s https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/install.sh)
 
 
After it finishes, <code>which fastboot</code> should return you the install location.
 
 
Now execute <code>flash-all.sh</code> from your extracted Android folder to flash all partitions images to eMMC
 
 
    $ ./flash-all.sh
 
    error: no devices/emulators found
 
    OKAY [  0.040s]
 
    Finished. Total time: 0.040s
 
    OKAY [  0.039s]
 
    Finished. Total time: 0.039s
 
    ...
 
    Finished. Total time: 0.038s
 
    Rebooting                                          OKAY [  0.002s]
 
    Finished. Total time: 0.454s
 
 
If Zero did not reboot automatically after flashing, you should reconnect USB cable to reboot it.
 
 
== FAQ ==
 
===1. How to erase Android?===
 
A: <br>
 
* To erase partitions
 
<pre>dd if=/dev/zero of=/dev/<emmc device> bs=1M count=500</pre>
 
* [https://wiki.radxa.com/Zero/install/eMMC_Android9 To erase emmc u-boot]
 
<br>
 
=== 2. Why is there no fastboot device? ===
 
A: If the board not able to run into fastboot, please try: <br>
 
* If you can boot to android, try "adb reboot fastboot" or (uart console) "reboot fastboot"
 
* If you can visit u-boot console, execute command "fastboot"
 

Revision as of 02:35, 6 December 2021

    Radxa Zero >  Installation >  Install image to eMMC

How to install raw images to Radxa Zero eMMC

This guide describes how to install the raw images to Radxa Zero eMMC. Raw images is compared to amlupdate format image(which is a private image format). Raw images can be mount and open on host PCs. Most of the Linux images released are raw images. Android on the other hand contains images of its partitions, which result in many raw images that can't be flashed like Linux distro.

NOTE: We are currently updating Zero Wiki. Android instruction in this page is currently not complete. If your eMMC contains Android and wish to reinstall Android, do not erase eMMC and follow the old guide for now. We will add guide to create Android partition layout later to support use case such as switch from Linux back to Android.

Requirement

  • Radxa Zero
  • A PC/laptop running Windows, Linux, or macOS
  • USB A to C cable or C to C cable, depending on your host
  • A supported Linux image

Windows

Step 1: Wipe eMMC

Please follow this guide to wipe eMMC. Do not close RZ USB Boot Helper when you finish.

Step 2: Flash Linux images

First download the RZ USB disk loader, select rz-udisk-loader.bin in RZ USB Boot Helper, and click Run.

Your computer should detect a new storage device after the code is loaded.

You can now flash your Linux image using balenaEtcher similar to flash microSD card. Except you don't have to insert a card this time. Choose the new device detected in Step 2 as your target drive and proceed as normal.

Linux & macOS

For Linux and macOS, we use amlogic boot tool to download the bootloader and boot the Zero into the USB Disk mode. This is to expose the eMMC to host PC as a USB Disk. Then we can use dd or other tools to write images to the USB Disk(eMMC).

Step 1: Wipe eMMC

Please follow this guide to wipe eMMC. Please make sure you are back in maskrom mode.

Step 2: Flash Linux images

Download the USB disk loader and run it on Zero

   wget https://dl.radxa.com/zero/images/loader/rz-udisk-loader.bin
   boot-g12.py rz-udisk-loader.bin

It should output:

Firmware Version :
ROM: 3.2 Stage: 0.0
Need Password: 0 Password OK: 1
Writing rz-udisk-loader.bin at 0xfffa0000...
[DONE]
Running at 0xfffa0000...
[DONE]
AMLC dataSize=16384, offset=65536, seq=0...
[DONE]
AMLC dataSize=49152, offset=393216, seq=1...
[DONE]
AMLC dataSize=16384, offset=229376, seq=2...
[DONE]
AMLC dataSize=49152, offset=245760, seq=3...
[DONE]
AMLC dataSize=49152, offset=294912, seq=4...
[DONE]
AMLC dataSize=16384, offset=65536, seq=5...
[DONE]
AMLC dataSize=1406320, offset=81920, seq=6...
[DONE]
[BL2 END]

Now lsusb should show the following device:

   Bus 001 Device 082: ID 1b8e:2200 Amlogic, Inc. USB download gadget  Serial: AMLG12A-RADXA-ZERO

The Zero is in USB disk mode now, your computer should popup a new USB drive. On macOS you will get a disk not readable popup. Just click Ignore:

Rz-udisk-mac-popup.jpg

On Linux you will get following output from sudo dmesg:

[74292.229573] usb 1-10.2.3: new high-speed USB device number 84 using xhci_hcd
[74292.330483] usb 1-10.2.3: New USB device found, idVendor=1b8e, idProduct=c003, bcdDevice= 0.20
[74292.330487] usb 1-10.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[74292.330488] usb 1-10.2.3: Product: GX-CHIP
[74292.330489] usb 1-10.2.3: Manufacturer: Amlogic
[74303.432510] usb 1-10.2.3: USB disconnect, device number 84
[74303.665204] usb 1-10.2.3: new high-speed USB device number 85 using xhci_hcd
[74303.769674] usb 1-10.2.3: New USB device found, idVendor=1b8e, idProduct=2200, bcdDevice=99.99
[74303.769678] usb 1-10.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[74303.769679] usb 1-10.2.3: Product: USB download gadget
[74303.769680] usb 1-10.2.3: Manufacturer: Radxa
[74303.769681] usb 1-10.2.3: SerialNumber: AMLG12A-RADXA-ZERO
[74303.771008] usb-storage 1-10.2.3:1.0: USB Mass Storage device detected
[74303.771133] scsi host4: usb-storage 1-10.2.3:1.0
[74304.785353] scsi 4:0:0:0: Direct-Access     Linux    Radxa Zero UDisk  0ff PQ: 0 ANSI: 2
[74304.785506] sd 4:0:0:0: Attached scsi generic sg2 type 0
[74304.785679] sd 4:0:0:0: [sdc] 60749504 512-byte logical blocks: (31.1 GB/29.0 GiB)
[74304.785796] sd 4:0:0:0: [sdc] Write Protect is off
[74304.785798] sd 4:0:0:0: [sdc] Mode Sense: 0f 00 00 00
[74304.785916] sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[74304.833523]  sdc: sdc1
[74304.861751] sd 4:0:0:0: [sdc] Attached SCSI removable disk
[74305.424709] EXT4-fs (sdc1): recovery complete
[74305.425517] EXT4-fs (sdc1): mounted filesystem with writeback data mode. Opts: (null). Quota mode: none.

You can now use dd to write the raw image to the eMMC on Zero now.

   sudo dd if=/path/to/image of=/dev/new_dev bs=1M
   sync

Carefully Eject the Zero USB drive and unplug and plug the power, Zero should boot the new image now.