ATXMEGA32A4 Flash: 32KB + 4KB for Boot
I have the bootloader working, it uses around 3KB. My main application is very large and doesn't fit with the bootloader, so I'm trying to fill the remaining space in the bootloader with some constant tables.
The problem is that when the bootloader gets above 4036 bytes, I get an error when I try to program:
The contents of the objectfile exceeds the maximum program memory of the device
Why? I assume there might be gaps when the linker generates the HEX file. How do I get closer to 4096 bytes?
This is how the HEX file looks like when exceeding 4036 bytes, the first part seems to be in sequence, but at the end, there is something else:
:108000000C94CA420C94E0420C94E0420C94E0427E :108010000C94E0420C94E0420C94E0420C94E04258 :108020000C94E0420C94E0420C94E0420C94E04248 . . . :108FA00008958091CF0187FDFCCF80E3E0ECF1E0F4 :108FB0008287EBECF1E021E030E088ED90E084BFC7 :088FC00020830895F894FFCF0F :108FC800EE27FF2719BEDC0143E24093CA0150E8AF :108FD8002DE90D901D9020933400E89532965A950E :108FE800C1F711240895FC014093CA012DE920938B :0A8FF8003400E89511243BBF0895F2 :040000030000800079 :00000001FF
And a second question, once I get the bootloader done, is there a way I can generate an error if the main application exceeds 32KB?
The bootloader code is here if anyone wants to take a look.