Target MCU: XMega32A4 WinAVR: WinAVR-20100110 Studio: v4.18 Build 716
I recently completed initial debug of a bootloader for the above target device. The bootloader is fairly large and, to keep from overflowing the 4K bootloader flash area, I used the "-nostartfiles" linker flag to eliminate the vector table since interrupts are not being used. While debugging using the Studio debugger, I compiled using the -O0 option to remove optimizations. The compiler produced normal startup code which, at the end, "fell" into main(). Once debugging was complete, I recompiled with -Os. Not surprisingly, the order of the code was restructured with the main() entry point appearing further down in the code, preceeded by several functions. What was missing was a call to the main() entry point at the end of the startup code. When I removed the -nostartfiles linker option (still using -Os optimization) I found that the call to main() was included. Unfortunately, inclusion of the vector table - which uses 376 bytes, just about offsets any savings gained from the -Os optimization. This puts me very close to the 4K limit again. I'd really like to have this extra space as the next step (interaction between the application and bootloader) will use a debug mechanism which uses values written to an I/O port that are monitored by a logic analyzer to trace the path of execution, as well as variable values. While these individual debug statements don't take much room individually, I will be limited in the number I can put in the code at any given time.
Also, as a check, I downloaded the latest Studio 5.0 and recompiled using it (GCC v4.5.1). Same thing.
Anyone have any ideas on a workaround that might get me past this problem? Thanks, Dave _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list