<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.radxa.com/mw/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.radxa.com/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rauxon</id>
		<title>Radxa Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.radxa.com/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rauxon"/>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/Special:Contributions/Rauxon"/>
		<updated>2026-06-13T08:21:45Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.3</generator>

	<entry>
		<id>https://wiki.radxa.com/Zero/install/Boot_Troubleshooting</id>
		<title>Zero/install/Boot Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/Zero/install/Boot_Troubleshooting"/>
				<updated>2022-11-26T21:14:33Z</updated>
		
		<summary type="html">&lt;p&gt;Rauxon: /* Common boot related issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{zero_header}}&lt;br /&gt;
&lt;br /&gt;
{{Languages|Zero/install/Boot_Troubleshooting}}&lt;br /&gt;
&lt;br /&gt;
    [[zero | Radxa Zero]] &amp;gt; [[zero/install | Installation]] &amp;gt; [[zero/install/Boot_Troubleshooting | Boot troubleshooting]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
== A detailed guide for troubleshooting Radxa Zero's boot issue ==&lt;br /&gt;
&lt;br /&gt;
This is a more advanced guide aiming to help user fix their boot related issues. Due to how Zero's bootloader can be stored at various locations and how each distro usually has their own quirk about how bootloader is configured, user may find it confusing why the board is not booting as they are expected. This guide will help you understand how Zero decided which bootloader to boot, the current available bootloaders from Radxa, and how to wipe and reinstall any bootloader.&lt;br /&gt;
&lt;br /&gt;
Experience with Linux, [[Zero/dev/maskrom | maskrom]], and Android &amp;lt;code&amp;gt;fastboot&amp;lt;/code&amp;gt; tool is highly recommended.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Amlogic's boot logic ==&lt;br /&gt;
&lt;br /&gt;
When you boot a bare board without any bootloader, you will see the following string printed on your serial console:&lt;br /&gt;
&lt;br /&gt;
    G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;CHK:1F;READ:0;CHK:1F;SD?:0;SD:0;READ:0;CHK:1F;USB:8;&lt;br /&gt;
&lt;br /&gt;
This is how the SoC finds the boot target. It will search eMMC first with 3 read instructions, each for &amp;lt;code&amp;gt;mmcblk0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mmcblk0boot0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;mmcblk0boot1&amp;lt;/code&amp;gt;. If it fails to boot from eMMC it will search microSD card next, and finally the USB devices.&lt;br /&gt;
&lt;br /&gt;
This means, to boot off any given storage media, you need to make sure bootloaders stored before this chain get wiped. Otherwise a different boot configuration will be used, instead of the one that came with your installation media.&lt;br /&gt;
&lt;br /&gt;
Some extra messages when boot from eMMC:&lt;br /&gt;
&lt;br /&gt;
    # boot from mmcblk0&lt;br /&gt;
    G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;0.0&lt;br /&gt;
    # boot from mmcblk0boot0 after mmcblk0 is wiped&lt;br /&gt;
    G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;0.0&lt;br /&gt;
    # boot from mmcblk0boot1 after mmcblk0 and mmcblk0boot0 are wiped&lt;br /&gt;
    G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;CHK:1F;READ:0;0.0&lt;br /&gt;
&lt;br /&gt;
You can read more about eMMC's hardware partitions from [https://wiki.radxa.com/Zero/install/Boot_Troubleshooting#Modify_bootloader_on_eMMC here].&lt;br /&gt;
&lt;br /&gt;
== Modify bootloader on eMMC ==&lt;br /&gt;
&lt;br /&gt;
=== TL;DR ===&lt;br /&gt;
&lt;br /&gt;
We have updated our [[Zero/install/eMMC_erase | eMMC erase]] guide, which does the below operations automatically, and should fix most boot related issues.&lt;br /&gt;
&lt;br /&gt;
Beware this will result in data loss since the partition header will be wiped as well. If you need to preserve the data, either make a disk image before wiping, or follow the manual guide below.&lt;br /&gt;
&lt;br /&gt;
=== With dd ===&lt;br /&gt;
&lt;br /&gt;
If your bootloader is broken you can usually try manual in-place update first. This will preserve your data in eMMC.&lt;br /&gt;
&lt;br /&gt;
First, follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load '''rz-udisk-loader.bin'''. Also download [u-boot.bin.sd.bin](https://dl.radxa.com/zero/images/loader/u-boot.bin.sd.bin) and put it in your current directory.&lt;br /&gt;
&lt;br /&gt;
Once '''rz-udisk-loader.bin''' is loaded you should have a USB storage device detected by your Linux system. Here we call it '''/dev/sdX''' but replace it with your real block device.&lt;br /&gt;
&lt;br /&gt;
Run the following command to update bootloader:&lt;br /&gt;
&lt;br /&gt;
    DEVICE=/dev/sdX&lt;br /&gt;
    sudo dd if=u-boot.bin.sd.bin of=$DEVICE bs=1 count=444&lt;br /&gt;
    sudo dd if=u-boot.bin.sd.bin of=$DEVICE bs=512 skip=1 seek=1&lt;br /&gt;
&lt;br /&gt;
=== With fastboot ===&lt;br /&gt;
&lt;br /&gt;
First, follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load '''rz-fastboot-loader.bin'''.&lt;br /&gt;
&lt;br /&gt;
Once a device with ID 18d1:0d02 is shown in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt; and you can see a fastboot device is detected by &amp;lt;code&amp;gt;sudo fastboot devices&amp;lt;/code&amp;gt;, you can run the following command to wipe/flash image to eMMC:&lt;br /&gt;
&lt;br /&gt;
    # Erase eMMC&lt;br /&gt;
    sudo fastboot erase mmc0&lt;br /&gt;
    sudo fastboot erase mmc0boot0&lt;br /&gt;
    sudo fastboot erase mmc0boot1&lt;br /&gt;
    # Flash eMMC&lt;br /&gt;
    sudo fastboot flash mmc0 linux_distro.img&lt;br /&gt;
    sudo fastboot flash mmc0boot0 bootloader.img&lt;br /&gt;
    sudo fastboot flash mmc0boot1 bootloader.img&lt;br /&gt;
&lt;br /&gt;
You do not need to erase before flashing, and you do not need to flash all 3 partitions. Beware '''sudo fastboot flash mmc0''' could potentially damage your existing data.&lt;br /&gt;
&lt;br /&gt;
=== With Android fastboot ===&lt;br /&gt;
&lt;br /&gt;
In some cases, you will have to use Android's bootloader. This is based on Amlogic's U-Boot source code, so it will behave differently from upstream U-Boot.&lt;br /&gt;
&lt;br /&gt;
First, follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load '''android-bootloader.img'''.&lt;br /&gt;
&lt;br /&gt;
Once a device with ID 18d1:0d02 is shown in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt; and you can see a fastboot device is detected by &amp;lt;code&amp;gt;sudo fastboot devices&amp;lt;/code&amp;gt;, you can run the following command to wipe/flash image to eMMC:&lt;br /&gt;
&lt;br /&gt;
   # Unlock eMMC before we can do anything&lt;br /&gt;
   sudo fastboot unlock&lt;br /&gt;
   sudo fastboot unlock_critical&lt;br /&gt;
   # Backup bootloader&lt;br /&gt;
   sudo fastboot fetch bootloader bootloader.bak&lt;br /&gt;
   sudo fastboot fetch bootloader-boot0 bootloader-boot0.bak&lt;br /&gt;
   sudo fastboot fetch bootloader-boot1 bootloader-boot1.bak&lt;br /&gt;
   # Erase bootloader&lt;br /&gt;
   sudo fastboot erase bootloader&lt;br /&gt;
   sudo fastboot erase bootloader-boot0&lt;br /&gt;
   sudo fastboot erase bootloader-boot1&lt;br /&gt;
   # Flash bootloader&lt;br /&gt;
   sudo fastboot flash bootloader bootloader.img&lt;br /&gt;
   sudo fastboot flash bootloader-boot0 bootloader.img&lt;br /&gt;
   sudo fastboot flash bootloader-boot1 bootloader.img&lt;br /&gt;
&lt;br /&gt;
You do not need to erase before flashing, and you do not need to flash all 3 partitions. Beware '''sudo fastboot flash bootloader''' could potentially damage your existing data.&lt;br /&gt;
&lt;br /&gt;
=== From inside U-Boot ===&lt;br /&gt;
&lt;br /&gt;
If your eMMC is so corrupt that above commands fails, you will need to erase those partitions from U-Boot console. Here is the instructions to do so as a last-ditch.&lt;br /&gt;
&lt;br /&gt;
First set up [[Zero/dev/serial-console | serial console]] since U-Boot console can only be accessed via serial. Follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load '''u-boot.bin'''. After the file is loaded keep hitting Ctrl+C in serial console until the bootloader stopped with a console waiting for command.&lt;br /&gt;
&lt;br /&gt;
    # mmcblk0&lt;br /&gt;
    # WARNING!&lt;br /&gt;
    # Potential data loss!&lt;br /&gt;
    mmc dev 2 0&lt;br /&gt;
    mmc erase 0 20000&lt;br /&gt;
    # mmcblk0boot0&lt;br /&gt;
    mmc dev 2 1&lt;br /&gt;
    mmc erase 0 2000&lt;br /&gt;
    # mmcblk0boot1&lt;br /&gt;
    mmc dev 2 2&lt;br /&gt;
    mmc erase 0 2000&lt;br /&gt;
&lt;br /&gt;
Restart and you should be able to flash the bootloader according to the instructions listed in the [[Zero/install/eMMC_erase | eMMC erase]] guide.&lt;br /&gt;
&lt;br /&gt;
    #restart&lt;br /&gt;
    reset&lt;br /&gt;
&lt;br /&gt;
== Modify bootloader on microSD or USB drive ==&lt;br /&gt;
&lt;br /&gt;
microSD and USB drive both show in Linux system as block devices, so you can modify their bootloader in the same way. Additionally you can also use this method to flash bootloader to eMMC's main partition. However, &amp;lt;code&amp;gt;fastboot&amp;lt;/code&amp;gt; has less potential to make a mistake, so it is still recommended.&lt;br /&gt;
&lt;br /&gt;
First, make sure you have installed the OS of your choice to the storage media. OS installation usually comes with their own bootloader, so if you want to modify the bootloader you have to do so after the installation.&lt;br /&gt;
&lt;br /&gt;
Run any of the following commands to modify bootloader on device &amp;lt;code&amp;gt;/dev/sdX&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    # Backup bootloader&lt;br /&gt;
    sudo dd if=/dev/sdX of=bootloader.bak conv=fsync bs=512 skip=1 count=8192&lt;br /&gt;
    # Erase bootloader&lt;br /&gt;
    sudo dd if=/dev/zero of=/dev/sdX conv=fsync bs=512 seek=1 count=8192&lt;br /&gt;
    # Flash bootloader&lt;br /&gt;
    sudo dd if=bootloader.img of=/dev/sdX conv=fsync bs=512 seek=1 count=8192&lt;br /&gt;
&lt;br /&gt;
== Common boot related issues ==&lt;br /&gt;
&lt;br /&gt;
* Q: Board won't boot on my microSD/USB drive, and is booting stock Android instead.&lt;br /&gt;
* A: Please wipe eMMC's all 3 bootloaders and try again.&lt;br /&gt;
&lt;br /&gt;
* Q: Manjaro won't boot.&lt;br /&gt;
* A: Before 2022-02-04, Manjaro requires the usage of vendor U-Boot, and its image does not contain any bootloader. Please flash [https://dl.radxa.com/zero/images/loader/android-bootloader.img android-bootloader.img] to your storage media. [https://forum.radxa.com/t/update-qt5-version/8552/8?u=radxayuntian Release from 2022-02-04] will contain mainline U-Boot, so the image can be flashed like other distro.&lt;br /&gt;
&lt;br /&gt;
* Q: After using maskrom to start rz-udisk-loader.bin  I cannot see the eMMC storage and see on the console (UART or HDMI): Couldn't find partition mmc 2&lt;br /&gt;
* A: Use maskrom to load u-boot.bin and once the 'starting fastboot' message appears use 'fastboot reboot' and then use maskrom to push rz-udisk-loader.bin&lt;/div&gt;</summary>
		<author><name>Rauxon</name></author>	</entry>

	<entry>
		<id>https://wiki.radxa.com/Zero/dev/maskrom</id>
		<title>Zero/dev/maskrom</title>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/Zero/dev/maskrom"/>
				<updated>2022-11-26T21:03:51Z</updated>
		
		<summary type="html">&lt;p&gt;Rauxon: /* Enable maskrom */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{zero_header}}&lt;br /&gt;
