I have a series of projects using the Xmega 128A1 which has 128kB of application Flash memory. I'm programming with AVRStudio 4.19 and WinAVR GCC.
Only recently have I had problems with code memory, and after a lot of searching I realised I'd crossed the 50% code space utilization, and some of my code was rolling over from 0xFFFF to 0x1xxxx. When I cleaned out a lot of debug code and got the code size well below 0xFFFF, everything was fine. But the time will come when I need to add sufficient features that I cross that boundary again.
I've checked and I have the correct MCU set in project configurations, (since I've has avr\xxx.h issues in the past) checked that io.h calls up iox128a1.h and that iox128a1.h specifies the correct macro values for application code space.
I was under some confusion that the Xmega PC is a modulo-2 counter, and addresses 16-bit words in the *byte* address range 0x0000, 0x0002, 0x0004,..., 0x1FFFE. But now I'm beginning to doubt my understanding of that.
Anyone seen this problem before, or able to offer any help?