1、修改2个文件
mtd.c -->uboot-custom/cmd/mtd.c
修改函数do_mtd_erase的while循环如下:
while (len) {
ret = mtd_erase(mtd, &erase_op);
off +=mtd->erasesize;
erase_op.addr =off;
if (ret) {
/* Abort if its not a bad block error */
if (ret != -EIO)
break;
printf("Skipping bad block at 0x%08llx\n",
erase_op.addr);
}
len -= mtd->erasesize;
// erase_op.addr += mtd->erasesize;
}
ma35d1.dts -->uboot-custom/arch/arm/dts/ma35d1.dts
调大UBoot内存:
memory {
device_type = "memory";
reg = <0x00000000 0x80000000 0 0x1f000000>; /* 112M */
};
然后编译:
make uboot-rebuild
make arm-tursted-firmware-rebuild
make
烧录,以这个为基础
2、把需要更新的pack文件用nuwriter解包
其中
image5->device-tree
image6->kernel
image7->rootfs
拷贝这3个文件到SD卡,SD卡插入到开发板
3、开机到uboot,输入下面命令:
fatls mmc 0:1
mtd erase device-tree
mtd erase kernel
mtd erase rootfs
fatload mmc 0:1 0x90000000 img5.bin
mtd write device-tree 0x90000000
fatload mmc 0:1 0x90000000 img6.bin
mtd write kernel 0x90000000
fatload mmc 0:1 0x90000000 img7.bin
mtd write rootfs 0x90000000 |