Content originally posted in LPCWare by MikeSimmonds on Wed Jul 23 16:08:23 MST 2014
I too have run into this is nusy issue.
So when I check for the erase status, I exclude 'busy' and continue to blank check.
You DO check that the erased sector(s) is(are) blank don't you!
Incomplete sample (for 1778) follows, but you will get the idea.
ldrr0, [r7, 5*4]; get status code
cmpr0, 11; is it lying about being 'busy'?
bne9f; nope
;---------------------------------------;
movsr0, 53; yup -- is it actually blank?
strr0, [r7];
movsr0, r7; 'in' parameters
addsr1, r7, 5*4; 'out' parameters
blGoIAP;
ldrr0, [r7, 5*4]; get status code
;cbnzr0, 9f; OOPS -- IAP failed
;---------------------------------------;
9:pop{r7,pc}; return (zero == success)
Hope this help. Mike