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
(macOS)
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{zero_header}}
 
{{zero_header}}
{{Languages|zero/install/eMMC_erase}}
 
    [[zero | Radxa Zero]] > [[zero/install | Installation]] > [[zero/install/eMMC | Install image to eMMC]]
 
  
=== How to install raw images to Radxa Zero eMMC ===
+
{{Languages|zero/install/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. Currently Android images are released in amlupdate format but this may change in the future.
+
    [[zero | Radxa Zero]] > [[zero/install | Installation]] > [[zero/install/eMMC | Install image to eMMC]]
  
==== Requirement ====
+
=== How to install Linux image to Radxa Zero eMMC ===
  
* Radxa Zero
+
This guide describes how to install the raw images to Radxa Zero series eMMC. Raw image is the standard method to install Linux distro on single board computers, since they don't have standardized way to boot and initialize their hardware.
* USB A to C cable
+
* A PC/laptop running Windows, Linux/macOS.
+
  
==== Windows ====
+
== Requirement ==
  
===== Step 1: Install drivers =====
+
* Radxa Zero or Radxa Zero 2
 +
* 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
  
Download [https://github.com/pbatard/libwdi/releases/download/b755/zadig-2.6.exe Zagdig], install it and choose '''libusb-win32''', then click ''Install Driver''.
+
== Install using Windows ==
  
[[File:Zagdig-libusb.png]]
+
If you have existing data that you want to keep, this is your last chance to do so. Please follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to load <code>rz-udisk-loader.bin</code> and make backup accordingly.
  
Download the Android driver from Google:
+
Now follow [[Zero/install/eMMC_erase | eMMC erase guide]] to wipe out the existing system. Your computer should detect a new storage device after the file is loaded.
  
[https://dl.google.com/android/repository/usb_driver_r13-windows.zip Click here to download the Google USB Driver ZIP file (ZIP)]
+
You can now flash your Linux image using balenaEtcher similar to [[Zero/getting_started#Write_Image | flash microSD card]]. Choose the newly detected device in your target drive and proceed as normal.
  
Unzip it and right click the '''.inf''' file to install the driver.
+
Once you are done flashing, unplug and replug Radxa Zero to quit maskrom mode and boot normally.
  
[[File:Install-win-android-driver.png]]
+
== Install using Linux or macOS ==
  
===== Step 2: Use RZ USB helper to erase eMMC and boot to USB disk mode =====
+
If you have existing data that you want to keep, this is your last chance to do so. Please follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to load <code>rz-udisk-loader.bin</code> and make backup accordingly.
  
RZ USB helper is a tool by Radxa for Windows users to manage Radxa Zero booting easier. Download it from [https://dl.radxa.com/zero/tools/windows/RZ_USB_Boot_Helper_V1.0.0.zip Radxa DL].
+
Now follow [[Zero/install/eMMC_erase | eMMC erase guide]] to wipe out the existing system. Your computer should detect a new storage device after the file is loaded.
 
+
Press and hold the USB boot button on the Zero, plug in the USB to PC, '''Maskrom mode''' should be detected.
+
 
+
[[File:Rz-usb-helper-maskrom.png | 500px]]
+
 
+
Select the loader in the RZ_USB_Boot_Helper zip and click '''Run'''.
+
 
+
[[File:Rz-usb-helper-fastboot.png | 500px]]
+
 
+
Click '''Erase''' to erase the eMMC completely.
+
 
+
[[File:Rz-usb-helper-erase.png | 500px]]
+
 
+
Now select the RZ USB disk loader.
+
 
+
===== Step 3: Use Etcher to write images to eMMC =====
+
 
+
Download the [https://github.com/balena-io/etcher/releases/download/v1.5.122/balenaEtcher-Setup-1.5.122.exe latest Etcher and install it].
+
 
+
 
+
 
+
==== Linux ====
+
For Linux, we use amlogic boot tool to download the bootloader and boot the Zero into the USB Disk mode to export 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: Install pyamlboot tool =====
+
 
+
    sudo apt install pip3
+
    sudo pip3 install pyamlboot
+
 
+
===== Step 2: Install fastboot =====
+
 
+
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.
+
 
+
    bash <(curl -s https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/install.sh)
+
 
+
After it finishes,
+
 
+
    which fastboot
+
 
+
should return you the install location.
+
 
+
===== Step 3: Boot into fastboot mode =====
+
 
+
Press and hold the USB boot button on Zero, plug in it to PC, lsusb should see the following:
+
 
+
    Bus 002 Device 030: ID 1b8e:c003 Amlogic, Inc. GX-CHIP
+
 
+
Download the fastboot loader and run it on Zero
+
 
+
    $ wget https://dl.radxa.com/zero/images/loader/factory-loader.img
+
    $ boot-g12.py factory-loader.img
+
 
+
It should output:
+
<pre>
+
Firmware Version :
+
ROM: 3.2 Stage: 0.0
+
Need Password: 0 Password OK: 1
+
Writing rz-fastboot-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]
+
</pre>
+
  
 
Now lsusb should show the following device:
 
Now lsusb should show the following device:
  
     Bus 002 Device 016: ID 18d1:0d02 Google Inc. USB download gadget Serial: 1234567890
+
     Bus 001 Device 049: ID 1b8e:2200 Amlogic, Inc. USB download gadget
  
===== Step 4: Wipe the eMMC =====
+
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:
  
    fastboot devices
+
[[File:Rz-udisk-mac-popup.jpg]]
    1234567890 fastboot
+
  
    fastboot flashing unlock_critical
+
On Linux you will get following output from <code>sudo dmesg</code>:
    fastboot flashing unlock
+
    fastboot erase bootloader
+
    fastboot erase bootloader-boot0
+
    fastboot erase bootloader-boot1
+
 
+
    fastboot reboot
+
 
+
Unplug and plug the power of Zero, lsusb should show the following:
+
 
+
    Bus 002 Device 014: ID 1b8e:c003 Amlogic, Inc. GX-CHIP
+
 
+
the eMMC is wiped and Zero is in maskrom mode now. You can [[zero/install/eMMC#Linux | install other OS to eMMC]] now.
+
 
+
==== macOS ====
+
 
+
For macOS, we use amlogic boot tool to download the bootloader and boot the Zero into the fastboot mode to erase the eMMC.
+
 
+
===== Step 1: Install pyamlboot tool =====
+
 
+
    brew install python lsusb
+
    pip3 install pyamlboot
+
 
+
===== Step 2: Install fastboot =====
+
 
+
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,
+
 
+
    which fastboot
+
 
+
should return you the install location.
+
 
+
===== Step 3: Boot into fastboot mode =====
+
 
+
Press and hold the USB boot button on Zero, plug in it to PC, '''lsusb''' should see the following:
+
 
+
    Bus 002 Device 030: ID 1b8e:c003 Amlogic, Inc. GX-CHIP
+
 
+
Download the fastboot loader and run it on Zero
+
 
+
    $ wget https://dl.radxa.com/zero/images/loader/factory-loader.img
+
    $ boot-g12.py factory-loader.img
+
 
+
It should output:
+
 
<pre>
 
<pre>
Firmware Version :
+
[74292.229573] usb 1-10.2.3: new high-speed USB device number 84 using xhci_hcd
ROM: 3.2 Stage: 0.0
+
[74292.330483] usb 1-10.2.3: New USB device found, idVendor=1b8e, idProduct=c003, bcdDevice= 0.20
Need Password: 0 Password OK: 1
+
[74292.330487] usb 1-10.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Writing rz-fastboot-loader.bin at 0xfffa0000...
+
[74292.330488] usb 1-10.2.3: Product: GX-CHIP
[DONE]
+
[74292.330489] usb 1-10.2.3: Manufacturer: Amlogic
Running at 0xfffa0000...
+
[74303.432510] usb 1-10.2.3: USB disconnect, device number 84
[DONE]
+
[74303.665204] usb 1-10.2.3: new high-speed USB device number 85 using xhci_hcd
AMLC dataSize=16384, offset=65536, seq=0...
+
[74303.769674] usb 1-10.2.3: New USB device found, idVendor=1b8e, idProduct=2200, bcdDevice=99.99
[DONE]
+
[74303.769678] usb 1-10.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
AMLC dataSize=49152, offset=393216, seq=1...
+
[74303.769679] usb 1-10.2.3: Product: USB download gadget
[DONE]
+
[74303.769680] usb 1-10.2.3: Manufacturer: Radxa
AMLC dataSize=16384, offset=229376, seq=2...
+
[74303.769681] usb 1-10.2.3: SerialNumber: AMLG12A-RADXA-ZERO
[DONE]
+
[74303.771008] usb-storage 1-10.2.3:1.0: USB Mass Storage device detected
AMLC dataSize=49152, offset=245760, seq=3...
+
[74303.771133] scsi host4: usb-storage 1-10.2.3:1.0
[DONE]
+
[74304.785353] scsi 4:0:0:0: Direct-Access    Linux    Radxa Zero UDisk  0ff PQ: 0 ANSI: 2
AMLC dataSize=49152, offset=294912, seq=4...
+
[74304.785506] sd 4:0:0:0: Attached scsi generic sg2 type 0
[DONE]
+
[74304.785679] sd 4:0:0:0: [sdc] 60749504 512-byte logical blocks: (31.1 GB/29.0 GiB)
AMLC dataSize=16384, offset=65536, seq=5...
+
[74304.785796] sd 4:0:0:0: [sdc] Write Protect is off
[DONE]
+
[74304.785798] sd 4:0:0:0: [sdc] Mode Sense: 0f 00 00 00
AMLC dataSize=1406320, offset=81920, seq=6...
+
[74304.785916] sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[DONE]
+
[74304.833523]  sdc: sdc1
[BL2 END]
+
[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.
 
</pre>
 
</pre>
  
Now lsusb should show the following device:
+
You can now use dd to write the raw image to the eMMC on Zero now.
 
+
    Bus 002 Device 016: ID 18d1:0d02 Google Inc. USB download gadget  Serial: 1234567890
+
 
+
===== Step 4: Wipe the eMMC =====
+
 
+
    fastboot devices
+
    1234567890 fastboot
+
 
+
    fastboot flashing unlock_critical
+
    fastboot flashing unlock
+
    fastboot erase bootloader
+
    fastboot erase bootloader-boot0
+
    fastboot erase bootloader-boot1
+
 
+
    fastboot reboot
+
 
+
Unplug and plug the power of Zero, lsusb should show the following:
+
  
     Bus 002 Device 014: ID 1b8e:c003 Amlogic, Inc. GX-CHIP
+
     sudo dd if=/path/to/image of=/dev/new_dev bs=1M
 +
    sync
  
the eMMC is wiped and Zero is in maskrom mode now. You can [[zero/install/eMMC#macOS | install other OS to eMMC]] now.
+
Once you are done flashing, unplug and replug Radxa Zero to quit maskrom mode and boot normally.

Latest revision as of 02:49, 23 January 2022

    Radxa Zero >  Installation >  Install image to eMMC

How to install Linux image to Radxa Zero eMMC

This guide describes how to install the raw images to Radxa Zero series eMMC. Raw image is the standard method to install Linux distro on single board computers, since they don't have standardized way to boot and initialize their hardware.

Requirement

  • Radxa Zero or Radxa Zero 2
  • 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

Install using Windows

If you have existing data that you want to keep, this is your last chance to do so. Please follow maskrom guide to load rz-udisk-loader.bin and make backup accordingly.

Now follow eMMC erase guide to wipe out the existing system. Your computer should detect a new storage device after the file is loaded.

You can now flash your Linux image using balenaEtcher similar to flash microSD card. Choose the newly detected device in your target drive and proceed as normal.

Once you are done flashing, unplug and replug Radxa Zero to quit maskrom mode and boot normally.

Install using Linux or macOS

If you have existing data that you want to keep, this is your last chance to do so. Please follow maskrom guide to load rz-udisk-loader.bin and make backup accordingly.

Now follow eMMC erase guide to wipe out the existing system. Your computer should detect a new storage device after the file is loaded.

Now lsusb should show the following device:

   Bus 001 Device 049: ID 1b8e:2200 Amlogic, Inc. USB download gadget

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

Once you are done flashing, unplug and replug Radxa Zero to quit maskrom mode and boot normally.