peter
Newbie

Posts: 3
|
 |
« on: February 10, 2009, 03:27:55 PM » |
|
Hardware: CanXtra Software: ExampleProject.sln, File SDExample.cs Code: string[] dirs = System.IO.Directory.GetFiles(e.Volume.RootDirectory);
Throws exception when it tries to access an SD card.
Exception: Exception was thrown: System.NotSupportedException
Stack trace: Microsoft.SPOT.IO.NativeFindFile::.ctor System.IO.Directory::GetChildren System.IO.Directory::GetFiles SDExample::Insert Microsoft.SPOT.IO.RemovableMedia::MessageHandler
I tried reformatting the SD card. It reads and writes fine from my PC.
The Microsoft Directory.GetFiles() documentation does not describe what this exception means.
Is there other documentation that might shed light on what is not supported about my card?
thanks peter
|
|
|
|
|
Logged
|
|
|
|
|
GHI_Support
|
 |
« Reply #1 on: February 11, 2009, 09:26:16 AM » |
|
MFW only supports FAT32. You can format the SD card on Windows with FAT32 and try again.
|
|
|
|
|
Logged
|
|
|
|
peter
Newbie

Posts: 3
|
 |
« Reply #2 on: February 12, 2009, 01:47:10 PM » |
|
Yup that did it.
Thanks very much for the help! peter
|
|
|
|
|
Logged
|
|
|
|
lbq1221119
Newbie

Posts: 15
|
 |
« Reply #3 on: May 21, 2009, 12:13:22 AM » |
|
i also have this problem when using Directory.GetFiles()
there is always a exception, and my SD format is Fat32, i have even use the p1.12pin in EM to detect if the SD card is pluged in.
|
|
|
|
|
Logged
|
|
|
|
|
GHI_Support
|
 |
« Reply #4 on: May 21, 2009, 08:13:42 AM » |
|
Try not to do anything special at first and detect it until you have it working. Just Format it on Windows FAT32, create a file and then call the function AFTER mounting SD card.
|
|
|
|
|
Logged
|
|
|
|
Zebberdee
Newbie

Posts: 7
|
 |
« Reply #5 on: October 24, 2009, 03:12:18 PM » |
|
I have also the problem, that I get the NotSupportedException, when I trie to write on the SD card. It is very confusing, because i programmed that program to another Embedded Master too, and it worked. The SD card is FAT32 formatted, and my program also detects that a SD card is in the slot, but FileSystem field in the VolumeInfo is null.
Thanks for all helpful answers
|
|
|
|
|
Logged
|
|
|
|
|
GHI_Support
|
 |
« Reply #6 on: October 26, 2009, 08:23:41 AM » |
|
How come it works on one Embedded Master but not the other? Then the hardware you have might have a problem...
|
|
|
|
|
Logged
|
|
|
|
timothybean
Newbie

Posts: 40
|
 |
« Reply #7 on: March 29, 2010, 07:08:41 AM » |
|
I am getting the same issue. I have a breakout board and my custom board. On the breakout board (EM) I have the SD card hooked up the same way as on the custom board. But, the breakout board can read the card fine and my custom board cannot and gets the System.NotSupportedException. It is formatted FAT32 and there is 2 files on it... It mounts the drive ok, but then when I try to read the files off of it I get the exception. Is there anyway to tell exactly WHAT this means or what is causing it?
Thanks
Tim
|
|
|
|
|
Logged
|
|
|
|
|
SupportAdmin
|
 |
« Reply #8 on: March 29, 2010, 07:37:18 AM » |
|
You must have something wired wrong;otherwise, how do you explain this?
|
|
|
|
|
Logged
|
|
|
|
timothybean
Newbie

Posts: 40
|
 |
« Reply #9 on: March 29, 2010, 08:08:14 AM » |
|
There is something weird wrong, and I can't explain it, especially with an error message that tells you something that is not true. Is there a way to see WHY it is throwing the exception? Does it set a register flag somewhere I can look at? I am not sure about the process that it goes through to mount the driver or anything, but it seems happy with that, so I assume that it is talking to the SD card ok....
Thanks
Tim
|
|
|
|
|
Logged
|
|
|
|
|
SupportAdmin
|
 |
« Reply #10 on: March 29, 2010, 08:10:37 AM » |
|
Yes it doesn't make sense for us either. If you can give us an example to reproduce it then we can look into it.
Maybe the problem is in the firmware you have loaded?
|
|
|
|
|
Logged
|
|
|
|
timothybean
Newbie

Posts: 40
|
 |
« Reply #11 on: March 29, 2010, 08:41:54 AM » |
|
Alright,
I loaded the same firmware as I have with the breakout board.... so I think it is the same. Just weird why it is giving me this problem now and not then... I will try to read and write and see if that gives me the same problems. It looks like the other people have the problem like I do with just listing the files... and maybe not read and write. I have it hooked up the same way as the dev kit does though... i will reformat the SD again and see if that helps any.
Tim
|
|
|
|
|
Logged
|
|
|
|
|