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?

Parents
  • 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.

  • Thanks. We will explore if eDRX or PSM is possible for our application and what the power consumption is compared to having the modem powered off between use.

    I look forward to hearing the details on how to calculate flash wear lifetime taking into consideration flash use / number of credentials stored in flash.

Reply Children
  • Hello again, and sorry for the long wait.

    I still haven't gotten a better way to calculate a more average expected lifetime of the modem flash. We are working on it, but it will probably take some time, as there are a lot of different factors that can affect it.

    In the meantime, I would like to re-iterate some of my earlier points and questions:

    While the expected lifetime will be better than what we have calculated so far in this ticket, it will still not be great as long as you keep using AT+CFUN=0 every 5 minutes.

    However, you shouldn't have to use it that often anyway. First of all, if the point of turning off the modem is power saving, the strategy is flawed. Turning the modem back on can consume a lot of power, so unless you are sending very rarely (an interval of several days), PSM and/or eDRX will consume less power. The only other reason for turning the modem off for power saving purposes is if the device is roaming on networks where it might not be granted PSM. However, in this case, you can use AT+CFUN=4 most of the time.

    From a power consumption perspective, AT+CFUN=4 and 0 are equivalent (except that AT+CFUN=0 might trigger a flash write, and thus consume more power). The benefit of using AT+CFUN=0 is that network parameters will be stored in flash, which will speed up the network connection when the modem is turned back on. However, this point is only valid if power is disconnected or the modem is fully de-initialized. Otherwise, the network parameters will still be in the modem RAM when you re-enable the modem. In addition, unless the device has moved to a completely different location (one with different networks, i.e. in many cases a different country), even very old network parameters will help speed up the connection. So unless you expect the device to be in a different country every 5 minutes, I don't see any point in using AT+CFUN=0 that often.

    Reducing the number of AT+CFUN=0 you issue is also the most effective way of increasing the lifetime of the modem flash. E.g. if you use AT+CFUN=0 only once a day, you will, in the absolute worst case that we have been using so far, get an expected lifetime of at least 27 years.

    Best regards,

    Didrik

  • Hello again, and sorry for the long wait.

    I just wanted to inform you that we are mostly finished prducing some numbers for more normal scenarios. We are just doing some final verification, and should have them ready for you early next year.

    Have a merry Christmas and a happy new year.

  • As an aside, the specification on the nRF9160 differs from the nRF52 series, although one might expect the same MMC and Flash memory was being used.

    "flash is divided into multiple pages. The same address in flash can only be written nWRITE number of times before a page erase must be performed."

    For the nRF9160 nWRITE is defined as 2 writes for a single memory address, but on the nRF52 nWRITE is defined as 81 writes for a single flash block before a page erase must be performed. Given that there is usually a limited number of writes to a flash block before a page erase is required in most flash memory implementations, what is that number for the nRF9160?

Related