&lt;br /&gt;
{{Languages|zero/dev/maskrom}}&lt;br /&gt;
&lt;br /&gt;
 [[zero | Radxa Zero]] &amp;gt; [[zero/dev | Development Guide]] &amp;gt; [[zero/dev/maskrom | Enter maskrom mode]]&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
This guide describes how to enter maskrom mode on Radxa Zero. Maskrom mode is a special boot mode for Radxa Zero. In this mode CPU will not boot off eMMC or microSD but will instead side load binaries from USB OTG port. This allows you to perform many low level maintenance tasks.&lt;br /&gt;
&lt;br /&gt;
=== Requirement ===&lt;br /&gt;
&lt;br /&gt;
* Radxa Zero&lt;br /&gt;
* A PC/laptop running Windows, Linux, or macOS&lt;br /&gt;
* USB A to C cable or C to C cable, depending on your host&lt;br /&gt;
&lt;br /&gt;
=== Enable maskrom ===&lt;br /&gt;
&lt;br /&gt;
First locate the USB boot button on the bottom of Zero:&lt;br /&gt;
&lt;br /&gt;
[[File:Zero_usb_boot.jpg | 300px]]&lt;br /&gt;
&lt;br /&gt;
Hold this button, then plug Zero into your computer. You can let go the button when you see power LED is on.&lt;br /&gt;
&lt;br /&gt;
On Windows, you can open Device Manager and find the device:&lt;br /&gt;
&lt;br /&gt;
[[File:Windows-GX-CHIP.png]]&lt;br /&gt;
&lt;br /&gt;
On Linux, you can run &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt; to confirm the device is indeed in maskrom mode:&lt;br /&gt;
&lt;br /&gt;
 Bus 001 Device 048: ID 1b8e:c003 Amlogic, Inc. GX-CHIP&lt;br /&gt;
