FactoryImage support is standard functionality of the OAD code in the TI SDK.
While I understand the superficial reason for this functionality (robustness in case of a malfunction), I would like to better understand the details of this scenario, i.e. what are the conditions that would make the FactoryImage useful, and what is the risk to get there?
The FactoryImage mechanism kicks in if there is neither a valid application nor a valid (OAD) image to copy over. However, the way the OAD process is working, it is assured that there is always at least one valid image:
- The application image is erased only if the OAD image check was successful
- the OAD image, after copying over, is invalidated only once the app image check was successful
So the only scenario I can imagine is if somehow the copy process doesn't work or the images get corrupted during the OAD process within a very very small window. If the copy process doesn't work for the real image, it probably doesn't work for the FactoryImage either, and the probability that the image get corrupted in the window between validity check and copying is tiny.
Another scenario could be that flash aging leads to corruption. This would mean we have a defective device, so a factory image won't help.
So long story short, is there more to it, are there more random attack vectors of higher probability that I don't see to get into a fatal situation where the FactoryImage would help?
Best
Daniel