When addressing an (external) flash by a RTOS task, is it generally safe to allow that task to be preempted while it is updating the flash? What about interrupts during writing to flash?
thanks. I guess I'll have to try and see, because the data sheet does not say a thing about it.
You must safeguard the portion of the code when it is performing a write to the flash. Else, the preempting will corrupt the data on the flash. I have experienced this first-hand when I wrote a embedded Linux NAND flash driver. Basically, the NAND flash eventually will hit a critical period when other devices generates interrupts, preempting in the middle of the flash write. This causes the flash's internal logic to provide some error correction. As a result, a few bits are modified and hence, your data is corrupted. You should mask out interrupts during this flash write period.
Cheers and good luck, Tom