i would like to ask few questions about flash memory in routers.
how many times flash memory in router can be reprogrammed?
if one cell will be broken because of too many writes to it does it mean that router has to be replaced or system will take that cell out of use and just show less capacity of internal memory?
Is there any way of checking the health of percentage used of memory in router like you can in SSD's via SMART?
Suppose that is not about NOR-SPI but NAND (eMMC partition) for the OS? Mostly it depends on:
eMMC version and its density specifications (info from manufacturer), e.g. eMMC4.5 with density of 4GB makes ~ 2.4TB total bytes written before EOL
filesystem deployed on the eMMC, BTRFS is likely not the most suitable and quite a number of Android device vendors deploy F2FS
utilisation of the eMMC, e.g. with write intensive apps it will wear faster of course
The NAND chip logic handles bad blocks (reservation) until there is no sufficient amount of healthy cells left for running the OS. The process is however not linear, more of an avalanche effect. Nothing is happening for a long time and then all blocks starts failing at once.
Limited with mmc extcsd read /dev/mmcblk0 | grep 'EXT_CSD_PRE_EOL_INFO\|EXT_CSD_DEVICE_LIFE_TIME_EST'
Value is in range of percents so 0x01 is from 0%-10% blocks used, 0x02 is from 10%-20% and so on. When amount of reserved block used is close to 100% then NAND is pretty much EOL, mind however the avalanche effect.
16 MB would almost certainly be a NOR chip. NOR flash has much longer lifetime of about 100,000 erase / writes per block. Wearout is not a concern in normal operation even if that included upgrading daily.