I tried to boot into openwrt from emmc, the lan port resumed, I think it’s related to the driver not yet loaded when using u-boot
Finally, I found the windows notebook, but return as below (keep handshaking…)
C:\temp\uartboot>mtk_uartboot -s com3 --aarch64 --payload bpi-r3mini_ram_bl2.bin --fip bpi-r3mini_ram_fip.bin
mtk_uartboot - 0.1.1
Using serial port: com3
Handshake…
The uboot you have now only resises in memory,no storage was touched. So after poweroff you have same state as before.
You can load anything from usb e.g. the openwrt files to do installation steps. Mtd should be compiled in my binary,but ubi i guess is missing. Maybe openwrt also has uboot.bin somewhere too which you could chainload (afaik fip does not work) with go command after loading it. See wiki page above. You could also start openwrt recovery from the uboot prompt, see manual kernel loading steps in my wiki (fatload,bootm with the right bootconf).
uploaded new uboot-binaries which should have the ubi-commands, so it should be possible to execute the commands from openwrt
these should be the needed vars from openwrt bpi-r3 env to install openwrt to nand (need to be defined via setenv)
snand_write_bl2=mtd erase bl2 0x0 0x100000 && mtd write bl2 $loadaddr 0x0 0x40000 && mtd write bl2 $loadaddr 0x40000 0x40000 && mtd write bl2 $loadaddr 0x80000 0x40000 && mtd write bl2 $loadaddr 0xc0000 0x40000
ubi_format=ubi detach ; mtd erase ubi && ubi part ubi
ubi_init=run ubi_format && run ubi_init_bl && run ubi_init_openwrt && run ubi_init_emmc_install
ubi_init_openwrt=run sdmmc_read_recovery && iminfo $loadaddr && run ubi_write_recovery ; run sdmmc_read_production && iminfo $loadaddr && run ubi_write_production
ubi_init_bl=run sdmmc_read_snand_bl2 && run snand_write_bl2 && run sdmmc_read_snand_fip && run ubi_write_fip
ubi_init_emmc_install=run sdmmc_read_emmc_install && run ubi_write_emmc_install
ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
ubi_write_fip=run ubi_remove_rootfs ; ubi check fip && ubi remove fip ; ubi create fip 0x200000 static ; ubi write $loadaddr fip 0x200000
ubi_write_emmc_install=ubi check emmc_install && ubi remove emmc_install ; ubi create emmc_install 0x800000 dynamic ; ubi write $loadaddr emmc_install 0x800000
ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
not sure where the nand bl2 is loaded from…maybe it can be done in an easier way manually…
Hi @frank-w,
Thanks for your help again.
I tried and looks good. if boot from NAND, I can see the u-boot menu with couple of items:
Enter kernel-name to boot from SD/EMMC.
Boot kernel from tftp
boot from sd/emmc
boot kernel from NVME
exit
Moreover, I tried to boot from emmc that included the openwrt snapshot OS. And I store all required bin/fib files into the usb drive. But the OS cannot detect the usb drive under /dev/sda1
My uboot (fip) should support usb,but access is different to linux…you have to run command “usb start” first and then you can list with “ls usb 0:1”,load file with “load usb 0:1 $loadaddr file”
In my uboot you can use also use “run useusb” for first 2 commands.
Hi @frank-w
Thanks.
I would like to know more:
bpi-r3mini_spim-nand_bl2.img - is it the u-boot
bpi-r3mini_spim-nand_fip.bin - is it the openwrt os?
Thanks
No, bl2 is second state bootloader (first after internal bootrom) which loads bl3 (uboot/fip). There is no openwrt or any other linux based userspace. You have to install openwrt from uboot
These 2 files only give you a software console (uboot) to doadditional steps (booting a linux kernel e.g. with initrd or install any os like openwrt)
If I run the fatload command to load the openwrt factory bin, what is the complete write command and be? seems need the locate like 0x000xxx something
Thanks
As far as I understand until now it should be a nand-image - that’s why I’m asking and that’s why I changed it in my command above to nand-fip.bin.
What I didn’t find out are the destination addresses or in other words, i wonder if the given address are correct for r3-mini, especially when flashing the fip-image. I asume the 0x0 0x100000 Adress for the bl2-image is correct (?), but is the dimension of the nand in r3-mini the same like in the r3? Can I use these addresses for the fip-image 0x380000 0x200000?
And then another thing that isn’t clear to me - maybe a very stupid question: