Hi Derek,
I have a similar Flash write error on K60 using MQX4.0. Do not know if it has issues with MQX3.8.
In my case I did not enable sector cache (ioctl with FLASH_IOCTL_DISABLE_SECTOR_CACHE) and always erased all sectors then called write(). I have tried to write totally 4k Bytes - 8 bytes per write(), I saw arbitrary chunks of 0xFFFFFFFF- 16 bytes, or 32 bytes, etc - the write() returned correct return code but without really writing to Flash. If I read back after write I see some location were written correctly, some were 0xff - but if I wait some time - say 1 second - then read back, the same location would be written correctly (previously were failed with 0xff). But there still are arbitrary chunks of 0xFFFFFFFF left unwritten.
Other tests I did is to write 512bytes each time (totally ~300kB) to upper half of the Flash and had similar issue - (160Bytes, or maybe 280Bytes of 0xffs without written correct data)
I have tried to call _ICACHE_DISABLE() and it seemed worked for me. No failure so far.
David