Ok... so, I've ditched the Arduino IDE and moved back to Atmel Studio 6.
The IDE causes all sorts of issues/conflicts that I can never figure out.
I can now call the IAP function using the exact same code I was trying to use in the Arduino IDE.
I am successfully programming the flash.
I now have two unanswered questions.
- Why can I not call the IAP function using the Arduino IDE?
- Why am I getting only one plane of 256kB when I retrieve the flash descriptor?
(Should I not be getting 2x256kB?)
I was intending on setting the boot flag for flash0/flash1 to jump to/from a bootloader.