Cerberus with SD Card issue

Yes, I’ve now tested with the same cable on both the uSD and SD card modules, still using the same uSD card but in a SanDisk SD-size adapter in the SD module, and the behaviour is still the same - the SD card module works fine but the uSD module does not.

Now I know there’s some SD card changes coming down from Dat in the next firmware cycle but I’ll still add a little more data here in case it helps.

When I start the app, and then insert the SD card into the uSD module, the whole system appears to lock up. I can’t pause the running app, the debugger seems to have lost connection with the processor (so I assume it’s now deep in core code and not giving the debugger any time).

If I go into MFDeploy, reboot the device, and select USB transport and hit F5 to connect, I can see the timer ticking over. I insert the uSD card and system freezes as it does when debugging in VS.

If however I then disconnect, and reset the device without removing the uSD card, the app starts. I can then attach MFDeploy successfully and things work. If I then reboot the CLR from MFDeploy, I see the boot messages and I also see this:

   Assembly: System.Net.Security (4.2.0.0)  Attaching deployed file.
   Assembly: System.Http (4.2.0.0)  Resolving.
Ready.
Using mainboard GHI Electronics FEZCerberus version 1.1
ProgramStarted
SD card has been successfully mounted. You can now read/write/create/delete files
Unmount before removing
I: 0
I: 1
I: 2
I: 3
I: 4
I: 5
The SD card has been unmounted
DO NOT try to access it without mounting it again first
I: 6
I: 7
I: 8
User Cancel...

So it works fine if the card is already mounted when the app starts. I wonder if that behaviour difference makes sense to you Dat?

For completeness, here’s the test code I am using.

using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;

using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

namespace CerbSDTest4Forum
{
    public partial class Program
    {
        long i = 0;
//        private const Cpu.PWMChannel PWM_LED = Cpu.PWMChannel.PWM_4;
            GT.Timer timer = new GT.Timer(1000);
        

        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing 
            their name followed by a period, e.g.  button.  or  camera.
            
            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>
            
            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/


            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("ProgramStarted");
            timer.Tick += new GT.Timer.TickEventHandler(timer_Tick);
            sdCard.SDCardMounted += new SDCard.SDCardMountedEventHandler(sdCard_SDCardMounted);
            sdCard.SDCardUnmounted += new SDCard.SDCardUnmountedEventHandler(sdCard_SDCardUnmounted);
            timer.Start();
        }

        void timer_Tick(GT.Timer timer)
        {
            Debug.Print("I: " + i++);
        }
        void sdCard_SDCardUnmounted(SDCard sender)
        {
            Debug.Print("The SD card has been unmounted");
            Debug.Print("DO NOT try to access it without mounting it again first");
        }

        void sdCard_SDCardMounted(SDCard sender, GT.StorageDevice SDCard)
        {
            Debug.Print("SD card has been successfully mounted. You can now read/write/create/delete files");
            Debug.Print("Unmount before removing");
        }
    }
}

Hi

I have the same problem but I have the GHI SD Card module on a FEZ Cerberus board. I also saw this happen on a GHI SD Card on a Hydra board. On the cerberus it all works fine, then when I plug in the SD Card module and connect it in the hardware builder in VB2010 then go to the program section and deploy it just stops deploying, hangs VB and I need to do a firmware reset on the Cerberus. I have tried different cards and anything from just connecting the SD card module to actually trying to access the card.

Thanks