This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Does running code have an effect on a chip lifespan?

In our project we are using the nrf51822. We planned to connect an external flash for storage purposes. While coding the software I got the advice to give special attention to the external flash, since apparently there is a limit on how many times we can write to a sector before it becomes bad.

Right now I am using an array to buffer the data before I send it.

I am almost too embarrassed to ask this, but we need to know, does executing code on the chip has an effect on its lifespan? The nrf51 has to store the code somewhere, and if it stores and executes the code on its internal flash I imagine it will stop working after the write limit has been reached.

Again, I am sorry if this is a stupid question but this is my first project involving a chip...

  • Hi,

    Storing and executing the code from flash does not affect the lifespan of the chip. What was mentioned in the documentation was the flash endurance.

    Flash endurance is the number of write and erase operation you do with it in its lifespan that are guaranteed and tested to work. After so many erase/Write cycles the flash may get corrupted and might not behave in the intended way.

    For example in nRF51 products we say that the flash endurance is 20,000. This means that you can write and erase the flash sectors 20,000 times without problems and after that we do not know if erase and write operations are successful.

    In your case, executing the code from flash is only a read operation, so you do not need to worry about that. Flash endurance does not apply for read.

  • So the code does not actually run on the flash? Since I am saving data into an array and this would imply writing to the location, where the code gets executed.

    Thank you for the great explanation :)

  • array variables are stored in RAM. Only initialization values are stored in flash. CPU does a normal read on any address (RAM or flash). If you want to write to flash you have to do NVIC_xx operations. So this simply boils down to the fact that your code running though the lifespan is writing/reading a lot to RAM and if you are not writing/erasing flash, then it wont be touched except reading code by CPU. if you flash your code into flash,erase and reflash many times during your development cycle of your project, or you use pstorage/fstorage/NVMC functions in your program then that affects the flash and endurance comes into picture.

Related