Wiznet makers

gavinchang

Published November 28, 2025 ©

57 UCC

25 WCC

60 VAR

0 Contests

4 Followers

0 Following

Original Link

2.11 rt-thread practical demonstration: Downloading files from a tftp server using tftp.

2.11 rt-thread practical demonstration: Downloading files from a tftp server using tftp.

COMPONENTS
PROJECT DESCRIPTION

1) Using rt-thread version 5.1.0, a W5500 network module, the WIZNET software package, a w25q128 SPI flash, a littlefs file system, and the tftp software package.
2) After successfully mounting the file system, the code operates without problems reading and writing files, and I can ping my local computer via Ethernet.
The ifconfig command shows the correct IP address and other information, and the device is on the same network segment as my local computer. My computer's IP address is 192.168.0.55.

3) I'm using tftpd64 as the server on my computer. The device is using `tftp -r 192.168.0.55 WAC300LH.bin` to retrieve a file from my computer's tftpd64 server. When I try to get the file, the following error message appears. The error code is mismatched block sequence numbers, and I've been trying to fix it for a long time without success. After the error, the received file size is 0, indicating the file has been automatically created on the device's file system. Furthermore, when I run `tftp -r`, the tftpd64 server indicates the transfer has started, but it times out after a short while.

Bad block recv:1 != check:27746
read data err[-6]! exit
file size:0

 

 Later, I saw this sentence in the Gitee source code and learned that the latest TFTP code has a bug.

 Modify the tftp_xfer.c file to the following code, and the test should be successful.

image

 

Documents
Comments Write