We are using the AT32UC3A, and I think I've discovered a bug in the GPIO/Peripheral multiplexing. Don't know if it applies to all pins, but it does seem to affect pin PA17 (SPI1-MISO).
The problem is that if I program this pin as a GPIO output (output driver is enabled) and then program it to be function B (SPI_1) but I don't hit the ODERC register to explicitly turn off the GPIO output driver, the output driver remains on, and the pin has whatever state is set in the output value register (OVR). This obviously causes the SPI to malfunction - it reads a constant value. We added code to explicitly disable the output driver (set the bit in ODERC)and that fixed the problem.
According to the datasheet (both the text at 22.4.4 and the diagram in Figure 22-1), setting the pin as peripheral function should give the peripheral control of the output driver enable and the output value. In other words, what is set in the ODER and OVR registers should be irrelevant. That appears to be incorrect "“ at least on this one pin (PA17).
Can anybody corroborate this behavior? Is this a bug, or is this by design?