Something that once worked on Mega seems to fail on XMega....
ld r16,x st x,r17
This is part of a tight loop that reads data from SRAM as set by the X pointer and then clears that exact location on the next instruction using data in the R17 register.
Seems simple enough, and works just fine on Mega series.
But on XMega, it fails horribly, setting whatever damn address in SRAM it feels like. In fact it is so random that it causes an instant crash as SRAM, stack, and IO space is randomly overwritten.
Is there some kind of slow turnaround in the XMega SRAM?
It seems as though the x pointer flails wildly in the wind if you try to ST just after a LD instruction.