Pergunta

Hi I want to try my SD card on de the netduino plus. I downloaded the SDK from this website yesterday.

I could not find documentation so I figured out the following code. However it gives "CLR_E_VOLUME_NOT_FOUND".. What do I do wrong ? I read something online about mounting and a certain dll (SecretLabs.NETMF.IO.dll ) but I cannot find that dll.

Can anybody help me getting started ?

public class Program
{
    public static void Main()
    {
        var dir = Directory.GetCurrentDirectory();
        var fileName = Path.Combine(dir, "test.txt");
        Debug.Print(fileName);
        byte[] testBytes = new byte[] { 1,2,3,4 };
        File.WriteAllBytes(fileName, testBytes);
    }

}

Output :

\test.txt

Exception System.IO.IOException - CLR_E_VOLUME_NOT_FOUND (1) Message: System.IO.Path::NormalizePath [IP: 0070] System.IO.Path::GetFullPath [IP: 001a] System.IO.FileStream::.ctor [IP: 0009] System.IO.File::WriteAllBytes [IP: 0012] NetduinoPlusApplication1.Program::Main [IP: 0025]

A first chance exception of type 'System.IO.IOException' occurred in System.IO.dll An unhandled exception of type 'System.IO.IOException' occurred in System.IO.dll

Foi útil?

Solução

I've been helped at the Netduino Forum, see this forum post.

I needed to write to the \SD\ folder. Mounting/dll was only necessary for the plain Netduino with an additional SD card shield.

Three quick things:

  1. The MicroSD card will be mounted at \SD\ rather than \
  2. MicroSD cards up to 2GB are generally supported.
  3. SecretLabs.NETMF.IO is only needed for manually mounting and dismounting--on the regular Netduino. The Netduino Plus automatically mounts and dismounts MicroSD Cards.

Outras dicas

Check out the \Samples\SDCardTest in the http://netduinohelpers.codeplex.com/ project for a complete example which is aware of the various Netduino platforms (for instance, the SD card chip select pin for the Netduino Mini is different than the one for the Netduino or the Netduino Plus). As of firmware version 4.1.1 Beta 1, High Capacity microSD cards are supported and have been tested successfully up to 8GB.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top