This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
It's a little difficult to know exactly what the problem is. When you create the conditions artificially, does the flash still get erased? Is it possible to run in this fashion with the debugger and attempt to see where the code is hanging? Can you tell me about the code, where you got it? Can you share it with us? Any additional information would be helpful.
Jim Noxon
Are you doing any dynamic storage of data to the flash? If so, could the loss of flash information be correlated to this operation?
When the motor gets jammed, is this generating a large spike on the power lines of the radio part? Can you isolate the supplies between the motor and the radio. Do you have any scope traces of what the power supply is doing when the motor jams?
I cannot think of any reason for the flash to be corrupted unless the failure is happening during a flash write. I suppose it is possible the chip is entering debug mode when the motor jams but there are plenty of required operations in this mode to cause the flash to be written and the probability of that happening is so remote as to make it practically impossible for it to happen once, let alone multiple times.
Can you think of any other correlation between what is happening in the code and the flash being erased?
Have you read out the flash image to do a comparison with the original code image to see where the differences occur?
Is the motor jamming due to some code failure (like an ISR hanging or not being triggered) or is it from an external event like a mechanical blocking due to debris or something?
The more information you can provide the better I can help you.
Jim Noxon
Were you able to validate the flash image after a hang? Was it corrupted?
Jim Noxon