Log in

View Full Version : CRio Flash Memory


adlasa
09-01-2014, 10:14
In the WPI tutorial for vision tracking there is a warning about excessive rights to the CRio flash memory in the image tracking program.

It is in regard to writing images to the CRio memory from a camera within a While Loop
Warning: It is strongly recommended to comment out the while loop before enabling the image writes in order to preserve the cRIO flash memory. Writing the images within the while loop may result in excessive wear to the cRIO flash memory.

Is this something to be concerned about? I have a hard time believing FIRST would right their code in a dangerous way by default given that a lot of teams may be inclined to just copy and paste.

Tom Line
09-01-2014, 10:17
All non-volatile flash memory has a limited number of writes before it fails. They are cautioning you that constantly using that feature, say on your robot code, can add hundreds of thousands of writes depending on how often you are writing and overwriting the pictures.

It's a bit of overkill: we're still using our first 8-slot cRIO on a regular basis and have not suffered a memory failure. However, it's sound advice. If you're not going to be using those images there's no need to keep writing them to the disk.

E Dawg
09-01-2014, 10:28
Using it is okay, just be careful. It shouldn't permanently damage your cRIO, but it can definitely eat up flash memory (and slow down your connection).

Joe Ross
09-01-2014, 14:05
It is in regard to writing images to the CRio memory from a camera within a While Loop


Is this something to be concerned about? I have a hard time believing FIRST would right their code in a dangerous way by default given that a lot of teams may be inclined to just copy and paste.

Yes it is something to be concerned about. However, FIRST did not enable the image writing by default. You must uncomment the image write. They give the appropriate warning if you do uncomment the image write.


Using it is okay, just be careful. It shouldn't permanently damage your cRIO, but it can definitely eat up flash memory (and slow down your connection).

This is incorrect. You can permanently damage the flash memory in the cRIO. Like Tom and the Tutorial said, do not write more often then needed.

From the cRIO-FRC II datasheet (http://www.ni.com/pdf/manuals/375770a.pdf)

For information about the life span of the nonvolatile memory and about best practices for using nonvolatile memory, go to ni.com/info
and enter the Info Code SSDBP.

This leads to Understanding and Extending the Life of my Solid-State Drive (http://www.ni.com/white-paper/10126/en/), which states the following

However, solid-state drives have a limited number of write/erase cycles. This disadvantage is the primary focus of this white paper. The physical cells of SSDs wear out over time.

In practice, with the wear leveling that the cRIO performs, I would guess that each team could get at least 1 million 8k writes. Given that an image is likely larger then 8k, if you wrote an image every 20ms, the cRIO flash memory could fail in around 100 hours. But, it's easy to avoid that. Even reducing that rate to once a second makes it so that a team would never run into an issue.

virtuald
09-01-2014, 16:32
Interestingly enough, the 2014 version of WPILib/C++ writes a file to flash memory every time that the cRio boots.

Mark McLeod
09-01-2014, 18:24
Interestingly enough, the 2014 version of WPILib/C++ writes a file to flash memory every time that the cRio boots.
Better not boot the robot more than a million times.:)