I our current design we use the USB client to get access to the storage on the custom PCB.
The basic approach is check the USB client state during the watchdog timer reset (every 3 seconds)
USBClientController.State usbState = USBClientController.GetState();
next we close files, unmount SD or USB depending on a flag and attach + enable this to the USB client :
// connect only once !
if (usbState == USBClientController.State.Running && MyUSBClientLoaded == 0)
{
// only if SD is actually mounted !!
if (SDStorage == 1)
{
// flag
MyUSBClientLoaded = 1;
// log naar syslog
SysLogFileWriteLine(RealDateTime + " : " + "USB Client connected");
// still mounted -> close all file handles
FreeSDcard();
Thread.Sleep(50);
MySD.UnmountFileSystem();
// connect the SD card
MyUSBClient.AttachLun(0, MySD, "Emrol", "IRC Controller SD");
MyUSBClient.EnableLun(0);
}
else
{
//als FreedSD aangeroepen is de USB mounten inplaatst van SD
// flag
MyUSBClientLoaded = 1;
// log naar syslog
SysLogFileWriteLine(RealDateTime + " : " + "USB Client connected");
MyUSB.UnmountFileSystem();
// connect the USB memory
MyUSBClient.AttachLun(0, MyUSB, "Emrol", "IRC Controller USB");
MyUSBClient.EnableLun(0);
}
}
Here comes my first question: At the connected pc i instant see a USB mass storage device popping up, but it takes 30-60 seconds before it’s accessible, is this normal timing?
Second question: today we tested formatting the connected storage from the USB client and for the USB mass storage it took more then one hour to format (not quick format) a 4Gb transcend (TSS112288M~~44GUFFM–H) module? is this normal timing?
Did we did something wrong or is this normal timing on GHI filesystem?