openwrt路由器固件烧录mt7621用tftp方式实现烧录固件的两种方式

tftp软件:
链接:https://pan.baidu.com/s/1VYRUgzCkh5PEaBK0ZDJyKQ
提取码:f8ba

两种方式中tftpd32都必须处于运行模式

存疑?:目前看只有设置本地ip为192.168.10.10才能下载成功,自动分配的ip地址192.168.10.221不行,暂时不知道是操作有问题还是本来只能192.168.10.10才能行?

一、路由器工作在桥接模式

1、开发板进入到uboot模式,用网线将开发板和电脑连接起来(桥接模式lan口wan口不分),在电脑上配置tftp服务器,即打开tftpd32应用程序。
2、配置本地tftp服务器
openwrt路由器固件烧录mt7621用tftp方式实现烧录固件的两种方式_第1张图片
这里的地址192.168.10.10是从开发板的输出log中找到的(是服务器地址),开发板地址默认是192.168.10.1,如下:

Hit any key to stop autoboot:  0 
=>  
=> tftpboot lede-ramips-mt7621-mt7621-rfb-ax-nand-squashfs-sysupgrade.bin;nand erase 0x180000 0x3f40000;nand write 0x80010000 0x180000 $(filesize)
Using eth@1e100000 device
TFTP from server 192.168.10.10; our IP address is 192.168.10.1
Filename 'lede-ramips-mt7621-mt7621-rfb-ax-nand-squashfs-sysupgrade.bin'.

3、把需要烧录的文件放到服务器路径中,即要烧录的bin文件需要放到Current Directory路径中,然后执行下面操作
openwrt路由器固件烧录mt7621用tftp方式实现烧录固件的两种方式_第2张图片
图片中的1应该选择192.168.10.10,然后点击2会显示3,3中的bin文件就是要烧录的文件

4、在uboot命令行 中执行:

tftpboot lede-ramips-mt7621-mt7621-rfb-ax-nand-squashfs-sysupgrade.bin;nand erase 0x180000 0x3f40000;nand write 0x80010000 0x180000 $(filesize)

二、路由器工作在路由模式

当路由器工作在桥接模式mt7621默认ip地址跟tftp服务器不在一个网段,需要用上门方式;当工作在路由模式时,tftp服务器所在pc跟路由器工作在同一网段,可以用下面方式:

1、pc连到路由器的lan口(wan口接的外网),把bin文件放到指定目录,根据pc地址配置服务器地址openwrt路由器固件烧录mt7621用tftp方式实现烧录固件的两种方式_第3张图片
2、通过scp或tftp将固件传入至openwrt中的某个目录下,如/tmp。

root@LEDE:/tmp# tftp -g 192.168.10.221 -r lede-ramips-mt7621-mt7621-rfb-ax-nand-
squashfs-sysupgrade.bin
root@LEDE:/tmp# ls
TZ
board.json
dhcp.leases
dnsmasq.d
etc
extroot
hosts
l1profile.sh
lede-ramips-mt7621-mt7621-rfb-ax-nand-squashfs-sysupgrade.bin

3、命令终端进入到该路径后,用以下两种指令均可将固件成功烧入

root@LEDE:/tmp# sysupgrade -n lede-ramips-mt7621-mt7621-rfb-ax-nand-squashfs-sysupgrade.bin

4、怎样通过tftp从开发板中下载固件到本地电脑?

tftp从linux下载文件:root@CMCC:/usr/lib# tftp -p 192.168.10.10 -l libpcap.so

你可能感兴趣的:(网卡操作,单片机,服务器,stm32)