Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

spur

Member Since 30 Sep 2010
Offline Last Active Nov 12 2012 07:08 PM
-----

Topics I've Started

SD Card Write Problems - CLR_E_INVALID_DRIVER

13 December 2010 - 09:08 PM

I'm trying to get the SD card to work but having some trouble. I'm getting a CLR_E_INVALID_DRIVER exception:

#### Exception System.IO.IOException - CLR_E_INVALID_DRIVER (1) ####
    #### Message: 
    #### Microsoft.SPOT.IO.NativeIO::GetAttributes [IP: 0000] ####
    #### System.IO.FileStream::.ctor [IP: 005c] ####
    #### NetduinoPlusWebServer.Program::Main [IP: 007c] ####
A first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
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

I have a 2GB card, formatted to FAT32. Netduino plus is running 4.1.1 Alpha 3.

This is the code I'm trying to run:
FileStream fs = new FileStream("\\SD\\test.txt", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None, 512);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("hello from netduino");
sw.WriteLine("done.");

Exception is thrown on the first line. I haven't been able to find anything about the CLR_E_INVALID_DRIVER exception, so I'm not sure what to try to fix it. Unfortunately I don't have another micro SD card to try.

Any suggestions?

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.