File size limit for tftp upload using Ariadne bootloader onto Mega

I am using tftp with the Ariadne bootloader to upload code to my Mega via cat5 cable. This has been working fine for smaller sketches.

Recently I found that when I upload a sketch around 32k, it doesn't work via tftp. I had a working set of code, and just added the lines:

String temp = "hi";

and suddenly the code wouldn't upload.

Before the addition of this code, the sketch was 32,224 bytes, and after adding the code it was 32,262 bytes (which is 32,768 on disk). Note that this crossed the threshold of 2^15 bytes.

According to the boards.txt for the bootloader, I should be able to upload much more than 32k, as long as it knows it's on a Mega. I believe this bootloader would never have worked if it didn't know it was on a Mega. I believe tftp has a limit of 32 MB (not kB!). I am able to successfully upload this code to the Mega directly via USB.

  • Am I diagnosing this problem (file size) correctly?
  • How can I increase this file size limit? Note there is plenty of room on the Mega, it's just tftp that seems to have the issue.

I can give a detailed description of how I burn the bootloader onto the Mega as well, if that's helpful.

I think the cause of the problem and the solution may be described here: https://github.com/codebendercc/Ariadne-Bootloader/issues/2#issuecomment-35497441

Hello Akbon, do you has still the problem with uploading files bigger as 32K?

maybe this will help:

If you not has a gateway in your network, you need to set the gateway address for the bootloader to the ip address of your computer.

i found out that the bootloader try after exactly 32KB upload to reach the gateway.. with wireshark you can see the broadcast comming from your arduino that searching the gateway. and if there is no answer, the bootloader will not stop searching for the gateway.. so your transfer will be aborted because of timeout..

So try setting the correct gateway value for your network using File > Examples > NetEEPROM > WriteNetworkSettings.

That was exactly the problem - fixing my gateway solved it! Not sure how I missed this ...

mcmenon: Not sure how I missed this ...

Well considering it was buried at page 9 of a closed issue that doesn't seem at all relevant from 2.5 years ago it's not surprising at all. It took me quite a while to dig it up even though I knew it was somewhere in one of the issues. Glad to hear it's working now! I'm a big fan of the Ariadne bootloader.