I'm writing a set of bootloaders that we'll use for some boards. The MCU's used are ATmega128 and AT90PWM316, and the IDE is Atmel Studio 7.
And I'm struggling with placing the flash at the correct place in the memory.
The BL size on ATmega128 will be 4k, while the BL size on AT90PWM316 will be 2k.
I.e. the ATmega128 BL will be placed starting at flash memory address 0x1F000, and the AT90PWM316 BL will be placed starting at flash memory address 0x3800.
How do I configure the toolchain in the projects in AS7 to achieve this, and also have the AS7 check the BL size when building (to keep HEX/ELF file from overflowing)?
So far I've been using "-Ttext=0x1F000" in Toolchain>AVR/GNU Linker>Miscellaneous>Other Linker Flags. And this works for placing the HEX/ELF file in the flash memory.
And it also works for checking flash memory usage on ATmega128. But when setting "-Ttext=03800" on in the AT90PWM316 project, it *does* set the memory location correctly.
But it's not checking flash memory usage correctly. Currently my build size is a little above 2k, which will cause an overflow in the flash memory (I can see it from the memory locations in the HEX file).
But it's building fine. But if I set it to "-Ttext=0x1F800", it fails saying it overflows a hundred bytes or so (indicating the memory size is 128k and not 16k).
And yes, the device is set correctly under Device.
How do I do this correctly?