Prerequisite: The source code has been compiled. Under Windows, download tftpd32 and create a folder for sharing
View tftp related programs
##Linux system:
1] Check if tftp server is installed
sudo dpkg –s tftpd-hpa
2] Install
sudo apt-get install tftp-hpa tftpd-hpa
3] Modify the file tftpd-hpa
sudo vi /etc/default/tftpd-hpa
###enter
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l –c -s"
RUN_DAEMON=”yes”
OPTIONS=”-l-s /tftpboot”
###vim command
:q 不保存退出,:wq 保存退出,:q! 强制退出, :wq! 强制保存退出(必须有root权限)
4] Check whether NFS is installed
sudo dpkg –s install nfs-kernel-server
sudo apt-get install nfs-kernel-server //安装
5] Modify configuration file permissions
sudo vi /etc/exports
####Add in the last line:
#/tftpboot/rootfs *(rw,sync,no_root_squash,no_subtree_check)
格式说明:
共享目录:主机名称
主机名称或共享IP:允许按照指定权限访问这个目录的远程主机(如:开发板)
参数:
ro:只读权限
rw:读写权限
no_root_squash:如果是客户端root,那么他对这个目录具有root权限
root_squash:如果是客户端root,那么他的权限被限制为匿名使用者
all_squash:如果是客户端是什么身份,那么他的权限被限制为匿名使用者
6] Manually start and stop NFS service
sudo/etc/init.d/nfs-kernel-server start ##启动
sudo/etc/init.d/nfs-kernel-server stop ##停止
sudo/etc/init.d/nfs-kernel-server restart ##重启
sudo /etc/init.d/nfs-kermel-server status ##查看当前NFS服务状态
===========================================================================
burning
###The files to be transferred are placed in the Current Directory.
##If you want to burn the development board, you must first transfer the file from the host to the development board (take the development board DR40X9 as an example)
***** Enter Uboot mode:
7] Make sure that the development board and the host can be pinged :
printenv #查看ipaddr,serverip
##If the ping fails, the solution is as follows:
【控制面板】【系统与安全】【windows防火墙】【高级设置】【入站规则】【文件和打印机共享(回显请求 – ICMPv4-In)】-----【ICMPv6-In】【全部启用规则】
8] Transfer the bin file to be burned to the development board, and the file to be transferred must be placed in the created shared folder directory:
# tftpboot PCip -g -r filename //从共享文件夹传输到开发板
# tftp PCip -p -r filename //(从开发板传输到主机)
9] Use the tftpboot command to burn (the files and parameters of each development board are different, please find the manual by yourself)
tftpboot 参数 文件名
tftpboot 0x84000000 openwrt-ipq40xx-generic-wallys_dr40x9-squashfs-nand-factory.ubi
##After burning successfully, it will display
eth0 PHY0 Down Speed : 10 Half duplex
eth0 PHY1 Down Speed : 10 Half duplex
eth0 PHY2 Down Speed : 10 Half duplex
eth0 PHY3 Down Speed : 10 Half duplex
eth0 PHY4 up Speed : 1000 Half duplex
using eth0 device
TFTP from server 192.168.1.10; our IP address is 192.168.1.11
Filename 'openwrt-ipq40xx-generic-wallys_dr40x9-squashfs-nand-factory.ubi'.
Load address: 0x84000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#########################################################
done
Bytes transferred = 7995392 (7a0000 hex)
==================================================== ================================
##### If done, it is ok, and if no error is reported in the whole process, it is correct
Burn nornand-ipq40xx-single-2168-202208030527.img
transfer file:
tftpboot nornand-ipq40xx-single-2168-202208030527.img
Start burning:
imgaddr=0x84000000 && source $imgaddr:script
reset
10] Read and write operations on the development board
nand device 0
nand erase 0x0 0x8000000
nand write 0x84000000 0x0 0x4000000
reset
11] The steps are completed, and the operation of luci can be performed.