GHI docs says that it does support FAT16: “NETMF support for the FAT File System is only capable of FAT32 and FAT16. A media formatted as FAT12 will not work. This shouldn’t be an issue since FAT12 is no longer in use.”
[em]Debug.Print(“Storage is not formatted. Format on PC with FAT32/FAT16 first.”);
[/em]
[em]FAT32 and FAT16 formats are supported, but FAT12 is not. You can format your
storage device on a PC with a FAT32 or FAT16 option before using on ChipworkX.[/em]
I tried to use FAT16 because the example code in the GHI SD Card developer’s guide has this line (commented out): //pStoreI.Format(“FAT16”, 0, true); here: https://www.ghielectronics.com/docs/96/sd-card-module
This code does not work. So far, I have not been able to read or write files. I am using a Raptor board with a SDCard module. Does anyone have sample code that is known to work, that can read and write a simple binary file using the GHI SD Card module?
Thanks, I re-formatted the SD card on my PC and now it works, I am able to read and write files. Probably the formatting was corrupted.
Another question: In the NETMF Format function
public void Format (
string fileSystem,
UInt32 parameter,
bool force
)
There are these parameters:
parameter - A parameter to guide formatting for the specified file system.
force - Set to true in order to force removal of the rooted namespace of this volume, or false otherwise.
What are these parameters for, “parameter” and “force”? What do they do? Should “force” be true or false?
fileSystem is the type of filesystem to be created on the media, it should be "FAT" parameter varies according to fileSystem; but, since fileSystem is always “FAT,” this is either 16 or 32 force if true then all open files are closed.