Hi, i’m playing with my SD Card module and having problem writing data to the card.
It takes forever to flush and I can’t seems to get the text file written.
Here’s my code
sdCard.MountSDCard();
sdCard.SDCardMounted += sdCard_SDCardMounted;
sdCard.SDCardUnmounted += sdCard_SDCardUnmounted;
VolumeInfo vi = sdCard.GetStorageDevice().Volume;
Debug.Print(vi.Name);
Debug.Print(vi.IsFormatted.ToString());
Debug.Print(vi.FileSystem);
Debug.Print(vi.TotalFreeSpace.ToString());
string root = sdCard.GetStorageDevice().RootDirectory;
Debug.Print("Root: " + root);
var rootDirectory = sdCard.GetStorageDevice().RootDirectory;
var textFile = new StreamWriter(rootDirectory + @ "\hello.txt");
textFile.WriteLine("Hello SD card. " + DateTime.UtcNow.ToString());
//textFile.Flush();
textFile.Close();
sdCard.UnmountSDCard();
Did i missed something obvious. I’m using FEZRaptor. NETMF 4.2