[BPI-R4] No NVME and bad NAND on BPI-R4 8GB version

I received my BPI-R4 8GB version today and I was hoping it would be an easy swap from my 4GB version. Unfortunately that does not seem to be the case. The new BPI-R4 does not seem to recognise the NVME drive.

Does anyone know if any hardware changes have been made to the BPI-R4 8GB version besides the added RAM?

Perhaps unrelated I also seem to have gotten a version with many bad NAND blocks:

NOTICE:  BL2: v2.9(release):7154cf66405 spim-nand
NOTICE:  BL2: Built : 09:15:14, Feb 27 2025
NOTICE:  WDT: Cold boot
NOTICE:  WDT: disabled
NOTICE:  CPU: MT7988
NOTICE:  EMI: Using DDR unknown settings
NOTICE:  EMI: Detected DRAM size: 4096 MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  SPI_NAND parses attributes from parameter page.
NOTICE:  SPI_NAND Detected ID 0xef
NOTICE:  Page size 2048, Block size 131072, size 268435456
NOTICE:  UBI: scanning [0x200000 - 0x10000000] ...
NOTICE:  UBI: Bad EC magic in block 1008 ffffffff
NOTICE:  UBI: Bad EC magic in block 1009 ffffffff
NOTICE:  UBI: Bad EC magic in block 1010 ffffffff
NOTICE:  UBI: Bad EC magic in block 1011 ffffffff
NOTICE:  UBI: Bad EC magic in block 1012 ffffffff
NOTICE:  UBI: Bad EC magic in block 1013 ffffffff
....
NOTICE:  UBI: Bad EC magic in block 2027 ffffffff
NOTICE:  UBI: Bad EC magic in block 2028 ffffffff
NOTICE:  UBI: Bad EC magic in block 2029 ffffffff
NOTICE:  UBI: Bad EC magic in block 2030 ffffffff
NOTICE:  UBI: Bad EC magic in block 2031 ffffffff
NOTICE:  UBI: scanning is finished
NOTICE:  UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
NOTICE:  UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
NOTICE:  UBI: Volume fip (Id #0) size is 2097152 bytes
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.9(release):7154cf66405 spim-nand

Can anyone suggest how to fix the UBI partition to prevent this from showing? It’s quite annoying as it ads 2-3s or so the boot process.

I received the new BPI-R4 8GB version today as well. Here is my output booting from NAND out of the box:

NOTICE:  BL2: v2.11.0(release):
NOTICE:  BL2: Built : 11:21:00, Mar  8 2025
NOTICE:  WDT: Cold boot
NOTICE:  WDT: disabled
NOTICE:  CPU: MT7988
NOTICE:  EMI: DDR4 4BG mode
NOTICE:  EMI: Using DDR unknown settings
NOTICE:  EMI: Detected DRAM size: 8192 MB
NOTICE:  EMI: complex R/W mem test passed
WARNING: CASN page check failed
WARNING: Fail to read CASN page. Try reading parameter page
NOTICE:  SPI_NAND parses attributes from parameter page.
NOTICE:  SPI_NAND Detected ID 0xef
NOTICE:  Page size 2048, Block size 131072, size 268435456
NOTICE:  Initializing NMBM ...
NOTICE:  Signature found at block 2047 [0x0ffe0000]
NOTICE:  First info table with writecount 2 found in block 1920
NOTICE:  Second info table with writecount 2 found in block 1923
NOTICE:  NMBM has been successfully attached in read-only mode
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.11.0(release):
NOTICE:  BL31: Built : 11:21:04, Mar  8 2025

Did you overwrite the BL2 with an older version? My output shows BL2: v2.11.0 (release) while yours displays v2.9. Also, your system is only detecting 4GB of RAM when it should be 8GB.

NOTICE:  EMI: Detected DRAM size: 4096 MB

If you flashed a BL2 version from the 4GB RAM variant onto a board with 8GB, it may cause issues. The documentation states:

BPI-R4-8G-BE1350-WIFI_MP4_1-SDK-20240318 (Only for BPI-R4-8G 8G RAM version, cannot use on BPI-R4-4G 4G RAM version)
BPI-R4-8G-BE1350-WIFI_MP4_1-SDK-20240318 (Only for BPI-R4-8G 8G RAM version, cannot use on BPI-R4-4G 4G RAM version

Regarding the NVMe, perhaps you also installed an older kernel version that doesn’t include the clock patch for the PCIe Key B:

bpi-r4-how-to-activate-key-b-pcie2-11280000-solved

bpi-r4-failed-attempt-add-nvme-support-on-uboot

Thanks @Dot_Brian. I did use some older bl2 and fip images, but they were the same exact ones I use on my BPI-R4 4GB version. On that one the NVME works flawlessly in u-boot (and the kernel), so I was expecting it would work here too, assuming no changes to HW besides the RAM. I also noticed the 4GB limit on my uboot but thought I’d shelf then for now.

If you don’t mind and have an NVME device plugged in, could you please check if it is suppoerted in uboot on your board, perhaps by running pci enum; nvme scan; nvme info.

Sorry about that, in the location where I am at the moment, I just checked several of the mini-PCs I have with me, and all of them either have the storage soldered or use old SSDs.

Hopefully, someone else who has received the 8GB version can do a quick test with the NVMe.

Oh,i hoped 8gb bl2 is also compatible with the 4gb variant.

If I’m not mistaken, even the 4GB variant requires modifying the BL2 if you manually upgrade the RAM to 8GB.

Edit: Oh, sorry, I misread. You meant the other way around, that the 8GB is compatible with the 4GB. Yeah, definitely not compatible, according to the official doc.

Ok so 8GB version flashed to 4GB does not work:

F0: 102B 0000
FA: 1042 0000
FA: 1042 0000 [0200]
F9: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
BP: 0600 0041 [0000]
G0: 1190 0000
EC: 0000 0000 [1000]
MK: 0000 0000 [0000]
T0: 0000 01A7 [0101]
Jump to BL

NOTICE:  BL2: v2.9(release):4a09cff84e9-dirty spim-nand
NOTICE:  BL2: Built : 22:33:21, Apr  1 2025
NOTICE:  WDT: [40000000] Software reset (reboot)
NOTICE:  CPU: MT7988
NOTICE:  EMI: DDR4 4BG mode
NOTICE:  EMI: Using DDR unknown settings
NOTICE:  EMI: Detected DRAM size: 0 MB

4GB → flashed on the 8GB does (but you are limited to 4GB), see my OP.

1 Like

Another quick update. Managed to get all the 8GB working using the initial instructions

Log appended at the end. I am still getting the UBI: Bad EC magic warning. Help or suggestions welcome for this.

NVME seems to be detected if but not from cold boot. I have a Lexar drive which might need some querks or patches to work. I’ll see if I can find some other drive to test with.

Device 0: Vendor: 0x1e4b Rev: 9256     Prod: ----------------------
Type: Hard Disk
Capacity: 488386.3 MB = 476.9 GB (1000215216 x 512)

Log for the BPi-R4-8GB boot:

F0: 102B 0000
FA: 1042 0000
FA: 1042 0000 [0200]
F9: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
BP: 0600 0041 [0000]
G0: 1190 0000
EC: 0000 0000 [1000]
MK: 0000 0000 [0000]
T0: 0000 01A6 [0101]
Jump to BL

NOTICE:  BL2: v2.9(release):4a09cff84e9-dirty spim-nand
NOTICE:  BL2: Built : 22:33:21, Apr  1 2025
NOTICE:  WDT: Cold boot
NOTICE:  WDT: disabled
NOTICE:  CPU: MT7988
NOTICE:  EMI: DDR4 4BG mode
NOTICE:  EMI: Using DDR unknown settings
NOTICE:  EMI: Detected DRAM size: 8192 MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  SPI_NAND parses attributes from parameter page.
NOTICE:  SPI_NAND Detected ID 0xef
NOTICE:  Page size 2048, Block size 131072, size 268435456
NOTICE:  UBI: scanning [0x200000 - 0x10000000] ...
NOTICE:  UBI: Bad EC magic in block 1008 ffffffff
....
NOTICE:  UBI: Bad EC magic in block 2030 ffffffff
NOTICE:  UBI: Bad VID magic in block 2031 4e4d4d30
NOTICE:  UBI: scanning is finished
NOTICE:  UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
NOTICE:  UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
NOTICE:  UBI: Volume fip (Id #0) size is 2097152 bytes
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.9(release):4a09cff84e9-dirty spim-nand
NOTICE:  BL31: Built : 22:33:48, Apr  1 2025


U-Boot 2025.01-g3934839f01ec-dirty (Apr 01 2025 - 22:29:36 +0100)

CPU:   MediaTek MT7988
Model: mt7988-rfb
DRAM:  8 GiB
Core:  50 devices, 20 uclasses, devicetree: separate
MMC:   mmc@11230000: 0
Loading Environment from UBI... spi-nand: spi_nand spi_nand@0: Winbond SPI NAND was found.
spi-nand: spi_nand spi_nand@0: 256 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
ubi0: attaching mtd2
ubi0: scanning is finished
ubi0: attached mtd2 (name "ubi", size 126 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 1007, bad PEBs: 1, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 929, total reserved PEBs: 78, PEBs reserved for bad PEB handling: 39

does the AVAIL_DRAM_SIZE change break bl2 for 4GB version or only the compile-switch (DDR4_4BG_MODE)? i guess last one… have you tested adding this to make call instead of modifying the Makefile?

It is DDR4_4BG_MODE=1 that breaks bl2 for the 4GB. I am passing this to the command line of mtk-atf.

For AVAIL_DRAM_SIZE I patched the file. This one doesen’t break anything, just gets ignored if ‘DDR4_4BG_MODE’ is not used.

1 Like

updated my code/pipeline to support 8GB too

but not yet tested as i do not have no 8GB board yet, maybe someone can report back?

1 Like