Main Site Documentation

Volume.Format in .NET MF 4.1.8


#1

Please confirm whether or not .NET SDK release 4.1.8 with GHI SDK 4.1 release 1.0.18 (Dec 22 2011) supports Volume.Format.

This .NET MF link suggests Volume.Format should be supported:

[italic]VolumeInfo.Format Method[/italic]
http://msdn.microsoft.com/en-us/library/ee433706.aspx

I can make the call


var a = VolumeInfo.GetVolumes();
a[0].Format(code);

but always get Exception was thrown: System.NotSupportedException

I also tried to erase all files on a FAT formatted card via the call


string rootDirectory = VolumeInfo.GetVolumes()[0].RootDirectory;
File.Delete(rootDirectory + "\\*");

and receive System.ArgumentException with using wildcard *. Does that sound right wildcards not implemented?


#2

Balkanaut,

What board are you using? What are you trying to format? When you get the exception System.NotSupportedException, which line of code does it break at?

Make sure that you are also not running on the emulator as GHI specific libraries will not work in the emulator.

On a FEZ Panda II, using an SD Card as my formattable media I implemented the same two lines of code that you used replacing the word “code” with “FAT”, 0.

Here is an example:

 
var a = VolumeInfo.GetVolumes();
a[0].Format("FAT", 0);

With the change, the code formatted properly. Follow this link for more detail about File Systems: http://wiki.tinyclr.com/index.php?title=File_System


#3

Aron:

That still doesn’t work for me:


a[0].Format("FAT", 0);

locks up activity for about 40 seconds as if it gets half-way through formatting the card, and then terminates with an exception:

Exception was thrown: System.IO.IOException

Is there a maximum memory card size supported? This is a 2GB card.


#4

There is no limit. Check your power.


#5

SD power is connected to EMX module pin 68 as per the GHI schematics for the EMX development board:

http://www.ghielectronics.com/downloads/EMX/EMX_DevSys_sch.pdf

Does it need to be done differently?

There’s plenty of power: EMX supplied by 3.3V 3A power supply. Plenty of bypassing to EMX module, but none between EMX and SD power input (same as EMX dev board), trace length < 0.5 inch.


#6

Since we’re talking about the advantages and disadvantages of the EMX reference design on the GHI Electronics website, does the GHI SD/MMC assembly use the card in MMC mode or in SPI mode? I think the MMC mode should allow for faster access times. The reference design shows all pins connected which I would think useful for MMC mode.


#7

And one last question concerning Volume.Format() and potential bad sectors:

When you format the card in a PC, the PC gives option for “quick format” or “format”

“quick format” just re-writes the file table, apparently “format” goes through and will mark any potential bad sectors in the card.

Which one does Volume.Format() do? Which is the best approach for a high-reliability application?


#8

GHI offers the fastest possible interface on SD cards