UBoot maximum TFTP transfer size?

Technically not an OpenWrt question, but I was trying to revive an old RT5350 board and it did only accept an image less than 4MB in size over uboot tftp.

I am willing to update the uboot to accept 8MB (which is the flash size), but I can’t find where the 4MB is (hard?) coded into uboot.

Anyone who can point me in the right direction?

Work around now: flash in old OpenWrt image and do a sysupgrade after. Not ideal for development when I “F” it up.

I don't think there is an arbitrary such hard limit anywhere. Most likely it is rather a clash in addresses where you are trying to load it into in RAM. What exactly is the output you are getting when it fails?

1 Like
*** init button is pressed

 NetTxPacket = 0x81FE62C0 

 KSEG1ADDR(NetTxPacket) = 0xA1FE62C0 

 NetLoop,call eth_halt ! 
Trying Eth0 (10/100-M)

 Waitting for RX_DMA_BUSY status Start... done

 Header Payload scatter function is Disable !! 

TFTP server is available now.
Got ARP REQUEST, return our IP
start to receive image...
   Verifying Checksum ... OK
Image size is too large!

TFTP: Checksum error

If I use an image less than 4MB it works just fine.

start to receive image...
   Verifying Checksum ... OK

*** Upgrade system code. ***

imgSize = 3932342 bytes (0x003C00B6).
start to erase sectors & write image...

continues flashing then reboots as expected. Boot log shows correct Flash

U-Boot 1.1.3 (Aug 16 2013 - 11:43:02)

Board: Ralink APSoC DRAM:  32 MB
relocate_code Pointer at: 81fc0000
spi_wait_nsec: 42 
spi device id: c2 20 17 c2 20 (2017c220)
find flash: MX25L6405D
ip addr = 0x6401A8C0 
.mac addr = 00:01:02:03:04:05

[    0.656697] spi spi0.0: force spi mode3
[    0.665959] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    0.675896] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.688634] Creating 4 MTD partitions on "spi0.0":
[    0.698248] 0x000000000000-0x000000030000 : "u-boot"
[    0.710066] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.722634] 0x000000040000-0x000000050000 : "factory"
[    0.734630] 0x000000050000-0x000000800000 : "firmware"
[    1.646263] 2 uimage-fw partitions found on MTD device firmware
[    1.658212] 0x000000050000-0x0000001a27fa : "kernel"
[    1.669893] 0x0000001a27fa-0x000000800000 : "rootfs"
[    1.681833] mtd: device 5 (rootfs) set to be root filesystem
[    1.697331] 1 squashfs-split partitions found on MTD device rootfs
[    1.709820] 0x0000003d9000-0x000000800000 : "rootfs_data"