Closed Virtual-Java closed 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.
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.
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.