JZ2440文件系统通过tftp拉取文件
2018年9月11日12点27分
harmful-cahn
前言:
tftp在uboot、文件系统阶段拉取文件。
首先设置各网卡在同一子网段
虚拟机 192.168.137.230
PC 192.168.137.1(我开的使网络共享,用PC机做路由,所以网段设置为这个)
PC服务器 192.168.137.222(我自己放文件用的,不用管)
JZ2440开发板 192.168.137.11
【*】以下为PC机操作【*】
window打开tftpd32,选择tftp Client,如图输入
Host:jz2440开发板设置的IP
Port:69 //tftp端口
Local File:我的是tftp软件所在目录
Server interface:PC机IP
【*】以下为JZ2440配置操作,其他自行百度【*】
//uboot===============================
1、进入uboot,按【q】退出menu,进入命令行模式
2、设置信息
set ipaddr 192.168.137.11
set gatewayip 192.168.137.1 //路由
set serverip 192.168.137.1 //PC机的IP
save //保存
print //查看信息是否更改了
ping 192.168.137.1 //查看时候连通了,
显示【not alive】,连接失败
显示【alive】,连接成功,不管其他信息
tftp 0x30000000 uImage //开始拉取文件 //0x30000000应该是nand flash起始地址,拨到nand flash档重启
//uboot end===========================
//linux文件系统========================
ifconfig //查看当前有线网卡IP,肯定不是192.168.137.11(你设置的JZ2440开发板ip)
ifocnfig eth0 192.168.137.11 //设置IP
ifconfig eth0 down
ifconfig eth0 up //以上两步重启
ping 192.168.137.1 //应该能ping通PC机的,ping不通找方法弄到通为止
vi /etc/inetd.conf
添加 69 dgram udp nowait root /usr/sbin/tftpd tftpd -l
保存退出
chmod 777 inetd.conf
inetd //加载
//tftp -g -r 1.docx 192.168.137.1 //下载文件,文件名1.docx
//tftp -p -l 1.docx 192.168.137.1 //上传文件
//linux文件系统 end====================