root@OpenWrt:/# mtd erase /dev/mtd0
Unlocking /dev/mtd0 ...
Erasing /dev/mtd0 ...
Skipping bad block at 0x3260000
Skipping bad block at 0x3280000
Skipping bad block at 0x32a0000 root@OpenWrt:/#
Even if I burn the image from USB flash drive to NAND again, it still cannot solve the problem
I have given up on NAND for now. I even exchanged my BPI-R4 for a new one because of the bad block and the problems that came with it. Now I have two bad blocks on the new board.
Although I still don’t understand why the problems occur, because the bad blocks a after the end of the downloadable NAND image from Sinovoip.
I don’t know how to do that. Is it possible to extract the infomation for a compiled (or booted) kernel?
After flashing the NAND image from Sinovoip via a booted OpenWRT-image from Sinovoip from SD card, the NAND works fine. So both of these kernels can handle the NAND memory without any problems.
It’s just when booting the self compiled kernel for the Debian image that it messes with the NAND flash and makes it unbootable. So this kernel must do something different. Either because it has no UBI module compiled in (OpenWRT) or the NAND is in use and Linux does not try to “fix” it because it is busy. Or it really is a speed issue, but I think it’s weird that it’s so repeatable. But who knows.
Afaik SinoVoip image uses downstream/proprietary NMBM from MediaTek, and their bootloader and ARM TrustedFrimware-A will also expect that. If you use vanilla (OpenWrt or Debian or anything built on upstream Linux and not downstream MediaTek SDK) you will also need to replace TF-A and U-Boot with vanilla builds without NMBM (and use UBI instead).
How to change spi frequency ? The default NAND booting well when I first received the board in its default state. After some operations, the NAND partition was accidentally corrupted, then I can’t recover it.
New Debian / Ubuntu Image can be found in their wiki which including new version of loader
as I try flash NAND to be able to flash EMMC a few weeks ago, I also ended at bad blocks mentioned in this topic:
Skipping bad block at 0x05ba0000
Skipping bad block at 0x05bc0000
Skipping bad block at 0x05be0000
Skipping bad block at 0x05c00000
As far as I can remember, I was using original image from B-PI wiki pages for erasing the NAND. Hope, I am remember this “detail” correctly.
I asked Sinovoip on Ali, and it looks like they do not know anything about it:
Manuy thanks to You @frank-w for your image bpi-r4_bookworm_6.8.0-rc3-dango which I am using right now (with re-compiled kernel with various wireless network drivers added, etc…) Everything is working, but on SD card. As I would like get EMMC working to be able to transfer whole system to it, I am curious, does there is any possibility to verify that SPI NAND is really corrupted, or it is something like “speed incompatibily” mentioned?
Try to erase in uboot from my debian image you have running.
Then flash nand bl2+fip, then download emmc image,bl2 from my uboot-repo and initrd from my gdrive. Kernel you can use the itb from sdcard boot partition. Tar your rootfs from sdcard on external pc and put it with the other files on usb storage.boot from nand with emmc enabled and flash bl2 and emmc image and unpack rootfs from your sdcard to your emmc root and kernel to boot.last 2 parts in booted initrd
I had a similar warning message indicating I had bad blocks when flashing NAND, and my device failed to boot after following the instructions in the Getting Started guide.
However, I was able to get my BPI-R4 to boot from nand using the following commands:
Otherwise, I followed the instructions on the Getting Started guide exactly. The only difference was using the mtd command to write the .img file to mtdblock0 instead of the dd command. My guess is that MTD handles the bad blocks that are common in production NAND flash better than the dd command.