We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
We are using a LPC2138 I have just received a batch of boards that fail functional test. When I reprogram the binary, they work perfectly. So I have read back the contents of a failing board and compared it to a binary read back after I reprogram the board. They are identical.
The LPC2138 errata sheet does list an error for the MAM which "Under certain conditions when the MAM is fully enabled (Mode 2) code execution from internal Flash can fail."
However, this does not explain why it works when I reprogram the boards. Also the boards do not crash.
Is there anything else I can test before I re-program them all?
You can't control the programming voltage. It is generated internally. But it is important that the processor has a reasonable temperature, and a stable (and correct) external supply voltage and that the clock frequency is correct (and matches what is assumed) during the programming.
If the external voltage varies, the internal voltage pump may not be able to produce a stable programming voltage.
If the temperature is too high, the programming algorithm may fail.
If the clock frequency is wrong, then the programming algorithm may erase the flash sector for too short time or may write the data with wrong timing.
In that case I wouldn't read back the program correctly though? Is it possible that the program looks correct but hasn't been programmed correctly?
Yes. With marginal contents, it can read back correct 9999 times of 10000. If it affects your main loop, every iteration may then have 1/10000 to fail. And if the processor gets hot when running, that failure rate may suddenly become 1/100 for every iteration.