BPI-M5: Not booting after I messed up boot.ini on eMMC

My system was running fine on eMMc with raspbian, but I messed up /boot/boot.ini

In panic, I rebooted the system, with a SD-card (raspbian) inserted, but now the system will not start up. All 3 leds are on, and all I see on the HDMI port is the startup logo. No text. It seems to try booting on eMMC. How can I force the M5 to boot the SD-card instead of eMMC, or how do I erase/disable eMMC without a system running?

I hope I did not brick my system!! All help welcome

1 Like

you can see here : https://wiki.banana-pi.org/Getting_Started_with_M5/M2Pro

The best alternative is enter download mode with aml-burning-tool and burn some official android distro available, when reaches 7% you unplug the power and stop the burn in this order. This procedure will erase the Emmc, so you can boot with SDcard normally. The procedure is also written at https://wiki.banana-pi.org/Getting_Started_with_M5/M2Pro

It does not work… When I connect my Linux desktop tot the USB-C port of my M5, and I run

./flash-tool.sh --img=aml_upgrade_package.img --parts=all --wipe --soc=g12a --reset=y

I get “Amlogic device not found” as an answer.

dmesg|grep USB gives:

usb 1-5: new high-speed USB device number 5 using ehci-pci
usb 1-5: New USB device found, idVendor=1b8e, idProduct=c003, bcdDevice= 0.20
usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-5: Product: GX-CHIP
usb 1-5: Manufacturer: Amlogic

I downloaded aml_upgrade_package.img by a torrent, (I dont run windows), would that be correct?

Maybe you need to enter download mode using the SW4 button while powering your device in order to do this command(I am not sure, cause i don’t use linux).

you need to add the usb device to udev rules

#amlogic
SUBSYSTEM=="usb", ATTR{idVendor}=="1b8e", ATTR{idProduct}=="c003", MODE="0666", OWNER="ubuntu"

on linux , it’s a command line tool, you can’t get the “7%” time, but you can flash the android image completely and erase the emmc according to the wiki guide

I don’t known whether the raspbian img you used is same boot sequence as ubuntu or debian. for ubuntu or debian, correct bootloader will try and load boot.ini from sdcard first and boot from it.

I followed all your instructions, it did not work.

This flash-tool , after inspecting the source code, needs two binaries in a subdirectory: update and aml_image_v2_packer. And update will not run without an outdated libusb library…

I executed: ./flash-tool.sh --img=aml_upgrade_package.img --parts=all --wipe --soc=g12a --reset=y

​After I got this running, now I get the error message:

Unpacking image [OK]
awk: cmd. line:1: warning: regexp escape sequence \" is not a known regexp operator
(...)
Initializing ddr [KO]

​ :((( Any solution for this? (I am running Ubuntu 22.04 on my desktop)

I guess you didn’t read the readme carefully before running the script, my desktop is ubuntu 20.04 and it works well

./flash-tool.sh --img=/<path-to-img>/2023-03-01-bpi-m5-m2pro-tablet-android9.img --parts=all --wipe --soc=g12a --reset=y
Rebooting the board ........[OK]
Unpacking image [OK]
awk: cmd. line:1: warning: regexp escape sequence `\"' is not a known regexp operator
....
Initializing ddr ........[OK] 
Running u-boot ........[OK]
Create partitions [OK]
Writing device tree [OK]
Writing bootloader [OK]
Wiping  data partition [OK]
Wiping  cache partition [OK]
Writing boot partition [OK]
Writing dtbo partition [OK]
Writing logo partition [OK]
Writing odm partition [OK]
Writing product partition [OK]
Writing recovery partition [OK]
Writing system partition [OK]
Writing vbmeta partition [OK]
Writing vendor partition [OK]
Resetting board [OK]

SOLVED! This time I did a fresh git clone https://github.com/Dangku/aml-flash-tool.git and a fresh download of 2023-03-01-bpi-m5-m2pro-tablet-android9.img.gz unpacked and run the command in the post above. After that I needed to erase Android: Connect Desktops-USB with the HDMI of the M5, and typed on my Linux desktop: (Do not connect network on the M5!)

adb kill-server
adb devices
adb connect 1234567890
adb root
adb remount
adb shell
reboot fastboot  # in the android shell
fastboot devices
fastboot flashing unlock_critical
fastboot flashing unlock
fastboot erase bootloader
fastboot erase bootloader-boot0
fastboot erase bootloader-boot1

I guess these last commands erased the boot-partitions on the android eMMc… Inserted the SD-card, booted, and voila, the M5 booted from SD!

Thanks for all help