[BPI-R3 Mini] Boot from NAND fails

Is it possible to start the board with the switch in the NAND position, go to uBOOT and download BL2 and so on for eMMC? I understand correctly what is needed in my case bl2, bl3, fip and then sysapgrede ?bl2, bl3, fip and then sysapgrede ?and could you recommend a program to switch to Uboot? I tried using “putty”, but for some reason it is impossible to select a menu item there and send a command in any way

After all, it’s about my CH340G… Commands are not even sent to putty through it, there will be a new UART adapter in a few days (it seems PL2303TA). I started the board with the switch to the NAND position, and tried to log in to Boot (first with my adapter), the commands were not sent, and then I tried to connect again via Type to the laptop and a miracle happened. the native CH340G works correctly and commands come to the board, therefore the matter is with the adapter itself, which cannot send a command from the computer to the board. I wish I knew how to restore bl2 and other partitions without a third-party UART adapter. Or are there any commands (or methods) to restore the emc? (in the NAND position, everything works without the M2 expansion card, even the OpenWRT web interface opens… now I have a lot of questions)

  1. where does OpenWRT come from when booting with the switch to the NAND position if my M2 slot is empty?
  2. is it possible in this case to somehow restore eMMC by running through NAND (without spoiling NAND)?
  3. is it possible to use the board in the NAND position without a NAND device?
  4. do I understand correctly that there is only one memory module on the board, and this is an 8GB eMMC? Screenshot_1 Может ли быть такое, что я образы ImmortalWRT записал в память (я сейчас про eMMC), но он их просто не может найти? Может есть возможность просто их указать (запустив плату в режиме NAND) Well, I don’t have the “usb start” command in Uboot (or am I doing something wrong?)

The default openwrt which is provided by bpi does not support usb in uboot…here i used the openwrt userspace to flash emmc…you can look into my wiki where i have added steps today to flash emmc

1 Like

Could you tell me how the eMMC-NAND switch actually works? Can I perform operations on the eMMC in the NAND switch position?


sorry automatic translation

I found a way to download mtk_uartboot without connecting via a third-party adapter! You only need a TypeC - TypeC cable. It is necessary to connect the board at the moment when the red LED lights up (there is only one!) have time to run this program and you will already be in Uboot (you can check this with the help command)

the switch on r3mini only defines bootdevice (similar to first 2 switches on full r3) as on r3 only 1 spi and 1 mmc device is there…so no tricks are not needed to switch spi-chipselect and mmc-device (last 2 switches on r3)

and yes - as you have only nand and emmc on r3mini, you can access both when booted from both (if your system uboot/linux supports it)

1 Like

It turned out to run mtk_uart boot, upload files to a USB flash drive and download it, but I don’t understand what to do next with them, from the word at all… If it’s not difficult for you to help with this, please. I believe that I have very little time left before the resuscitation of my eMMC

good that you have now uboot loaded with usb support (which looks like mine)…

i do not know the exact files from openwrt/immortalwrt, and if they use a specific way…imho openwrt stores fip in ubifs (i have not done anything with it yet).

i can only guess that the first file (squashfs-sysupgrade) is the kernel with initrd, bl31-uboot.fip is similar to my fip and emmc-preloader is the bl2 which have to be on boot0 block

basic way is described here https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r3:uboot#writing_emmc

fatload usb 0:1 $loadaddr file

and then write the file to the right position. but i do not know the partition sheme for immortalwrt (i guess in the gpt file)…maybe they use for fip the same as i do, but maybe not…

maybe @1715173329 can help here? @dangowrt can help with openwrt specific parts

ImmortalWrt uses the exactly same GPT partition layout as OpenWrt. FYI openwrt/target/linux/mediatek/image/filogic.mk at v23.05.3 · openwrt/openwrt · GitHub

You can run mmc part to print the partition table, then write the firmware to correspond part. See the example provided by @frank-w (thank you).

emmc-bl31-uboot.fip -> fip
initramfs-recovery.itb -> recovery
squashfs-sysupgrade.itb -> production

I can see bl2 failed to load fip. How did you flash the fip?

Then fip should be flashed at block 0x3400,right? I though openwrt uses ubi dor fip,but maybe only for nand/nor

now I’m trying to record eMMC by analogy

block 0x3400

That’s correct. FYI openwrt/package/boot/uboot-mediatek/patches/442-add-bpi-r3-mini.patch at efa71c532e4778433263626bfff1a40e48f6bdb4 · openwrt/openwrt · GitHub

1 Like

I just downloaded it and recorded it sequentially BL2 and FIP

You miss gpt layout when partition is not found

Newer atf (after i created the emmc write section) use search for fip partition instead of fixed offset to get start of fip

Maybe it is enough if you flash the emmc gpt image (3rd in image above) to offset 0x0 of emmc

1 Like

Thanks to you, I have downloaded fip <3 now the next stage :smiley: my kernel is not loading (I wrote ImmortalWRT)

I think I figured it out… I forgot about the instructions

Yesterday I managed to download ImmortalWRT (fork of OpenWRT) 1-3) I downloaded Gpt, bl2, fip from a flash drive 4) And downloaded inittamfs-recovery via tftp 5) Next, I updated sysupgrade via Luci

It remains to update additional packages today. For some reason, they did not want to update yesterday (“opkg update” does not work, error 6 writes)

You can use the Openwrt SNAPSHOT firmware selector version also. It’s working with just a small fix. It took me a few hours to understand why default images not working and self compiled without any problems. You just have to add the missing airoha-en8811h-firmware packages and “REQUEST BUILD” as shown in the picture.

If not added you will get the PHY failure:

mtk_soc_eth 15100000.ethernet eth0: validation of 2500base-x with support 00000000,00000000,000062e8 and advertisement 00000000,00000000,000062c0 failed: -EINVAL
...
Unable to handle kernel access to user memory outside uaccess routines at virtual address
1 Like

It’s strange that the airoha-en8811h-firmware package is missing because kmod-phy-airoha-en8811h is selected, and that depends on airoha-en8811h-firmware. The problem is probably that in this way it doesn’t end up in the initramfs (=recovery) but only in the production (=squashfs+overlay) image… However, that will not change even if you include airoha-en8811h-firmware in the Firmware Selector…

I ran into the same issue today. but still, I can boot from emmc. will read your thread carefully.