I'm not really that interested in WiFi, so I figured I'd see if I could get the new "Arduino WiFi v2" (which uses the ATmega4809, and mEDBG chip, and an ESP32 module, plus some other stuff) to run on my Xplained-Pro 4809 board. (without the features that it doesn't have, of course.)
It went relatively smoothly copying the Uno2018 entry in boards.txt and changing the upload.protocol from xplainedmini_updi to xplainedpro_updi - uploads worked, and if I manually looked up which pins went where, I could get blink to work, at what seemed to be about the right speed...
Serial Communications were more complicated - the Arduino board uses a different uart than the Xplained board. I THOUGHT I had that worked out, but things still weren't working. Worse, they didn't work in weird ways - I got SOME traffic on the serial port, but there was what looked like a baud rate error. WTF - The Mega-0 chips select clocks internally rather than via fuses, and BLINK looked about right - how could the baud rate be 15%+ wrong (I eventually got traffic working by using Serial.begin(8100) to get 9600bps.) And ... 15% off wasn't the integer multiplier I'd expect if the fuses were wrong, right?
So I spent an embarrassingly long time trying to figure this out. :-(
I should have looked more carefully at the clock rate - The 4809 on the Xplained board was running at 20MHz instead of 16MHz.
It turns out that while you can select different oscillators for the CPU at runtime using SFRs, the 16MHz "oscillator" is the same hardware as the 20MHz oscillator, and which frequency it actually runs at is controlled by ... a FUSE value! (I believe that the fuse determines which of several OSCCAL values get loaded into CLKCTRL.OSC20MCALIBA (except that OSC20MCALIBA isn't much mentioned in the datasheet - the field where its set in iom4809.h is "reserved"...)