打印
[技术问答]

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

[复制链接]
130|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
两只袜子|  楼主 | 2023-8-22 15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
如何在Uboot下读取SD卡更新SPI NAND

使用特权

评论回复
沙发
riplay| | 2023-8-23 09:16 | 只看该作者
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

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2001

主题

7028

帖子

10

粉丝