Recently, Atmel has (finally!) released a bootloader application note for the xmega (ATxmega128A1).
However, the application note only includes a workspace for the IAR compiler.
I have attached below a port of this bootloader to using GCC. The changes to the original are as follows:
* Changed headers where needed to
* Linked in the sp routines (for gcc) from Application note AVR1316
* Changed (using the gui) to link .text to 0x10000 words
It works with the supplied demo hex files in the application notes, but I am yet to push it very hard.
Code below is available under the same 3-clause BSD licence that ATMEL use in their application note code.
Comments are welcome.
WARNING! The boot flash is not functional in Revision G and below of the ATxmega128A1. Double check you have Rev H or later before proceeding - see in this thread how to check.
(Edit: Added warning about xmega silicon revision required).