# Development of a Datalogger for Submarine Glider: Integration of Fault-Tolerant Software Layers
## 4 Discussion  
Submarine gliders have several systems such as buoyancy engine, internal and oceanographic variables system, and others. The integration of the system sensors generates a large volume of data. Our design points carrying out the different glider operation stages with a dedicated storage system are necessary. Moreover, our datalogger facilitates the storage operation avoiding data lost. For the design of the storage system software, it is necessary to take into account the different failure modes in order for the system to be robust. Faced with different failure modes, the developed datalogger has the following characteristics that gave satisfactory storage support:  
* The BCH module that correct 4 errors for every 255 bits functions without data lost due to it functioning in parallel to the data collection and because the ECC avoids the error in the CHIP with a \(CEP_{out}\) of 3%. * A layer to detect bad blocks that avoids the writing or erasing in blocks that could not be useful. * A protocol that updates an addressing writing pointer every writing operation. In a power loss event, writing starts at the last address. Even with these characteristics, it is possible to identify, not necessarily disadvantages, but some limitations for the datalogger that are described below. Due to the vertical arrangement of the messages, the size of 2112 bytes of a page (2048 of data area and 64 of spare area), and because the length of an ECC code is 255 bit, the number of codes that could enter a page is \(\eta=2112/255=8\). Therefore, the number of bytes of data on a page is \(\eta*223=1784\). The fraction of the page that can be used for data is 1784/2048, that is to say, 87%. The fact that ECC codes and page size are power of 2 numbers does not necessarily mean that the efficiency of use of the entire page is 100%. However, the 87% represents a high usage percentage of a page memory chip and the ECC avoids the errors in data storage. Figure 16: Glider emerging from the depths of the sea in the Bay of Todos Santos in Ensenada, Baja California, Mexico. The maximum storage period is also limited by the sample rate, sample length, and the memory capacity used. For a sample rate \(f\) in samples/minute, a sample length \(L\) in bytes and a memory chip storage capacity \(C\) in \(MB\), the period in days that can be store is  
\[P=\frac{1784\times 1024^{2}\times C}{2048\times 60\times 24\times L\times f}= \frac{28544\times C}{45\times L\times f} \tag{16}\]  
Figure 17 shows the maximum period time in days of the limit for different storage capacities of the chosen chip. For our case using 1 GB NAND flash, a sample rate of 30 samples per minute and 256 bytes per sample, the time limit is 84 days. The graph in Figure 17 shows us that if we use an storage capacity of 512 GB, you could use the datalogger for more than 40,000 days. It points that you can increase the sampling velocity or even the sampling size. Other results indicate that one bit per \(4.1\times 10^{10}\) bits will be wrong. This number represents the uncorrectable bit error rate (UBER). At the memory chip level, there would be 3 bad chips for every 100 chips. Is important to say that a bad chip is one that has at least one wrong bit. When NAND flash memory begins to degrade, the probability of errors increases and more correction capacity is required. However, the degradation time will not occur for practical purposes. An analysis of Figure 15 indicates that it is possible to predict the moment when memory begins to degrade. If the number of errors increases, then the decoding and the reading times increase too. One cycle of operation is when the datalogger erases a NAND flash memory chip block, and, next, it writes data on one page of this block. Figure 17: Maximum storage period for different capacities that can be achieved in NAND flash memory units. For a storage capacity of 1 GB, 30 samples per minute, and length of 256 bytes per sample, it is possible to achieve a storage time of 84 days.