Optiboot / optiboot

Small and Fast Bootloader for Arduino and other Atmel AVR chips
Other
1.08k stars 396 forks source link

Calculate memory sections automatically for all targets by Makefile.inc #330

Closed Virtual-Java closed 2 years ago

Virtual-Java commented 2 years ago

To simplify changes to the location of section I created the file Makefile.inc which contains the formulas to calculate memory sections automatically for all targets. Besides I fixed some bugs and copy paste errors that stand out. Finally I compared the output during compilation send to terminal and the hexfiles created for each family on random basis to ensure there are no significant differences.

WestfW commented 2 years ago

This is pretty ugly. Let me see if I can figure out something "prettier", even if it involves (say) a custom linker script.

WestfW commented 2 years ago

I did similar "automatic" segment start addresses in an entirely different way, using a linker script and some weird code to derive the info from the data present via avr/io.h (FLASHEND and etc.) This meant that all chip-dependent makefile references to magic addresses, lengths, and etc could be removed, instead of adding additional (although more user-friendly) info as in this PR.

See https://github.com/Optiboot/optiboot/commit/be65a28adb854abb60c215f8d0315ab62c89eff2#diff-d00465a0b6fb5a959e455fec9bbf7ab1553c0720e2a736d94b4a1d5a7156082b