How to calculate nRF9160 NVM / flash wear lifetime?

In the nRF9160 command reference guide it states: "CAUTION: CFUN=0 causes writing to NVM. When using CFUN=0, take NVM
wear into account."

And I've found this post:

 NRF9160 Flash Endurance 

A few questions:

1. Is there anyway to know how many write cycles have been used?

2. If no user parameters were changed with AT commands can we assume AT+CFUN=0 won't use a write cycle?

3. Upon modem registration, is carrier or network information stored in NVM?  At my office, upon very first power up, registration seems to take around 30 seconds. After subsequent power cycles, registration seems to happen pretty quickly. Typically around 4 seconds. Will this impact NVM lifetime?

  • Hi, and sorry for the late reply.

    1. Is there anyway to know how many write cycles have been used?

    No. Unfortunately, there isn't a way to know how many write cycles has happened.

    2. If no user parameters were changed with AT commands can we assume AT+CFUN=0 won't use a write cycle?

    No. The modem will also store network parameters, GNSS parameters, etc. So it might store new data even though no user parameters has been changed.

    On the other hand, depending on how much flash is used (for different parameters, certificates, etc.), the modem might not need to delete a flash page to store the new data, and therefore it might not use a write cycle.

    3. Upon modem registration, is carrier or network information stored in NVM?  At my office, upon very first power up, registration seems to take around 30 seconds. After subsequent power cycles, registration seems to happen pretty quickly. Typically around 4 seconds. Will this impact NVM lifetime?

    Data is stored in flash periodically, though the period is quite long, at approximately 48 hours. Other than that, if you just connect, and then do a power cycle, I don't think any data will be stored.

    But if you do an AT+CFUN=0, it will store the network parameters, and use them when the device reboots, which will significantly speed up the connection.


    How are you planning to use the modem?

    How often are you planning to send data, and do you plan to cut power to the device, or turn off the modem when not sending?

    Usually, it is better to keep the modem on, and in PSM, than to turn it off, as doing a full re-initialization of the modem and SIM card can consume a lot of power.

    However, if you expect the device to loose power, it is best to turn off the modem with AT+CFUN=0, as that will help speed up the LTE connection setup when power is restored.

    If you don't expect the device to loose power but still want to turn off the modem, and want to ensure maximum longevity, using AT+CFUN=4 will be better, as that will minimize the flash wear.

    But again, the modem will only update the flash if there is a change (to either user parameters or network parameters), and if there are free flash pages, those will be used before it deletes an old one, so one erase cycle per AT+CFUN=0 is the worst case scenario, and not the default.

    Best regards,

    Didrik

  • In the case where PSM is not used, GNSS is not used, and AT+CFUN=0 is used on each shutdown... because it's important to store the network parameters to significantly speed up the next connection. How to calculate flash lifetime? e.g. in the following scenarios: Powering up, sending data, powering down. Periods of 5 min, 15 min, 1 hour and 1 day.

  • If the device does not loose power, you shouldn't see any difference between AT+CFUN=4 and 0.

    And also, if the device does not move, old data should also be enough to speed up the connection.

    C.T. said:
    How to calculate flash lifetime? e.g. in the following scenarios: Powering up, sending data, powering down. Periods of 5 min, 15 min, 1 hour and 1 day.

    As I said, for a worst case calculation, you can assume one write cycle per AT+CFUN=0.

  • Assuming worst case of one write cycle per AT+CFUN=0, what is the lifetime of the Nordic9160? Does the AT+CFUN always erase the same sector in flash? Assuming this, with an AT+CFUN=0 and power down every 5 minutes, are you saying that the worst case lifetime of the chip is: 10000 * 5 minutes / 1440 minutes per day = 35 days?

  • C.T. said:
    Assuming worst case of one write cycle per AT+CFUN=0, what is the lifetime of the Nordic9160? Does the AT+CFUN always erase the same sector in flash? Assuming this, with an AT+CFUN=0 and power down every 5 minutes, are you saying that the worst case lifetime of the chip is: 10000 * 5 minutes / 1440 minutes per day = 35 days?

    As an absolute worst case, I believe that is correct, yes. Though I will double check the details here with the modem team to be sure.

    However, note that this is the absolute worst case, where you have filled the modem full of credentials, so that there is only one flash page left.

    In actual use, the modem file system will have more flash pages available, and can therefore spread out the erases, thus prolonging the expected life. Again, I have asked the modem team for more details, and if they have a more accurate way of calculating the expected lifetime.

    I would also like to repeat my comments from my first answer. Always turning off the modem is quite power hungry, compared to keeping it on in eDRX or PSM. If the intervals are short enough, it might even be better to just always keep it on without any power saving measures, as the radio should still be idle most of the time, and initializing the SIM card and connecting to the network can consume a significant amount of power.

    You will also probably not see much performance loss if you just turn the modem off with AT+CFUN=4 most of the time, instead of AT+CFUN=0. As AT+CFUN=4 does not trigger a write to flash, you will save a bit of power (otherwise consumed when writing to the flash), as well as increasing the lifetime of the device. Unless the device looses power, the network information should still be available to the modem when you re-activate the modem, and even if the device loose power, the old data stored in flash will probably still be of some help.

Related