
In message c3d0340b04101409512a20b628@mail.gmail.com you wrote:
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) ;
This worked fine for large amounts of data so the timeout value is probably too low. Let me know if this is the same with your setting.
Good try. I'm not sure if this is a decent fix. It's possible that
It is not a proper fix, as it might hang the board without even an error message.
Flash write gets stuck in while loop if there is a real problem. It may be other factor(s) that cause this problem. For example, timer is not accurate?
This is one possible explanation. Check timer implementation. I noticed that quite a lot of boards use insane values of CFG_HZ. Remember that this should be the number of clock ticks (= timer interrupts) per second, and there is usually no reason to chose anything else but the default value of 1000. Many boards use some much, much higher clock values instead. This should be fixed. [We recently fixed this for AT91RM9200 systems.]
Best regards,
Wolfgang Denk