I am writing up to 10 OTP pages one after each other.
The problem is that the programming fails after 2 or 3 page writes.
The sequence for one page write looks like this:
- read page (2xbfrom_OtpRead()) and compare with data to be written (to see if it is already written)
- Enable VPPOTP
- wait 50ms
- write page bfrom_OtpWrite lower and upper
- wait 10ms
- read page (2xbfrom_OtpRead()) and compare with data just written (to see if it is already written)
The many calls to bfrom_OtpCommand() with OTP_INIT and OTP_CLOSE is because how I arranged the atomic functions for each read / write task.
I have tried to enable VPPOTP only once before starting to write but the problem persists.
The process works but we currently need to run the program 4-5 times to get all 5 keys written and verified.
I can't find any information regarding these type of limitations in the documentation so some guidelines how to do this would be greatly appreciated.