I am trying to program flash on an atmega1281, and the datasheet doesn't say that doing page fill (i.e. only SPMEN set in SPMCSR, boot_page_fill() from avr/boot.h, etc.) must happen from NRWW, but mentions numerous times that page erase and write *must* be done from NRWW (when flashing RWW) - it basically implies that page fill should work no matter which address space you're executing from!
I am (trying to) program pages in RWW using a function located in NRWW that performs the erase and write, that I call from code executing in RWW - since this function is located in NRWW, it should be alright. I am doing page fill directly from RWW address space, though, and the flash stays in the erased state (i.e. 0xFF).
I tried filling the page (with some static data) from inside my "erase and write"-function, and this indeed gets flashed - so is the datasheet just "wrong" about this, or is it something else I'm doing wrong?