I’m stress testing SD Card on 4.3 and have some issues when i start fill up the SD Card (see attached screenshot). In my main application i get this error when reading my config file:
Load boot.config from µSD storage
#### Exception System.IO.IOException - CLR_E_FILE_IO (1) ####
#### Message:
#### Microsoft.SPOT.IO.NativeFileStream::Read [IP: 0000] ####
#### System.IO.FileStream::Read [IP: 0028] ####
#### System.IO.StreamReader::FillBufferAndReset [IP: 0031] ####
#### System.IO.StreamReader::ReadSeekableStream [IP: 0015] ####
#### System.IO.StreamReader::ReadToEnd [IP: 000f] ####
#### IRC.Program::RunNextConfigThread [IP: 00b6] ####
#### IRC.Program::Main [IP: 02ba] ####
A first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
So i created a small application to verfy :
using System;
using System.IO;
using System.Threading;
using Microsoft.SPOT;
using GHI.IO.Storage;
namespace SD_CARD_Stress
{
public class Program
{
static GHI.IO.Storage.IRemovable MySD;
static StreamWriter LogFile;
public static void Main()
{
Debug.Print("Start");
MySD = new SDCard();
MySD.Mount();
LogFile = new StreamWriter(@ "SD\Stress.log", true);
while (true)
{
//write every 2.5 sec a dummy line
Thread.Sleep(2500);
//write dummy line
LogFile.WriteLine("Dummy line...");
Thread.Sleep(100);
LogFile.Flush();
//show some activity
Debug.Print("Dummy...");
}
}
}
}
In this application i get another error when writing to a log file:
Start
#### Exception System.IO.IOException - CLR_E_FILE_IO (1) ####
#### Message:
#### Microsoft.SPOT.IO.NativeFileStream::Write [IP: 0000] ####
#### System.IO.FileStream::Write [IP: 002a] ####
#### System.IO.StreamWriter::Flush [IP: 0021] ####
A first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
Is there a limit that i crossed? I have checked documentation but don’t find anything there.
Can you please tell me what steps you did exactly, please?
What I am doing here is, copy some large files into SD until the free size is only few MB, then start writing with NETMF until freesize is zero.