Main Site Documentation

Accessing the SD card


#1

Attempting to access the SD card (uc5550,UCM dev board). SD card inserted

Using the code from the tutorial I get:

What do I need?


#2

Also with:

using GHIElectronics.TinyCLR.Devices.Storage;
using GHIElectronics.TinyCLR.IO;
using System.IO;
using System.Text;


#3

If you’re on the UC5550, you need to use STM32F7, not STM32F4.


#4

Thanks, that fixed it


#5

The sample code for accessing SD includes:

sd = StorageController.FromName(@“GHIElectronics.TinyCLR.NativeApis.STM32F7.SdCardStorageController\0”);
var drive = FileSystem.Mount(sd.Hdc);

what is the type of ‘drive’ I need to save it but cant as a var (???)


#6

FileSystem.Mount(IntPtr) returns IDriveProvider, representing the drive and providing access to information about it. The key property on it that you need is Name that you use to construct paths to access files.