[BPI-R3 Mini] How to unbricked NAND and EMMC

You must not open putty on same com port…it blocks the serial port like minicom in linux…only 1 application can access the serial device. And when the app is running it waits for device to start…then it sends the 2 files and closes…then you can start your putty on same com-port and you should be in uboot with usb support

I have not tried on windows yet.

I try on Linux and I got this.

Yes it waits for the device…now you have to power on the board and should see additional output

I got an error.

the app says the payload is not found…i see you started the application with full path (so not changing the current work dir)…where have you the files? ideally they should be in same dir as the mtk_uartboot binary, then change to this dir and then run with ./mtk_uartboot

It work.

Now I have to install Openwrt on Nand first and then on Emmc ?

Commit in openwrt says emmc first,then nand

Do I have to follow those steps because I have the usb fonction now ?

i guess this guide is similar…have not tried flashing openwrt yet, so i cannot report from own experience

Ok it didn’t work.

And my bootmenu lokk like this.

2

What do you suggest ?

The files i have provided do not have the openwrt specific vars like emmc_write_production

The link in the posting i linked shows manual install in linux

dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5

As you are “only” in uboot you have to convert it to uboot commands

So printing the correct filenames

ls usb 0:1
load usb 0:1 $loadaddr filename
mmc write ...

the problem is that mmc write needs offsets and cannot write to partitions…

one option would be starting a linux-kernel with initrd and doing the linux-steps i linked, or chainloading a openwrt u-boot (load …$uaddr u-boot.bin;go $uaddr) to do the steps manually.

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/boot/uboot-mediatek/patches/442-add-bpi-r3-mini.patch;h=5409f7fa0de71ed406727c1d53cc5a1e733afdeb;hb=HEAD#l533

i have an initrd here:

you can set it in my uboot with “setenv initrd rootfs.cpio.zst” and running newboot

so when all files on usb basicly

  • run useusb
  • setenv initrd rootfs.cpio.zst
  • setenv fit bpi-r3.itb # needs to be a kernel with config for r3mini (you can use a recent bpi-r3.itb from my kernel-repo)
  • run newboot

I get an error.

1

what is the output of

printenv bootconf

?

It should show name of this config

If not please set it like this (maybe with # before)

Amd you have downloaded bpi-r3.itb from 6.6-main release? Previous images have no r3mini support.

But it is possible that bootconf is overwritten by setbootconf as r3 has a detection of devices…So could you do

printenv setbootconf

And if there is the detection (checkmmc,checkspi) just change it to fixed bootconf

setenv setbootconf 'setenv bootconf "#conf-emmc-mini"'

Ok it works.

Do I have to put root as login and follow the link in the posting in a Linux terminal or UART console ?

Yes simply use username root…no pw in initrd

Ok and do I have to follow those steps on a Linux terminal ?

dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5

Yes,it is possible you have to disable boot0 readonly mode first

I think I did it. I just follow your guide for the BPI R3.

Now its asking me to do tftp for the recovery file but it dosn’t work.

I cannot help much with openwrt specific stuff,but it looks it loads something from mmc first without error…only has error with the leds (missing config option in uboot?). You can try adding the uboot option to uboot (but i do not know how).