Main Site Documentation

FEZ Raptor SD problem


#1

I’ll start by saying that the firmware is not what the factory loads.
I had to reinstall the firmware because I trashed it somehow.

I used the G400 firmware because I know of no new firmware for Raptor.

That said…

My problem is that I receive a exception if I use:

private static PersistentStorage pS;
pS = new PersistentStorage(“SD”);


using System;
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 System.IO;
using System.Text;

using Microsoft.SPOT.IO;
using GHI.Premium.IO;
using GHI.Premium.Hardware;
using GHI.Premium.System;

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


// FEZ Raptor using firmware G400 4.2.11.0
// VS2012 express using .NET Micro framework 4.2
// Windows 8 64bit


// App to show exception using PersistentStorage
// Has assemblies: 
// GHI.Premium.Hardware, GHI.Premium.IO, GHI.Premium.System, System.IO, Microsoft.SPOT.IO.
 
namespace RaptorShowSDError
{
    public partial class Program
    {
        private static PersistentStorage pS;
        private static VolumeInfo vI;

        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
          
            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");

            vI = VolumeInfo.GetVolumes()[0];  //No exception

            try
            {
                pS = new PersistentStorage("SD");
            }
            catch (System.Exception se)
            {
                Debug.Print("Debug Output: " + se.Message);
            }

            /*
                Using mainboard GHI Electronics FEZRaptor version 1.0
                Program Started
                    #### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
                    #### Message: 
                    #### GHI.Premium.IO.PersistentStorage::.ctor [IP: 0000] ####
                    #### RaptorShowSDError.Program::ProgramStarted [IP: 0017] ####
                A first chance exception of type 'System.InvalidOperationException' occurred in GHI.Premium.IO.dll
             * 
                Debug Output: Exception was thrown: System.InvalidOperationException
                    #### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (1) ####
                    #### Message: 
                    #### RaptorShowSDError.Program::ProgramStarted [IP: 0037] ####
                A first chance exception of type 'System.NullReferenceException' occurred in RaptorShowSDError.exe
                An unhandled exception of type 'System.NullReferenceException' occurred in RaptorShowSDError.exe
            */
            pS.MountFileSystem();
        }

    }
}


Any info appreciated.

Baby sitting so not sure when I’ll be back… Maybe tonight…

Thanks!


#2

You need to use SD_SPI

https://www.ghielectronics.com/community/forum/topic?id=13444&page=4


#3

Architect

Thank You…


#4

You are welcome. :slight_smile: