Curious mind so I ask.
Using:
UCM Dev Board Rev E with a UC5550 Rev c and UD700 Rev A
Libs version 1.0.0-preview2
VS 2017 Version 15.8.5
Windows 10 Pro
My App was made for no particular reason other than see if I could get the SD Card on the Dev Board working.
I was getting nowhere really fast and then I found:
FileStream.Read Method (System.IO) | Microsoft Learn
I finally had something I could understand (Sort of).
I can now create directories and write/read simple text files.
It appears that the SD card does not need any special initializing. (Happy Face)
I have two question about things I tried that I could not get to work.
-
Changing drive.name
I usedprivate static StorageController sc;
private static IDriveProvider drive;
private static FileStream file// UC5550 is a STM32F7
sc = StorageController.FromName(@“GHIElectronics.TinyCLR.NativeApis.STM32F7.SdCardStorageController\0”);
drive = FileSystem.Mount(sc.Hdc);// The following changes the name to B:\ but it causes Exception if used
drive.Name = $@“B:";
file = new FileStream($@”{drive.Name}\SDTestNoFolder.txt", FileMode.Create);
(An unhandled exception of type ‘System.NullReferenceException’ occurred in GHIElectronics.TinyCLR.IO.dll) -
How to
public static bool Unmount(IntPtr hdc);How and when to use it.
Thank You