LowPowerLab / DualOptiboot

Custom Optiboot to add wireless programming capability to Moteino
GNU General Public License v3.0
70 stars 49 forks source link

Image size is 2 bytes but should be 4 bytes #6

Closed JacobAtMyTrellis closed 2 years ago

JacobAtMyTrellis commented 2 years ago

The README refers to the image size as a 4-byte value. However, it is implemented in Optiboot.c as a 2-byte value. This means that images can be no larger than 64KiB, which is smaller than the 128KiB program memory of a MoteinoMEGA. In order to support larger programs, at least one more image size byte should be added.

LowPowerLab commented 2 years ago

This was intentional. Do you have a program size larger than 64KiB?

JacobAtMyTrellis commented 2 years ago

Yes. My program size recently grew just above 64KiB and may grow further in the future. What was the reason for limiting the program size to 2 bytes?

LowPowerLab commented 2 years ago

The reason was that I could hardly envision a program size getting so big especially on low power remote RF nodes. And my primary type of node that would be OTA updated would be the 32kb atmega328p.

JacobAtMyTrellis commented 2 years ago

Yeah, my company's code base is getting pretty large. We might be able to trim it down once we take all of the legacy hardware out of production, but for now it's slowly growing.

So there's no technical limitation preventing larger program sizes? I haven't worked with bootloaders before, but I am considering forking the repo and trying to increase the size limit.

LowPowerLab commented 2 years ago

No technical limitation, but why carry an extra byte when it would virtually never be used... You're welcome to fork, modify, PR back if you'd like ... etc. If a client ever wanted it modified then I'd do it but otherwise this has no priority for me.

JacobAtMyTrellis commented 2 years ago

Okay. Thanks for clarifying everything, and nice job on the repo!