Hello everyone. I just got my new BPI-R3 Mini. The stock firmware that came with it seems to be working fine, but I would like to install the official OpenWrt on eMMC.
Since this router doesn’t accept SD Card, and I don’t have a UART debug cable, I am a little concerned of bricking it. I just wanted to make sure that I am booting from NAND, so that I can update eMMC successfully. How can I make sure that I am booting from NAND?
The reason I am questioning this, is because the boot switch says one thing, but commands like df or lsblk says otherwise.
For example, when the boot switch is set to eMMC, I get the following outputs from df and lsblk.
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 43.8M 43.8M 0 100% /rom
tmpfs 997.0M 3.4M 993.7M 0% /tmp
/dev/mtdblock10 980.3M 5.8M 974.5M 1% /overlay
overlayfs:/overlay 980.3M 5.8M 974.5M 1% /
tmpfs 512.0K 0 512.0K 0% /dev
root@OpenWrt:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mtdblock0 31:0 0 128M 0 disk
mtdblock1 31:1 0 1M 1 disk
mtdblock2 31:2 0 512K 0 disk
mtdblock3 31:3 0 2M 0 disk
mtdblock4 31:4 0 2M 0 disk
mtdblock5 31:5 0 4.5M 1 disk
mtdblock6 31:6 0 2M 0 disk
mtdblock7 31:7 0 2M 1 disk
mtdblock8 31:8 0 32M 0 disk
mtdblock9 31:9 0 1G 0 disk /rom
mtdblock10 31:10 0 980.3M 0 disk /overlay
mtdblock11 31:11 0 2G 0 disk
mtdblock12 31:12 0 4.2G 0 disk
mmcblk0 179:0 0 7.3G 0 disk
├─mmcblk0p1 179:1 0 17K 0 part
├─mmcblk0p2 179:2 0 512K 0 part
├─mmcblk0p3 179:3 0 2M 0 part
├─mmcblk0p4 179:4 0 2M 0 part
├─mmcblk0p5 179:5 0 32M 0 part
└─mmcblk0p6 179:6 0 256M 0 part
mmcblk0boot0 179:8 0 4M 1 disk
mmcblk0boot1 179:16 0 4M 1 disk
Isn’t MTD related to NAND storage? Why are they being mounted when the boot switch is set to eMMC?
Likewise, if I set the boot switch to NAND, seems that it’s mounting the eMMC storage, as can be seen below:
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 44.0M 44.0M 0 100% /rom
tmpfs 997.0M 2.8M 994.2M 0% /tmp
/dev/ubi0_2 9.1M 624.0K 8.0M 7% /overlay
overlayfs:/overlay 9.1M 624.0K 8.0M 7% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mmcblk0p6 43.8M 43.8M 0 100% /mnt/mmcblk0p6
root@OpenWrt:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mtdblock0 31:0 0 128M 0 disk
mtdblock1 31:1 0 1M 1 disk
mtdblock2 31:2 0 512K 0 disk
mtdblock3 31:3 0 2M 0 disk
mtdblock4 31:4 0 2M 0 disk
mtdblock5 31:5 0 64M 0 disk
mmcblk0 179:0 0 7.3G 0 disk
├─mmcblk0p1 179:1 0 17K 0 part
├─mmcblk0p2 179:2 0 512K 0 part
├─mmcblk0p3 179:3 0 2M 0 part
├─mmcblk0p4 179:4 0 2M 0 part
├─mmcblk0p5 179:5 0 32M 0 part
└─mmcblk0p6 179:6 0 256M 0 part /mnt/mmcblk0p6
mmcblk0boot0 179:8 0 4M 1 disk
mmcblk0boot1 179:16 0 4M 1 disk
ubiblock0_1 254:0 0 43.8M 0 disk /rom
Dont be concerned, its hard to brick: even if you write garbage to both eMMC and NAND, you can still use the mtk_uartboot method to bootstrap some minimal environment to re-flash them. Also the USB-C port has a built-in UART serial console, so you can power it from your PC while accessing the console.
Its correct: mmcblk* related to eMMC, and mtd* related to NAND. What is the output of the mount command? Also, there is a register called EC which has value 2000 if the switch is at the eMMC and 1000 if at the NAND position. Maybe someone know how to read that register value from Linux.
I did not know the USB-C port has a built-in UART serial console. That is EXCELLENT and so much easier than opening the case and connecting a UART adapter to the GND/TX/RX pins.
Thanks a lot for the USB-C tip. I have never found any information about this on the router’s Getting Started page, nor on the forum. According to the boot log it seems to be working as expected.