I am trying to update the Linux kernel for our product. Instead of doing it from U-boot, I need to do it within Linux because we do not have serial connection for the devices in the field.
I have done the following:
in Linux:
$cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00020000 "vf-bcb"
mtd1: 00160000 00020000 "u-boot"
mtd2: 00080000 00020000 "u-boot-env"
mtd3: 00800000 00020000 "kernel-ubi" **** this is the image I want to replace ****
mtd4: 01000000 00020000 "rootfs-ubi"
mtd5: 06600000 00020000 "userfs-ubi"
$mtd_debug info /dev/mtd3
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_WRITEABLE
mtd.size = 8388608 (8M)
mtd.erasesize = 131072 (128K)
mtd.writesize = 2048 (2K)
mtd.oobsize = 64
regions = 0
$./flash_erase /dev/mtd3 0 0
Erasing 128 Kibyte @ 64007e0000 -- 0 % complete
$nandwrite /dev/mtd3 /mnt/sd/v3_kernel.img -p
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
Writing data to block 5 at offset 0xa0000
Writing data to block 6 at offset 0xc0000
Writing data to block 7 at offset 0xe0000
Writing data to block 8 at offset 0x100000
Writing data to block 9 at offset 0x120000
Writing data to block 10 at offset 0x140000
Writing data to block 11 at offset 0x160000
Writing data to block 12 at offset 0x180000
Writing data to block 13 at offset 0x1a0000
Writing data to block 14 at offset 0x1c0000
Writing data to block 15 at offset 0x1e0000
Writing data to block 16 at offset 0x200000
Writing data to block 17 at offset 0x220000
Writing data to block 18 at offset 0x240000
Writing data to block 19 at offset 0x260000
After rebooting, I received the following error in u-boot:
UBI error: ubi_read_volume_table: the layout volume was not found
UBI error: ubi_init: cannot attach mtd1
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22
Please help… Did I miss something? I was actually re-programming the same kernel image in the process. I want to make sure it can bootup properly after re-programming before using the new Linux kernel.
thank you