Flash device will not set P_ERR bit in status register 1, if you are programming data to already programmed locations. Please note, program operation can change a bit from 1 to 0. It is not possible to change a bit from 0 to 1 using a program operation. If you try to change the data a bit from 0 to 1 using program operation, flash will not report error and data at that bit will remain as 0. Only an erase operation can change data at a bit from 0 to 1.
In the question, you have mentioned that the write operation fails. Could you please provide more details about this? How are you checking if the program operation completed successfully or not?
To assist you better with this question, could you please provide more details about your requirement?
Thanks and Regards,
thank you for you quick response!
The only write checking I implemented was the checking of the P_ERR bit.
During tests the programming algorithm unintentionally ran into an unerased
memory area and the read back data was different form the written data (this
is what I meant "writing failed") but the P_ERR stayed zero (did not show the
error) and this was surprising because, in my point of view, this is a
After your answer everything is clear now. I will implement readback and compare
the written and the readback data to check the programming operation.
Thank you again!