PandaII SD-CARD Error

I have send them my Panda II today.
Hopefully it will arrive in 5-7 days - and we will get a solution to this problem.
There is nothing more i can do.

Madara, welcome to the community.

Seeing file io exception is reasonable. Maybe try a good power source or different SD card. If you still see exception, step in code using F10 and tell us where you get the exception and show a full trace of your output window.

The others are seeing a not implemented exception which is not making sense at all.

I may have to get on chat or phone and work with you guys to figure this out!

Hi Gus.
So, I sat down with the Panda this evening, and started stepping through my code. Miraculously, the exception never occurred while I was single-stepping, but when I just allowed it run (i.e pressing F5) then exception always appeared.
I then took your advice and decided to use a different memory card, capacity 1GB. Luckily, I got a spare that had never been used before, not in mobile phones or PCs. On inserting it, there was no exception! It read the size correctly. I then proceeded to format the original 2GB memory card I tried it with, using FAT as the filesystem, with device defaults, and [italic]unchecking quick format[/italic]. On insertion, everything worked perfectly. I was even able to open a FileStream to write to a file, list out the files and folders on the memory card (I copied some onto it after formatting) and even read out the contents of the first text file it found in the root directory. No exception at all! Everything was fine!

Although, I observed that on adding a Thread.Sleep(3000) call just after mounting the PersistentStorage filesystem (this was before I tried the newer 1GB card and discovered that it could’ve been the filesystem), there was no longer an exception, but the capacity was read as 0 instead of 2GB and it showed on the Panda as not formatted. Perhaps anyone having SD problems could try that?
Thanks, Gus and everyone. Thomas and Pierre2, I hope everything works out.

Pierre2, can you check this?
I think this is not a solution for our problem. I hope that i am wrong :slight_smile:

I have reviewed the method of Madara_x64 but it has not changed. as well, before I had even used the debug mode.

yesterday I’ve tested a couple of cards from friends:
4GB SunDisk (HC),
512MB SD …

I’ve used this progam as following release (no debug):

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

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

using GHIElectronics.NETMF.IO;
using GHIElectronics.NETMF.System;

using GHIElectronics.NETMF.FEZ;

namespace FEZ_Panda_II_SD_CARF_FORMAT_BLINK
{
    public class Program
    {
        private static bool ledState = false;
        private static OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, ledState);

        private static PersistentStorage pStore;
        private static VolumeInfo pStoreI;

        public static void Main()
        {
            pStore = new PersistentStorage("SD");
            pStore.MountFileSystem();
            Thread.Sleep(50);
            pStoreI = VolumeInfo.GetVolumes()[0];

            if (!pStoreI.IsFormatted)
            {
                Blinky(4);
                Thread.Sleep(50);
                //pStoreI.Format("FAT16", 0, true);
                Thread.Sleep(50);
                Blinky(4);

            }
            else {
                Blinky(50);
            }            
            Thread.Sleep(Timeout.Infinite);
        }

        public static void Blinky(int myTime) 
        {
            for (int i = 0; i < myTime; i++) {
                Thread.Sleep(500);
                ledState = !ledState;
                led.Write(ledState);
            }        
        }
    }
}

to a power supply and no connection to pc. but not recognized as formatted.

I had tried my panda on the version 1.6 but it did not work. USBiziUpdater says: Cannot connect to the device! Follow steps 1 to 3.

I’m stumped.

perhaps we should bear information about our system of:

Betriebsystemname Microsoft Windows 7 Professional
Version 6.1.7600 Build 7600
Systemtyp X86-basierter PC

use: ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.1\Tools\MFDeploy.exe’

ClrInfo.clrVersion: 4.1.2821.0
ClrInfo.clrVendorInfo: Microsoft Copyright (C) Microsoft Corporation. All rig
ClrInfo.targetFrameworkVersion: 4.1.2821.0
SolutionReleaseInfo.solutionVersion: 4.1.7.0
SolutionReleaseInfo.solutionVendorInfo: GHI Electronics, LLC
SoftwareVersion.BuildDate: Sep 28 2011
SoftwareVersion.CompilerVersion: 410561

Panda II REV D

use: info about visual studio

Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.0.30319 SP1Rel

Installierte Version: Ultimate

Microsoft .NET Micro Framework v4.1 01019-532-2002102-70147
Microsoft .NET Micro Framework SDK v4.1
Version 4.1.2821.0

Microsoft Office Developer Tools 01019-532-2002102-70147
Microsoft Office Developer Tools

