PandaII SD-CARD Error

Hi Gus
When i use your code from Reply 16, i get a

Exception System.IO.IOException - CLR_E_FILE_IO (4)

but i think it is only because the unmount failed (directly after the mount)
When i put a short Thread-sleep before the unmount i have no exeption. So this is not the problem here - you are right.

I get

Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (5)

when i try to create a filestream on a SD-card the Panda II is not recognizing as formated ( right now… every single SD) or if i try to use the format-code from reply 13.

This is normal as the media maybe busy so when you open a file and use it, give it a sec before oyu close it and try.

Also use external power source, do not rely on USB power (or use powered HUB).

[quote]I get

Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (5)

when i try to create a filestream on a SD-card the Panda II is not recognizing as formated ( right now… every single SD)[/quote]
Let us not mix things so we can help you better. Once problem above is resolved, then we will look into this one.

As i was saying, the Exception System.IO.IOException is no longer a problem.

  • I have a good power supply connected.

I use:

  • GHI NETMF v4.1 SDK Build Date: 11:01 AM 1/6/2012
  • GHI NETMF SDK v1.0.18 12/21/2011
  • Firmware Ver: 4.1.8.0 (Panda II)
  • Windows7, Visual Studio 2010 Prof.

Ok to be 100% sure. You SD card is working perfectly fine now.

The only problem you have is that calling format causes a “not implemented exception”?

I can not use the SD Card with my Panda II.
I can format it on windows and copy files on it i need for my Panda-Webserver (also on Windows).

The Panda II says the SD is not formated.
I can not open a filestream and i can not format the SD with a panda program (post 13).
System.NotSupportedException is the only exception i get.

same as Pierre

Then how did you get this?!!

[quote]When i use your code from Reply 16, i get a

Exception System.IO.IOException - CLR_E_FILE_IO (4)

but i think it is only because the unmount failed (directly after the mount)
When i put a short Thread-sleep before the unmount i have no exeption. So this is not the problem here - you are right.[/quote]

I think we are all way off. Please stick to one example, the one Aron provided and tell us what you see and at what line.

I still have no solution.
I also used another PC - nothing.

another SD card for trying, I haven’t.

here’s a different post, but apparently without solution:
[url]http://www.tinyclr.com/forum/2/4543/#/3/[/url]

interesting: [quote]But if a 2Gb SD (I also tried a 4Gb SD) is inserted, I get the following messages: … [/quote]

I get this

Exception System.IO.IOException - CLR_E_FILE_IO (4)

when
i use the code from Reply 16 (Arons example)
I get this because the SD is not recognized as formatted
so that the unmount will follow direktly after the mount. Only a timing problem in this case. I can set a short thread.sleep before the unmount and everything is ok.

When i start Arons code with the timing taken care of, i get no error.
Debug-Output: Storage is not formatted. Format on PC with FAT32/FAT16 first.
That is all - my formatted SD is not detected as formated.

next, i will downgrade my panda to 4.1.6.0.
I hope this helps :frowning:

We just tested it again, in latest firmware, read/write/format. All works perfectly fine!

I am not sure how I can help at this point.

You will only get the exception if you run on emulator instead of device.

There are now two developers reporting the same problem with the Panda II SD Card reader.
The driver reports that the card is not formatted, and it fails when they try to format it on the Panda II.
They are both on the latest firmware, and they are both using external power supplies.

Perhaps they both have faulty SD card readers??

I will happily test it out if they want to send me their Panda. This is very strange making me really interested in knowing what is going on!

I can send you my Panda II board + SD-Card from Germany.
Can you give me an Adress and Name?

Use address here please

Attn: Gus

Format utility on Win7 has a button “Restore device default”, can you please try to click on that before formatting your SD?

I used the “Restore device default” option - no difference.

Thomas, did you use the sd card before for other purposes, like updating/flashing an android tablet? I had issues in the past with sd cards.(not in combination with GHI hardware), but i solved it using a utility program called killdisk (http://www.killdisk.com/) it was a partition table issue. Try to use killdisk to kill all partitions and erase the card, 2nd format using windows and try again.

BE CAREFULL USING KILLDISK, MAKE SURE YOU SELECT YOUR SD CARD AND NOT YOUR HARD-DISK :wink:

Yes. I have done that, too.

I used Killdisk to kill the partition, also MiniTool Partition.
I formated the SD-Card with windows or the MiniTool in many different FAT16 oder FAT32 Settings.

no difference.

Unfortunately… i guess there’s only one option left and thats to return your hardware :frowning: or maybe exchange the panda with your local supplier of you bought it locally.

Hi all.
This very morning, I tried to use to my own Panda II’s SD-card reader. Its a microSD card manufactured by Kingston, with 2GB capacity. And no, its new. Hasn’t been used for anything else before. Used my cellphone to format it and store a few files. I get the following exception.

#### Exception System.IO.IOException - CLR_E_FILE_IO (4) ####
#### Message: 
#### Microsoft.SPOT.IO.VolumeInfo::.ctor [IP: 0000] ####
#### Microsoft.SPOT.IO.RemovableMedia::MessageHandler [IP: 0022] ####

MFDeploy says:

ClrInfo.clrVersion: 4.1.2821.0
ClrInfo.clrVendorInfo: Microsoft Copyright © Microsoft Corporation. All rig
ClrInfo.targetFrameworkVersion: 4.1.2821.0
SolutionReleaseInfo.solutionVersion: 4.1.7.0
Here’s the code:

 using System;
using System.IO;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.IO;

using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.IO;




namespace NETMFSDCardHello
{
    public class Program
    {
        public static void Main()
        {
            // Blink board LED

            bool ledState = false;
            PersistentStorage _stor = new PersistentStorage("SD");
            _stor.MountFileSystem();

            VolumeInfo[] infos = VolumeInfo.GetVolumes();

            foreach (VolumeInfo s in infos)
            {
                Debug.Print(s.Name + " , " + s.TotalSize.ToString());
            }

            Thread.Sleep(20);
            
           
                _stor.UnmountFileSystem();
           
            OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, ledState);

            while (true)
            {
                // Sleep for 500 milliseconds
                Thread.Sleep(500);
                
                // toggle LED state
                ledState = !ledState;
                led.Write(ledState);
            }
        }

    }
}

It also doesn’t matter whether or not I include the 20-ms thread sleep code. The exception still occurs.
When I got my Panda II, I used the newly bundled USBIzi updater app to update it.
I’d read through the posts on this topic last night, and decided to give mine a try. Got the same problem.
I’m not sure how valid an observation this is, but perhaps it has something to do with the version of Visual Studio?
Here’s what I mean.
Pierre, the initial poster, is using VS2010 Ultimate like me. Like him, no other code reports errors. Jasdev also stated that two developers had the same problem. I guessed that if they’re developers and not quite hobbyists, they may likely be using a version of VS2010 that IS NOT Express. Thomas also used VS2010 Professional, not Express. Could this possibly be a problem?
I use Win7 Home Premium x64. Perhaps its a 64-bit issue?
I’m currently in Africa, and it will be nigh impossible to send my board back. I only got it yesterday :’(
These may be baseless observations, but its worth a shot if it means I don’t have to wait a month for a new Panda II.