【MA35D1】如何在Uboot下读取SD卡更新SPI NAND

qwang |浏览144次
收藏|2023/08/22 14:38

满意回答

2023/08/22 15:04


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



 




蔡芳芳

其他回答(0)
0人关注该问题
+1
 加载中...