Attached is the sample project that can easily recreate the issue. I'm trying to write a bootloader for the MKV31F512 but for some reason can not write/erase to anything in the write flash block (my part seems to partition the first and second 256KB). I'm simply using Processor Expert in this case to initialize my CPU configuration as well as create the Flash config and bring in the KSDK driver. If you build and run the code as is it will read prior to erasing, then erase and read, then write 4 bytes and read again. If you step through the code it will work properly. I have a define called FLASH_ADDRESS that is set to 0x40000 at the moment, if you set that to something like 0x10000 it will crash. I have yet to find an explanation for this and I have tried the flash demo on a KV31F tower board and for some reason I am able to write to the lower addresses so there must be something fundamental that I am glossing over. Thanks.
Original Attachment has been moved to: FlashTest.zip