Microsoft Visual C# 2010 01019-532-2002102-70147
Microsoft Visual C# 2010

Microsoft Visual C++ 2010 01019-532-2002102-70147
Microsoft Visual C++ 2010

Microsoft Visual Studio 2010 Architecture und Modeling Tools 01019-532-2002102-70147
Microsoft Visual Studio 2010 Architecture und Modeling Tools

Microsoft Visual Studio 2010 Team Explorer 01019-532-2002102-70147
Microsoft Visual Studio 2010 Team Explorer

Microsoft Visual Web Developer 2010 01019-532-2002102-70147
Microsoft Visual Web Developer 2010

Rechtschreibprüfung für die Microsoft Visual Studio 2010-Codeanalyse 01019-532-2002102-70147
Rechtschreibprüfung für die Microsoft Visual Studio 2010-Codeanalyse

Black Duck Code Search 2.0.0
Black Duck Code Search allows developers to search code that is located in multiple internal code repositories or on Koders.com, enabling developers to better understand existing code and to develop new features more quickly. Black Duck is a Visual Studio Industry Partner.

Crystal Reports Templates for Microsoft Visual Studio 2010
Crystal Reports Templates for Microsoft Visual Studio 2010

Microsoft Visual Studio 2010 Ultimate - DEU Service Pack 1 (KB983509) KB983509
This service pack is for Microsoft Visual Studio 2010 Ultimate - DEU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit Description of Visual Studio 2010 Service Pack 1 - Microsoft Support.

I’ve forgotten what?

Latest firmware is 4.1.8 not 4.1.7 but I can’t see why would this be the problem.
http://tinyclr.com/release-notes/

i know, you has written [quote]We just tested it again, in latest firmware, read/write/format. All works perfectly fine![/quote]
but on Reply 16, Aron has a “SolutionReleaseInfo.solutionVersion: 4.1.6.0” and we all 4.1.7 an 4.1.8.
i think 4.1.6 sounds good ::slight_smile:

Aron tested it again with latest firmware I think.

Aron?

Yes I did re-test with the latest firmware (4.1.8.0) and I used all of the examples that I posted in my reply. I was able to read the directory and files and I was able to format the same card and everything tested well.

Have you guys received my PandaII Board?
Should have arrived Monday (23.1.2012)

It is on my desk but I forgot about it. Sorry :slight_smile:
Will check monday

We have received and tested your board. We tested the following code with 4 different SD cards, each formatted using either FAT or FAT 32, with multiple allocation unit sizes:

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

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

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

namespace fexpanda2_sendback_board
{
    public class FormatParameters
    {
        public String VolumeName = "";
        public uint Parameter = 0;
        public String Comment = "";
    }

    public class Program
    {
        public static void Main()
        {
            // ...
            // SD Card is inserted
            // Create a new storage device
            PersistentStorage sdPS = new PersistentStorage("SD");

            // Mount the file system
            sdPS.MountFileSystem();


            // Assume one storage device is available, access it through 
            // Micro Framework and display available files and folders:
            Debug.Print("Getting files and folders:");
            if (VolumeInfo.GetVolumes()[0].IsFormatted)
            {
                string rootDirectory =
                    VolumeInfo.GetVolumes()[0].RootDirectory;
                string[] files = Directory.GetFiles(rootDirectory);
                string[] folders = Directory.GetDirectories(rootDirectory);

                Debug.Print("Files available on " + rootDirectory + ":");
                for (int i = 0; i < files.Length; i++)
                    Debug.Print(files[i]);

                Debug.Print("Folders available on " + rootDirectory + ":");
                for (int i = 0; i < folders.Length; i++)
                    Debug.Print(folders[i]);
            }
            else
            {
                Debug.Print("Storage is not formatted. Format on PC with FAT32/FAT16 first.");
            }

            // Unmount
            Thread.Sleep(100);
            sdPS.UnmountFileSystem();
            Thread.Sleep(Timeout.Infinite);
        }
    }
}

The problem was not present in any test with the correct formatting. Would you like the board and card shipped back to the same address?

Great…
Have you tried to use the SD-Card i provided?

We did. That was one of the four we used.

Thank you very mutch for testing my board.
Can you send it back to me?

Well… i have no idea why i can not format the SD via PandaII. I used the same code and the same SD.

We sure can. When you get it back, try the code above in a new project, and place some files and folders on the SD card.

hey Thomas8,
did you get your Panda II back? Does your SD-Card work with you?