[U-Boot-Users] TFTP failure with variable block size on little endian systems

stefano babic sbabic at denx.de
Mon Aug 20 21:25:37 CEST 2007


Hi all,

I have problems using the last version of the TFTP client. I am not 
using the multicast feature (CONFIG_MCAST_TFTP is not set), but the 
transfer stops after some packets, even the correct filesize is displayed.

I enabled ET_DEBUG and I have seen that the blocksize is greater that 
the MTU:

Load address: 0xa0100000
Loading: send option "timeout 5"
Got OACK: timeout 5
Blocksize ack: 48133, 48133
####
done
Bytes transferred = 1836864 (1c0740 hex)

Really the transfer was not completed and only a part of the requested 
file was downloaded on my board :(
I checked thetraffic with wireshark and the board sends a TFTP Read 
Request with blksize=48133 (and the server does not complain, too !).

The problem is related to the code:

                 /* try for more effic. blk size */
                 pkt += sprintf((char *)pkt,"blksize%c%d%c",
                                 0,htons(TftpBlkSizeOption),0);

We do not need the htons() call because we are simply writing into a 
buffer. I changed the code into:
                                 0,TftpBlkSizeOption,0);

and everything works again. So the problem should happen on all little 
endian systems (in my case, a PXA270).

stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================




More information about the U-Boot mailing list