&lt;br /&gt;
=== Install required tools ===&lt;br /&gt;
&lt;br /&gt;
===== Windows =====&lt;br /&gt;
&lt;br /&gt;
Download and install [https://zadig.akeo.ie/ Zagdig] for USB device driver. Make sure that the device is &amp;lt;code&amp;gt;GX-CHIP&amp;lt;/code&amp;gt;, USB ID is &amp;lt;code&amp;gt;1B8E:C003&amp;lt;/code&amp;gt; and choose '''libusb-win32''', then click '''Install Driver'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Zagdig-libusb.png]]&lt;br /&gt;
&lt;br /&gt;
Additionally you can install '''fastboot with '''nexus-tools''' by running the following command in PowerShell:&lt;br /&gt;
&lt;br /&gt;
 iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/install.ps1'))&lt;br /&gt;
&lt;br /&gt;
You will also need [https://dl.google.com/android/repository/usb_driver_r13-windows.zip the Android driver] from Google.&lt;br /&gt;
&lt;br /&gt;
Unzip it and right click the '''.inf''' file to install the driver.&lt;br /&gt;
&lt;br /&gt;
[[File:Install-win-android-driver.png]]&lt;br /&gt;
&lt;br /&gt;
'''fastboot''' is for installing Android, or manually clear eMMC bootloader. If you do not need those you can skip this step.&lt;br /&gt;
&lt;br /&gt;
RZ USB Boot Helper is a Windows tool made by Radxa for maskrom sideloading. Download it from [https://dl.radxa.com/zero/tools/windows/RZ_USB_Boot_Helper_V1.0.0.zip Radxa DL] and unzip everything to a convenient location.&lt;br /&gt;
&lt;br /&gt;
The tool will list the current mode on its interface. Right now we have '''Maskrom mode''':&lt;br /&gt;
&lt;br /&gt;
[[File:Rz-usb-helper-maskrom.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
===== Linux(Ubuntu) &amp;amp; macOS  =====&lt;br /&gt;
&lt;br /&gt;
On *nix platform we can use Amlogic boot tool to side load binary. Run following commands in a new terminal:&lt;br /&gt;
&lt;br /&gt;
macOS:&lt;br /&gt;
 brew install python lsusb libusb&lt;br /&gt;
 pip3 install pyamlboot&lt;br /&gt;
&lt;br /&gt;
Ubuntu:&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt install python3-pip&lt;br /&gt;
 sudo pip3 install pyamlboot&lt;br /&gt;
&lt;br /&gt;
Additionally you can install '''fastboot''' with '''nexus-tools''':&lt;br /&gt;
&lt;br /&gt;
 bash &amp;lt;(curl -s https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/install.sh)&lt;br /&gt;
&lt;br /&gt;
'''fastboot''' is for installing Android, or manually clear eMMC bootloader. If you do not need those you can skip this step.&lt;br /&gt;
&lt;br /&gt;
=== Side loading binaries ===&lt;br /&gt;
&lt;br /&gt;
On Windows, once the tool detected maskrom mode, you can choose binary with '''Select''' button then side load with '''Run'''button:&lt;br /&gt;
&lt;br /&gt;
[[File:Rz-usb-helper-fastboot.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
On *nix you can use '''boot-g12.py''' tool instead:&lt;br /&gt;
&lt;br /&gt;
macOS:&lt;br /&gt;
 boot-g12.py rz-fastboot-loader.bin&lt;br /&gt;
&lt;br /&gt;
Ubuntu:&lt;br /&gt;
 sudo boot-g12.py rz-fastboot-loader.bin&lt;br /&gt;
&lt;br /&gt;
Some precomplied loaders are provided on [https://dl.radxa.com/zero/images/loader/ Radxa website]. Below is a brief description on some of them:&lt;br /&gt;
&lt;br /&gt;
* [https://dl.radxa.com/zero/images/loader/factory-loader.img factory-loader.img]: used to erase eMMC on Windows. Not recommended.&lt;br /&gt;
* [https://dl.radxa.com/zero/images/loader/radxa-zero-erase-emmc.bin radxa-zero-erase-emmc.bin]: automatically erase eMMC, then present eMMC as a USB storage device. This is the recommended way to load a new Linux image.&lt;br /&gt;
* [https://dl.radxa.com/zero/images/loader/rz-fastboot-loader.bin rz-fastboot-loader.bin]: enable fastboot mode. This cannot be used to install our official Android.&lt;br /&gt;
* [https://dl.radxa.com/zero/images/loader/android-bootloader.img android-bootloader.img]: this is the same &amp;lt;b&amp;gt;bootloader.img&amp;lt;/b&amp;gt; from our official Android image. Some distro uses this bootloader.&lt;br /&gt;
* [https://dl.radxa.com/zero/images/loader/rz-udisk-loader.bin rz-udisk-loader.bin]: expose embedded eMMC as a USB Mass Storage device.&lt;br /&gt;
* [https://dl.radxa.com/zero/images/loader/u-boot.bin u-boot.bin]: mainline U-Boot bootloader for USB boot. Won't work if you flashed it to eMMC/microSD.&lt;br /&gt;
* [https://dl.radxa.com/zero/images/loader/u-boot.bin.sd.bin u-boot.bin.sd.bin]: mainline U-Boot bootloader for eMMC/microSD boot. Please refer to [[Zero/dev/u-boot#Run_U-boot | this guide]] to see how to flash it when OS is already installed.&lt;br /&gt;
&lt;br /&gt;
Once Radxa Zero enters into maskrom mode, it will reboot into maskrom mode until the power is cut. As such, it is recommended to completely shut down, unplug, and replug Radxa Zero when you are finish with the maintenance task.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
* Q: RZ USB Boot Helper says &amp;quot;Not detected&amp;quot;.&lt;br /&gt;
* A: Please make sure your USB driver is installed and Zero is in maskrom mode. You should see the following device in your Device Manager:&lt;br /&gt;
&lt;br /&gt;
[[File:libusb.png]]&lt;br /&gt;
&lt;br /&gt;
* Q: RZ USB Boot Helper's Erase button is disabled.&lt;br /&gt;
* A: You can use [https://dl.radxa.com/zero/images/loader/radxa-zero-erase-emmc.bin radxa-zero-erase-emmc.bin] to erase eMMC. It will wipe the device once you click &amp;quot;Run&amp;quot; button.&lt;/div&gt;</summary>
		<author><name>Rauxon</name></author>	</entry>

	<entry>
		<id>https://wiki.radxa.com/File:Windows-GX-CHIP.png</id>
		<title>File:Windows-GX-CHIP.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/File:Windows-GX-CHIP.png"/>
				<updated>2022-11-26T21:03:20Z</updated>
		
		<summary type="html">&lt;p&gt;Rauxon: GX-Chip entry in Windows device manager.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GX-Chip entry in Windows device manager.&lt;/div&gt;</summary>
		<author><name>Rauxon</name></author>	</entry>

	<entry>
		<id>https://wiki.radxa.com/Zero/install/eMMC_erase</id>
		<title>Zero/install/eMMC erase</title>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/Zero/install/eMMC_erase"/>
				<updated>2022-11-26T20:58:55Z</updated>
		
		<summary type="html">&lt;p&gt;Rauxon: /* How to erase eMMC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{zero_header}}&lt;br /&gt;
{{Languages|zero/install/eMMC_erase}}&lt;br /&gt;
    [[zero | Radxa Zero]] &amp;gt; [[zero/install | Installation]] &amp;gt; [[zero/install/eMMC_erase | Erase eMMC]]&lt;br /&gt;
&lt;br /&gt;
=== How to erase eMMC ===&lt;br /&gt;
&lt;br /&gt;
This guide describes how to erase Radxa Zero series eMMC for installing a new system. Beware that this is not a secure erase, and only the bootloader and the partition header are wiped. &lt;br /&gt;
&lt;br /&gt;
For more detailed guide on wiping eMMC (or if this fails), please refer to [[Zero/install/Boot_Troubleshooting | Boot Troubleshooting]] page.&lt;br /&gt;
&lt;br /&gt;
== Requirement ==&lt;br /&gt;
&lt;br /&gt;
* Radxa Zero or Radxa Zero 2&lt;br /&gt;
* A PC/laptop running Windows, Linux, or macOS&lt;br /&gt;
* USB A to C cable or C to C cable, depending on your host&lt;br /&gt;
&lt;br /&gt;
== How to ==&lt;br /&gt;
&lt;br /&gt;
Follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load [https://dl.radxa.com/zero/images/loader/radxa-zero-erase-emmc.bin radxa-zero-erase-emmc.bin] or [https://dl.radxa.com/zero2/images/loader/radxa-zero2-erase-emmc.bin radxa-zero2-erase-emmc.bin]:&lt;br /&gt;
&lt;br /&gt;
[[File:Rz-usb-helper-fastboot.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Once your computer detects a new USB storage device, your eMMC will be wiped and you can flash to this newly found USB device.&lt;/div&gt;</summary>
		<author><name>Rauxon</name></author>	</entry>

	<entry>
		<id>https://wiki.radxa.com/Zero/install/Boot_Troubleshooting</id>
		<title>Zero/install/Boot Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://wiki.radxa.com/Zero/install/Boot_Troubleshooting"/>
				<updated>2022-11-26T20:58:23Z</updated>
		
		<summary type="html">&lt;p&gt;Rauxon: /* An detailed guide for troubleshooting Radxa Zero's boot issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{zero_header}}&lt;br /&gt;
&lt;br /&gt;
{{Languages|Zero/install/Boot_Troubleshooting}}&lt;br /&gt;
&lt;br /&gt;
    [[zero | Radxa Zero]] &amp;gt; [[zero/install | Installation]] &amp;gt; [[zero/install/Boot_Troubleshooting | Boot troubleshooting]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
== A detailed guide for troubleshooting Radxa Zero's boot issue ==&lt;br /&gt;
&lt;br /&gt;
This is a more advanced guide aiming to help user fix their boot related issues. Due to how Zero's bootloader can be stored at various locations and how each distro usually has their own quirk about how bootloader is configured, user may find it confusing why the board is not booting as they are expected. This guide will help you understand how Zero decided which bootloader to boot, the current available bootloaders from Radxa, and how to wipe and reinstall any bootloader.&lt;br /&gt;
&lt;br /&gt;
Experience with Linux, [[Zero/dev/maskrom | maskrom]], and Android &amp;lt;code&amp;gt;fastboot&amp;lt;/code&amp;gt; tool is highly recommended.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Amlogic's boot logic ==&lt;br /&gt;
&lt;br /&gt;
When you boot a bare board without any bootloader, you will see the following string printed on your serial console:&lt;br /&gt;
&lt;br /&gt;
    G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;CHK:1F;READ:0;CHK:1F;SD?:0;SD:0;READ:0;CHK:1F;USB:8;&lt;br /&gt;
&lt;br /&gt;
This is how the SoC finds the boot target. It will search eMMC first with 3 read instructions, each for &amp;lt;code&amp;gt;mmcblk0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mmcblk0boot0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;mmcblk0boot1&amp;lt;/code&amp;gt;. If it fails to boot from eMMC it will search microSD card next, and finally the USB devices.&lt;br /&gt;
&lt;br /&gt;
This means, to boot off any given storage media, you need to make sure bootloaders stored before this chain get wiped. Otherwise a different boot configuration will be used, instead of the one that came with your installation media.&lt;br /&gt;
&lt;br /&gt;
Some extra messages when boot from eMMC:&lt;br /&gt;
&lt;br /&gt;
    # boot from mmcblk0&lt;br /&gt;
    G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;0.0&lt;br /&gt;
    # boot from mmcblk0boot0 after mmcblk0 is wiped&lt;br /&gt;
    G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;0.0&lt;br /&gt;
    # boot from mmcblk0boot1 after mmcblk0 and mmcblk0boot0 are wiped&lt;br /&gt;
    G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;CHK:1F;READ:0;CHK:1F;READ:0;0.0&lt;br /&gt;
&lt;br /&gt;
You can read more about eMMC's hardware partitions from [https://wiki.radxa.com/Zero/install/Boot_Troubleshooting#Modify_bootloader_on_eMMC here].&lt;br /&gt;
&lt;br /&gt;
== Modify bootloader on eMMC ==&lt;br /&gt;
&lt;br /&gt;
=== TL;DR ===&lt;br /&gt;
&lt;br /&gt;
We have updated our [[Zero/install/eMMC_erase | eMMC erase]] guide, which does the below operations automatically, and should fix most boot related issues.&lt;br /&gt;
&lt;br /&gt;
Beware this will result in data loss since the partition header will be wiped as well. If you need to preserve the data, either make a disk image before wiping, or follow the manual guide below.&lt;br /&gt;
&lt;br /&gt;
=== With dd ===&lt;br /&gt;
&lt;br /&gt;
If your bootloader is broken you can usually try manual in-place update first. This will preserve your data in eMMC.&lt;br /&gt;
&lt;br /&gt;
First, follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load '''rz-udisk-loader.bin'''. Also download [u-boot.bin.sd.bin](https://dl.radxa.com/zero/images/loader/u-boot.bin.sd.bin) and put it in your current directory.&lt;br /&gt;
&lt;br /&gt;
Once '''rz-udisk-loader.bin''' is loaded you should have a USB storage device detected by your Linux system. Here we call it '''/dev/sdX''' but replace it with your real block device.&lt;br /&gt;
&lt;br /&gt;
Run the following command to update bootloader:&lt;br /&gt;
&lt;br /&gt;
    DEVICE=/dev/sdX&lt;br /&gt;
    sudo dd if=u-boot.bin.sd.bin of=$DEVICE bs=1 count=444&lt;br /&gt;
    sudo dd if=u-boot.bin.sd.bin of=$DEVICE bs=512 skip=1 seek=1&lt;br /&gt;
&lt;br /&gt;
=== With fastboot ===&lt;br /&gt;
&lt;br /&gt;
First, follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load '''rz-fastboot-loader.bin'''.&lt;br /&gt;
&lt;br /&gt;
Once a device with ID 18d1:0d02 is shown in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt; and you can see a fastboot device is detected by &amp;lt;code&amp;gt;sudo fastboot devices&amp;lt;/code&amp;gt;, you can run the following command to wipe/flash image to eMMC:&lt;br /&gt;
&lt;br /&gt;
    # Erase eMMC&lt;br /&gt;
    sudo fastboot erase mmc0&lt;br /&gt;
    sudo fastboot erase mmc0boot0&lt;br /&gt;
    sudo fastboot erase mmc0boot1&lt;br /&gt;
    # Flash eMMC&lt;br /&gt;
    sudo fastboot flash mmc0 linux_distro.img&lt;br /&gt;
    sudo fastboot flash mmc0boot0 bootloader.img&lt;br /&gt;
    sudo fastboot flash mmc0boot1 bootloader.img&lt;br /&gt;
&lt;br /&gt;
You do not need to erase before flashing, and you do not need to flash all 3 partitions. Beware '''sudo fastboot flash mmc0''' could potentially damage your existing data.&lt;br /&gt;
&lt;br /&gt;
=== With Android fastboot ===&lt;br /&gt;
&lt;br /&gt;
In some cases, you will have to use Android's bootloader. This is based on Amlogic's U-Boot source code, so it will behave differently from upstream U-Boot.&lt;br /&gt;
&lt;br /&gt;
First, follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load '''android-bootloader.img'''.&lt;br /&gt;
&lt;br /&gt;
Once a device with ID 18d1:0d02 is shown in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt; and you can see a fastboot device is detected by &amp;lt;code&amp;gt;sudo fastboot devices&amp;lt;/code&amp;gt;, you can run the following command to wipe/flash image to eMMC:&lt;br /&gt;
&lt;br /&gt;
   # Unlock eMMC before we can do anything&lt;br /&gt;
   sudo fastboot unlock&lt;br /&gt;
   sudo fastboot unlock_critical&lt;br /&gt;
   # Backup bootloader&lt;br /&gt;
   sudo fastboot fetch bootloader bootloader.bak&lt;br /&gt;
   sudo fastboot fetch bootloader-boot0 bootloader-boot0.bak&lt;br /&gt;
   sudo fastboot fetch bootloader-boot1 bootloader-boot1.bak&lt;br /&gt;
   # Erase bootloader&lt;br /&gt;
   sudo fastboot erase bootloader&lt;br /&gt;
   sudo fastboot erase bootloader-boot0&lt;br /&gt;
   sudo fastboot erase bootloader-boot1&lt;br /&gt;
   # Flash bootloader&lt;br /&gt;
   sudo fastboot flash bootloader bootloader.img&lt;br /&gt;
   sudo fastboot flash bootloader-boot0 bootloader.img&lt;br /&gt;
   sudo fastboot flash bootloader-boot1 bootloader.img&lt;br /&gt;
&lt;br /&gt;
You do not need to erase before flashing, and you do not need to flash all 3 partitions. Beware '''sudo fastboot flash bootloader''' could potentially damage your existing data.&lt;br /&gt;
&lt;br /&gt;
=== From inside U-Boot ===&lt;br /&gt;
&lt;br /&gt;
If your eMMC is so corrupt that above commands fails, you will need to erase those partitions from U-Boot console. Here is the instructions to do so as a last-ditch.&lt;br /&gt;
&lt;br /&gt;
First set up [[Zero/dev/serial-console | serial console]] since U-Boot console can only be accessed via serial. Follow [[Zero/dev/maskrom#Enable_maskrom | maskrom guide]] to setup and load '''u-boot.bin'''. After the file is loaded keep hitting Ctrl+C in serial console until the bootloader stopped with a console waiting for command.&lt;br /&gt;
&lt;br /&gt;
    # mmcblk0&lt;br /&gt;
    # WARNING!&lt;br /&gt;
    # Potential data loss!&lt;br /&gt;
    mmc dev 2 0&lt;br /&gt;
    mmc erase 0 20000&lt;br /&gt;
    # mmcblk0boot0&lt;br /&gt;
    mmc dev 2 1&lt;br /&gt;
    mmc erase 0 2000&lt;br /&gt;
    # mmcblk0boot1&lt;br /&gt;
    mmc dev 2 2&lt;br /&gt;
    mmc erase 0 2000&lt;br /&gt;
&lt;br /&gt;
Restart and you should be able to flash the bootloader according to the instructions listed in the [[Zero/install/eMMC_erase | eMMC erase]] guide.&lt;br /&gt;
&lt;br /&gt;
    #restart&lt;br /&gt;
    reset&lt;br /&gt;
&lt;br /&gt;
== Modify bootloader on microSD or USB drive ==&lt;br /&gt;
&lt;br /&gt;
microSD and USB drive both show in Linux system as block devices, so you can modify their bootloader in the same way. Additionally you can also use this method to flash bootloader to eMMC's main partition. However, &amp;lt;code&amp;gt;fastboot&amp;lt;/code&amp;gt; has less potential to make a mistake, so it is still recommended.&lt;br /&gt;
&lt;br /&gt;
First, make sure you have installed the OS of your choice to the storage media. OS installation usually comes with their own bootloader, so if you want to modify the bootloader you have to do so after the installation.&lt;br /&gt;
&lt;br /&gt;
Run any of the following commands to modify bootloader on device &amp;lt;code&amp;gt;/dev/sdX&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    # Backup bootloader&lt;br /&gt;
    sudo dd if=/dev/sdX of=bootloader.bak conv=fsync bs=512 skip=1 count=8192&lt;br /&gt;
    # Erase bootloader&lt;br /&gt;
    sudo dd if=/dev/zero of=/dev/sdX conv=fsync bs=512 seek=1 count=8192&lt;br /&gt;
    # Flash bootloader&lt;br /&gt;
    sudo dd if=bootloader.img of=/dev/sdX conv=fsync bs=512 seek=1 count=8192&lt;br /&gt;
&lt;br /&gt;
== Common boot related issues ==&lt;br /&gt;
&lt;br /&gt;
* Q: Board won't boot on my microSD/USB drive, and is booting stock Android instead.&lt;br /&gt;
* A: Please wipe eMMC's all 3 bootloaders and try again.&lt;br /&gt;
&lt;br /&gt;
* Q: Manjaro won't boot.&lt;br /&gt;
* A: Before 2022-02-04, Manjaro requires the usage of vendor U-Boot, and its image does not contain any bootloader. Please flash [https://dl.radxa.com/zero/images/loader/android-bootloader.img android-bootloader.img] to your storage media. [https://forum.radxa.com/t/update-qt5-version/8552/8?u=radxayuntian Release from 2022-02-04] will contain mainline U-Boot, so the image can be flashed like other distro.&lt;/div&gt;</summary>
		<author><name>Rauxon</name></author>	</entry>

	</feed>