Hello,
Subsequent to my previous post, I found that a few devices do not specify the requirement for an error flag check immediately after starting the flash command. After reviewing the Reference manual for quite a few different devices, I found the following exceptions.
AC128, AC60 (but not AC16):
Error check not required for byte programming and sector erase, but still required for burst programming.
DN/DV/DZ series, EL32/SL16:
Error check not required for sector erase, but required for byte or burst programming.
MM128, QE128 only, JE128, and SC4:
No error check required.
All other devices examined specifically required the error check for sector erase, byte program and burst program operations.
I cannot see that there would be any disadvantage in checking the error flags, either prior to or within the wait loop, even if not specifically required. This would make the code more derivative independent.
Interestingly, many of the devices not specifically requiring the error flag test, also have paged flash memory and a MMU module. These must necessarily be coded differently anyway, to make use of the LAP registers, in order to be able to program any flash byte.
Regards,
Mac