前言:
烧录uboot、kernel、rootfs是开发者使用开发板的第一步,也是之后开发中必须熟悉的一步,通常在开发中是使用uboot中nand命令来烧录,一是工具简单(一个串口工具即可),二是能掌握nand命令的使用。以上的前提是在uboot中进行的,那首先如何烧录uboot呢?如何烧录kernel或者如何自动从tftp服务器下载kernel并启动呢,如何烧录rootfs或者如何挂载nfs文件系统呢?
烧录uboot
烧录uboot的方法主要有三种,一是dnw,此方法比较麻烦每次重启后需要数字签名。二是sd烧录卡,此方法最简单,在还原官方uboot时很方便,推荐最好有一个sd烧录卡。三是uboot中nand命令烧录,此方法前期需要配置好tftp服务器、开发板ip设置,对后期的使用比较方便。
方法一:
首先介绍uboot中的烧录方法,在原有的uboot中使用print命令查看开发板的信息,并使用set命令设置ip。
GEC210 # print
mtdpart=80000 400000 3000000
bootdelay=3
baudrate=115200
ethaddr=00:40:5c:26:0a:5b
machid=0x998
bootcmd=nand read 0x30008000 0x600000 0x500000; bootm 0x30008000 //内核从flash中的启动
bootargs=root=/dev/mtdblock4 rootfstype=yaffs2 init=/linuxrc console=ttySAC0,115200 //文件系统从flash中启动的命令
filesize=68000
fileaddr=40000000
gatewayip=192.168.1.1 //ubuntu中ip的网关
netmask=255.255.255.0 //子网掩码
serverip=192.168.1.108 //ubuntu的ip
ipaddr=192.168.1.88 //开发板的ip
stdin=serial
stdout=serial
stderr=serial
Environment size: 406/16380 bytes
以下设置ip为192.168.1.108为例
set gatewayip 192.168.1.1
set serverip 192.168.1.203
set netmask 255.255.255.0
saveenv