当前位置: 首页 > 图灵资讯 > 技术篇> 韦东山-烧写uboot、kernel、文件系统

韦东山-烧写uboot、kernel、文件系统

来源:图灵教育
时间:2023-07-02 17:13:55

韦东山的烧写方法:1 oflash烧写 在windows上找到oflash的文件夹 输入 oflash <要烧写的文件名> 安装步骤完成后即可。

这种方法是用openjtag烧写的。

2 usb+dnw烧写 韦东山ubot的开机界面,在几秒钟内按下空间。电脑端打开dnw软件,configuration->opention连接软件,USB Port->transmit 选择要烧写的文件

3 uboot+flash3,tftp烧写 烧写前的准备 nandflash分区信息

OpenJTAG> mtdpart

device nand0 <nandflash>, # parts = 4

#: name size offset

0: bootloader 0x00040000 0x00000000 //256k

1: params 0x00020000 0x00040000 //128k

2: kernel 0x00200000 0x00060000 //2m

3: root 0x0fba0000 0x00460000 //剩下的全部

三、设置环境变量

print ///打印环境变量

save ///保存环境变量

setenv bootdelay 5 //设置bootcmd延迟5

setenv ipaddr 192.168.1.226 //设置开发板IP

setenv serverip 192.168.1.200 ///设置服务器ip(Windows) 在tftp中使用您的计算机ip

setenv gatewayip 192.168.1.254 //设置网关

setenv netmask 255.255.255.0 //设置子网掩码

3.2 重新编写整个系统的步骤: 格式化:nand scrub

将uboot中的环境变量保存到nand flash 中: saveenv

查看分区信息:

烧写uboot:(因为要使用tftp,所以要打开tftp工具,配置ipadr和serverip)

tftp 0x30008000 u-boot.bin //uboot.bin 下载到sdram 0x30008000

nand erase bootloader //擦除bootloader区域 同 nand erase 0x60000 0x20000

nand write 0x30008000 bootloader ///烧写bootloder 同 nand write 0x30008000 0x0 40000

烧写内核

tftp 0x30008000 uImage

nand erase kernel //同 nand erase 60000 200000

nand write 0x30008000 kernel //同 nand write 0x30008000 60000 200000

tftp 0x30008000 fs_mini.yaffs2

nand erase root //同 nand erase 260000 fda0000

nand write.yaffs 0x30008000 260000 $(filesize) // $(filesieze) 是 fs_mini.yaffs2 tftp一步中会有提示信息

/从JFFS到NandFlash烧写JFFS

打开 tftpd32.exe 软件,将 fs_mini.jffs2 复制到工作目录

依次输入SecureCRT:

tftp 0x30008000 fs_mini.jffs2

nand erase root

nand write.jffs2 0x30008000 root $(filesize) // $(filesieze) 是 fs_mini.yaffs2 的大小

hi35xx spi flash烧写:

uboot烧写:mw.b 82000000 ff 100000;tftp 0x82000000 uboot3518.bin;sf probe 0;sf erase 0x0000 0x100000;sf write 82000000 0x0000 0x100000;

内核烧写mw.b 82000000 ff 300000;tftp 0x82000000 uImage;sf probe 0;sf erase 100000 300000;sf write 82000000 100000 300000;

文件系统烧写mw.b 82000000 ff c00000;tftp 0x82000000 rootfs.jffs2;sf probe 0;sf erase 400000 c00000;sf write 82000000 400000 c00000;

设置启动参数setenvv bootargs 'mem=32M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=hi_sfc:1M(boot),3M(kernel),12M(rootfs)';

setenv bootcmd 'sf probe 0;sf read 0x82000000 0x100000 0x300000;bootm 0x82000000';

saveenv;