开发过程中,特别进行linux驱动开发时,需要频繁更新内核,或都更新module。module可以通过网络NFS挂载文件系统进行处理,内核可通过网络TFTP服务器进行加载。嵌入式linux开机从TFTP服务器加载linux内核方法如下:
一、IP
环境变量设置固定IP,修改env.txt
ethaddr=00:00:00:11:66:88
ipaddr=198.168.1.25
netmask=255.255.255.0
serverip=198.168.1.18
二、加载路径
方法一:修改env.txt
bootcmd=md 0x7fc0; tftp 0x7fc0 nuc970/kernel/970uimage; md 0x7fc0; bootm 0x7fc0
方法二:命令修改
setenv bootcmd "md 0x7fc0; tftp 0x7fc0 nuc970/kernel/970uimage; md 0x7fc0; bootm 0x7fc0"
附:env.txt
1、从FLASH加载
baudrate=115200
bootcmd=nboot 0x7fc0 0 0x200000; bootm 0x7fc0
bootdelay=1
ethact=emac
ethaddr=00:00:00:11:66:88
stderr=serial
stdin=serial
stdout=serial
2、从TFTP服务器加载
baudrate=115200
bootcmd=md 0x7fc0; tftp 0x7fc0 nuc970/kernel/970uimage; md 0x7fc0; bootm 0x7fc0
bootdelay=1
ethact=emac
ethaddr=00:00:00:11:66:88
ipaddr=198.168.1.25
netmask=255.255.255.0
serverip=198.168.1.18
stderr=serial
stdin=serial
stdout=serial