I am checking PCB board of a commercial device that has W25Q256JV 32MByte SPI Flash on it. The device is in use for more than a year now at more than 2000 client locations. It has internal backup battery that is put on charging at night and then at day time the device is used without the mains charger.
The Flash is being written and read continuously all the time for more than 1 year now. It's write cycles are surely reaching to its limits now.
Now faulty devices have started to come for repair from the client and mostly flash is the culprit in these devices. Once it is replaced with a new chip then the device again becomes functional.
It is observed that the event of faulty flash occurs at the instant when the connector of its power adapter is removed from the device.
How can the flash getting corrupt avoided at the instant when its power jack is removed?
How can we detect in the firmware that the flash has become corrupt and consequently display this message on device screen.. so that no guess work is done to re-live the device?