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.

tfitz

Member Since 13 May 2011
Offline Last Active Jan 17 2015 04:45 PM
-----

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

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.