I'm working on a firmware for AVR128DA. This MCU has 3 flash memory sections: BOOT, APPCODE and APPDATA. I understand that these sections have user-defined size through fuses.
I don't really understand though, how do I control where the program or my progmem data is placed (inside a C/C++ project). Also, how does the compiler know where to place (or upload) the machine code if the size is variable (defined in fuse)?
To explain my end goal, I want to add a bootloader to support re-programming either the APPCODE section, where the main program is stored, or just the APPDATA section (leaving APPCODE intact), which contains (does it by default? Again, how does AVR-GCC treat this?) my PROGMEM variables (strings, bitmaps, and other misc data). Assuming that all the PROGMEM data should be already inside .data section, does it just place the .data section inside the APPDATA memory section automatically? If so, again, how does it know where it starts? Same question stands for the BOOT/APPCODE boundary. How does the compiler know where BOOT ends and APPCODE starts and how do I control what gets placed inside which section?