- Netduino Forums
- → Viewing Profile: Posts: tfitz
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.
Community Stats
- Group Members
- Active Posts 4
- Profile Views 5170
- Member Title New Member
- Age 64 years old
- Birthday September 2, 1959
-
Gender
Male
-
Location
Katy Texas
Posts I've Made
In Topic: netduino plus sd Microsoft Emulator
22 June 2011 - 11:05 PM
*edit* version 2.1 you need to format also.
On the netduion plus Version 2.1 and 2.2 the Volume is "\\ROOT\\" when running under the debugger no need to insert media you must format it before use (see example below). Also the file name of the SD image is OnBoardFlash.dat
namespace test1
{
public class Program
{
public static void Main()
{
bool EMULATOR = true; // should all ready be a defined some where
string CfgData = string.Empty;
string VolumeName = string.Empty;
string CfgFileName = "config.cfg";
if(EMULATOR == true)
VolumeName = "ROOT";
else
VolumeName = "SD";
VolumeInfo[] volumes = VolumeInfo.GetVolumes();
foreach (VolumeInfo volumeInfo in volumes)
{
if (volumeInfo.Name == VolumeName & !volumeInfo.IsFormatted)
{
volumeInfo.Format(1); // I dont know what the parameter wants I tried 0 and 1
}
}
File.WriteAllBytes("\\" + VolumeName + "\\" + CfgFileName, Encoding.UTF8.GetBytes("1234567890"));
CfgData = new String(System.Text.Encoding.UTF8.GetChars(File.ReadAllBytes("\\"+VolumeName+"\\"+CfgFileName)));
}
}
}
In Topic: netduino plus sd Microsoft Emulator
21 June 2011 - 06:28 PM
hi Stefan,
After creating a new media file called sd1.dat using the Insert/Eject menu
and running the code below it shows the only formatted volume is the \WINFS volume.
VolumeInfo[] volumes = VolumeInfo.GetVolumes();
foreach (VolumeInfo volumeInfo in volumes)
{
Debug.Print(volumeInfo.RootDirectory + " " + volumeInfo.IsFormatted + "\n");
}
\ROOT False
\WINFS True
\SD1 False
- Netduino Forums
- → Viewing Profile: Posts: tfitz
- Privacy Policy