[BPI-R3-Mini] [BPI-R3] [BPI-R4] Recovery uart boot to a linux rescue image

Now this is available for BPI-R64/R3/R3mini/R4.

The files can be found here:

https://ftp.woudstra.mywire.org/uartboot/

Find the correct mtk_uartboot executable for your system. I have build files for the R64, R3, R3mini, R4. Only the R3 is tested at the moment.

Make sure you have socat installed, edit /dev/ttyXXXX (twice), and run :

sudo ./mtk_uartboot -p uart-bpir3m-atf.bin -f uart-bpir3m-fip.bin --aarch64 -s /dev/ttyUSB0

Or

sudo bash -c "./mtk_uartboot -p uart-bpir3m-atf.bin -f uart-bpir3m-fip.bin --aarch64 -s /dev/ttyUSB0 ; socat - /dev/ttyUSB0,raw,echo=0,b115200"

The fip file is quite large, so get a cup of coffee when uploading it to the R3mini.

It has my standard archlinuxarm initrd for emmc inside, which drops to a bash shell. The initrd can run my installscript and/or debootstrap. First setup your internet connection on eth0 or any other interface (defaults to wan):

bpir-dhcpc eth0

Now you’re ready to use ‘bpir-build’ ‘bpir-toolbox’ ‘debootstrap’ ‘wget’ ‘curl’ ‘nano’ ‘parted’ ‘mkfs-btrfs’ ‘tar’ ‘xz’ ‘gzip’ ‘zstd’, etc, etc.

You could use:

bpir-toolbox --nand-format

It will download necessary files and install uboot on nand. This version of U-Boot uses the standard distroboot and is setup to scan sd/emmc - nvme - nand, for extlinux.conf in this order. Need to have the boot flag set on the partition where this file can be found. If nothing is found on sd/emmc/nvme, it loads the same rescue initrd, but now from nand.

I need to add more documentation about ‘bpir-toolbox’, but you can look into the file to see which options to use. ‘bpir-build’ to install on nvme is added pretty recently also, so also needs documentation and testing.

Run

bpir-build -F

and go through menu to install on nvme

I can’t seem to get this to work. I downloaded the files, and ran ./mtk_uartboot with the right options, but after I plug in power to my pi, the mtk command it just sits there at “Handshake…”

I’m not sure what you mean by edit the /dev/ttyUSB1 (in my case) twice - could you explain that some more?

Thanks

You need to find how the usb-uart device is called on your system. dmesg after plugging it in is an easy way to find it.

First start the command, then plug power in bpi board.

yeah - it’s definitely on /dev/ttyUSB1. /dev/ttyUSB0 was what I used to talk to the board over the USB-c connection, when I had it plugged into my Linux machine. I switched it to just a power plug in case it was causing any kind of confusion.

I tried multiple times, running the command with the USB-uart plugged in and the power to the board unplugged. Then plugging in the power to the board, and it always just sits on the “Handshake…” output.

The board is set to boot to eMMC - does that matter?

Are you running it with sudo or from root user?

Have you tested the UART in both directions?

I believe not.

Turns out my GND pin was disconnected on one side. I just got this to load and boot!

1 Like