Using the Hydra and SD card module, I can’t get the code to run again without resetting the Hydra. In the debug terminal I just get something like this when I run it the second time:
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Modules\UsbClientDP\NETMF 4.2\le\GTM.GHIElectronics.UsbClientDP.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Mainboards\FEZHydra\NETMF 4.2\le\GHIElectronics.Gadgeteer.FEZHydra.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘c:\users\takushi\documents\visual studio 2012\Projects\sd_card_muddling\sd_card_muddling\bin\Debug\le\sd_card_muddling.exe’, Symbols loaded.
The thread ‘’ (0x2) has exited with code 0 (0x0).
Using mainboard GHI Electronics FEZHydra version 1.2
Here’s my code:
using System;
using System.Text;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Presentation.Shapes;
using Microsoft.SPOT.Touch;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace sd_card_muddling
{
public partial class Program
{
void ProgramStarted()
{
int i = 525600;
byte[] result = Encoding.UTF8.GetBytes(i.ToString());
Debug.Print("sd_card_stuff........");
Thread.Sleep(500);
sdCard.MountSDCard();
Thread.Sleep(500);
GT.StorageDevice storage = sdCard.GetStorageDevice();
Thread.Sleep(500);
Debug.Print("it's DEAD!!!!");
Thread.Sleep(500);
storage.WriteFile("test.txt", result);
Thread.Sleep(500);
Debug.Print("It is written");
Thread.Sleep(500);
sdCard.UnmountSDCard();
Thread.Sleep(500);
Debug.Print(sdCard.IsCardMounted.ToString());
}
}
}
Any thoughts on what I can do to fix this?
Thanks in advance,
Danny