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.

lynxeyed_atsu

Member Since 19 Aug 2010
Offline Last Active Apr 09 2012 04:26 AM
-----

#2415 Netduino Firmware v4.1.1 ALPHA 1

Posted by lynxeyed_atsu on 18 September 2010 - 09:01 AM

Hi all.
I'm in a trouble controlling a SDCard(1GB) with FAT16-formatted.
I changed the firmware of my netduino v.4.1.1-alpha usin MFDeploy.exe.
I use GPIO_PIN_D3 as CS-pin of SDCard.
Here's my code. And I could build with no errors.
using System;
using System.Threading;
using Microsoft.SPOT;
using System.IO;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.IO; 
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace NetduinoApplication3
{
    public class Program
    {
        public static void Main()
        {
            StorageDevice.MountSD("SD1", SPI_Devices.SPI1, Pins.GPIO_PIN_D3/*CS pin*/);

            string[] directories = System.IO.Directory.GetDirectories(@"\");
            Debug.Print("directory count: " + directories.Length.ToString());

            for (int i = 0; i < directories.Length; i++)
            {
                Debug.Print("directory: " + directories[i]);
            }

            string[] files = System.IO.Directory.GetFiles(@"\SD1");
            Debug.Print("file count: " + files.Length.ToString());

            for (int i = 0; i < files.Length; i++)
            {
                Debug.Print("filename: " + files[i]);
                FileStream fs = new FileStream(files[i], FileMode.Open, FileAccess.Read, FileShare.None, 512);
                StreamReader sr = new StreamReader(fs);
                Debug.Print("contents: " + sr.ReadToEnd());
            }
        }
    }
}

I connected my netduino with "TFT-LCD & SDCard shield"(this shield was made in JPN) hit "F5" key to start debug.
But VS2010 just say, "The debugging target is not an initialized state;rebooting".
So I Stopped debuging. And I plugged USB cable after unplugged my netduino,but There's no changes.VS2010 just say rebooting. :-p
So give me any advice?
  • Sim likes this


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.