Hi guys,
I’m working on a FEZ Cerberus (HW Rev. 1.3 - FW 4.3.6.0).
After an hour of loop “writing code and then test” , now I’m encountering a strange exception.
I’ll try to explain…
In the immediate window of VS2012 I read this text:
[quote]Using mainboard GHI Electronics FEZ Cerberus version 1.3
Eccezione first-chance di tipo ‘System.InvalidOperationException’ in GHI.Hardware.dll[/quote]
That exception is a little bit strange because is thrown before the code enters in ProgramStarted method.
So I checked and the exception comes from the “InitializeModules” of the Main() method, during the initialization of the SDCard module.
Investigating a little bit more, I downloaded the SDCard_43.cs from bit bucket and I found that the exception is thrown by this line:
this.Mount();
in the constructor of SDCard class:
public SDCard(int socketNumber)
{
Socket socket = Socket.GetSocket(socketNumber, true, this, null);
socket.EnsureTypeIsSupported('F', this);
socket.ReservePin(Socket.Pin.Four, this);
socket.ReservePin(Socket.Pin.Five, this);
socket.ReservePin(Socket.Pin.Six, this);
socket.ReservePin(Socket.Pin.Seven, this);
socket.ReservePin(Socket.Pin.Eight, this);
socket.ReservePin(Socket.Pin.Nine, this);
RemovableMedia.Insert += this.OnInsert;
RemovableMedia.Eject += this.OnEject;
this.IsCardMounted = false;
this.cardDetect = GTI.InterruptInputFactory.Create(socket, Socket.Pin.Three, GTI.GlitchFilterMode.On, GTI.ResistorMode.PullUp, GTI.InterruptMode.RisingAndFallingEdge, this);
this.cardDetect.Interrupt += this.OnCardDetect;
if (this.IsCardInserted)
this.Mount();
}
The code of the Mount() method is:
public bool Mount()
{
if (this.IsCardMounted) throw new InvalidOperationException("The card is already mounted.");
return Mainboard.MountStorageDevice("SD");
}
I’m not able to reproduce the exception each time I go step-by-step in the source code, so it seems to be like a timing issue in the code contained in Mainboard.MountStorageDevice(“SD”) method…
What do you suggest?
Is a known issue?
