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.
Photo

Netduino Firmware v4.1.1 ALPHA 1


  • This topic is locked This topic is locked
44 replies to this topic

#21 Bob Cravens

Bob Cravens

    Member

  • Members
  • PipPip
  • 17 posts

Posted 05 September 2010 - 11:37 PM

Is this normal behavior?

Somewhere, I open up a FileStream and a StreamWriter
_fileStream = new FileStream(_path, FileMode.CreateNew, FileAccess.Write, FileShare.None, 512);
_writer = new StreamWriter(_fileStream);

I periodically write to the the _stream object. I found that if I just call flush on the StreamWriter nothing gets written to the file. I need to do the following:

_writer.WriteLine(rawLine);
_writer.Flush();
_fileStream.Flush();

Its like the flush does not cascade to the underlying stream. I am not certain if that is the desired behavior. It was not what I was expecting.

Bob

#22 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 September 2010 - 11:51 PM

Hmm, good catch. That might be a bug in .NET MF. I'll log it into our support system and verify that the behavior is different on the PC (and then check with Microsoft)... In the meantime, flush the stream rather than the writer... Thanks! Chris

#23 Bob Cravens

Bob Cravens

    Member

  • Members
  • PipPip
  • 17 posts

Posted 06 September 2010 - 12:09 AM

Yeah, I tried flushing the FileStream alone. That did not work either. It only really flushed when I flushed the StreamWriter followed by flushing the FileStream. It was like I was flushing the data through the levels: StreamWriter to FileStream and then FileStream to the disk. Bob

#24 PaulS

PaulS

    New Member

  • Members
  • Pip
  • 7 posts

Posted 06 September 2010 - 04:47 PM

Where does the SecretLabs.NETMF zip file need to be unzipped to?

#25 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 September 2010 - 05:08 PM

Where does the SecretLabs.NETMF zip file need to be unzipped to?


For Alpha Testing purposes, anywhere. When you add references to your project, pick the "Browse..." tab and select the SecretLabs.NETMF.IO.dll file in the main unzipped directory (not LE or BE).

If you want the files to be auto-detected by Visual Studio (so that they appear in the main listing in the Add References dialog), you can put them here:
C:\Program Files\Secret Labs\Netduino SDK\Assemblies\v4.1 (32-bit Windows)
C:\Program Files (x86)\Secret Labs\Netduino SDK\Assemblies\v4.1 (64-bit Windows)

Chris

#26 Johnny Five

Johnny Five

    Member

  • Members
  • PipPip
  • 29 posts

Posted 14 September 2010 - 02:59 AM

Not sure if I did something wrong, but after flashing my Netduino does not respond anymore. The power LED doesn't stay on after plugging in the USB cable. Thoughts?

#27 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 September 2010 - 03:03 AM

Not sure if I did something wrong, but after flashing my Netduino does not respond anymore. The power LED doesn't stay on after plugging in the USB cable. Thoughts?


I just replied in your other thread... Let's see if we can get this fixed for you.
http://forums.netdui..._2254#entry2254

#28 Patrick

Patrick

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationTampa

Posted 16 September 2010 - 01:52 PM

Something I noticed that took me a while to work through.

I flashed my netduino with the new firmware, plugged in my Sparkfun MicroSD Shield, jumped D8 to D10 and happily wrote quite a bit of data to the SD card.

I finished my testing of the SD card functionality and wanted to go back to working on another application but once I removed the SD Shield, the netduino was inaccessible. I couldn't ping/erase it from MFDeploy, load a new application, load a new firmware, etc.

I popped the SD Shield back and and voila, all was working fine again.

#29 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 September 2010 - 05:49 PM

Hi Patrick, Great observation, thank you! We'll investigate this further. BTW, I think this is how the .NET MF drivers work by default: if you try mounting an SD card from your Netduino--but with no SD card attached--.NET Micro Framework may sit there and wait forever for the card to mount. To fix this, you can put your Netduino in bootloader mode (hold down the pushbutton while plugging it into your PC) and then ERASE the app via MFDeploy--and then you should be back to normal. Or just erase the app or deploy an app without SD features while the SD shield/card are still attached. But yes, you're right--we should improve the drivers so that they throw an exception rather than waiting forever. We'll be sure to contribute it back to the .NET MF core as well. Chris

#30 Patrick

Patrick

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationTampa

Posted 16 September 2010 - 06:29 PM

To fix this, you can put your Netduino in bootloader mode (hold down the pushbutton while plugging it into your PC) and then ERASE the app via MFDeploy--and then you should be back to normal.


I tried that as well and couldn't get MFDeploy to get a ping response from my netduino.

Or just erase the app or deploy an app without SD features while the SD shield/card are still attached.


In the end, this is what I did.

#31 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 September 2010 - 06:50 PM

I tried that as well and couldn't get MFDeploy to get a ping response from my netduino.


Ooh...very interesting. We'll look into that as well. Thanks for the feedback!

Chris

#32 lynxeyed_atsu

lynxeyed_atsu

    New Member

  • Members
  • Pip
  • 5 posts

Posted 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

#33 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 September 2010 - 04:27 PM

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.


Hi lynxeyed, thank you for the post and for testing out the latest firmware.

Currently, the MountSD() feature currently ignores all parameters except for the PATH varaible. In the first Alpha, it only supports using GPIO_PIN_D10 as the CS pin for the SD card.

Can you try to place a jumper wire between pin D10 and pin D3?

Also, if you need to move back to the standard firmware (while waiting for the chip select feature to be exposed in an updated v4.1.1 release), you can put your Netduino in TinyBooter mode to downgrade the firmware. If you haven't done that before, we can help point you to some instructions for that.

Does this help answer your question?

Chris
  • Sim likes this

#34 Patrick

Patrick

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationTampa

Posted 19 September 2010 - 03:56 AM

I'm in quite the predicament now...

When I plug in my SD shield, the netduino completely powers down.

With the shield off, the netduino will power up and MFDeploy recognizes the netduino but it never gets a response from a ping/erase command and I still can't load it in bootloader mode. So I'm kinda stuck with a non-functioning board. When I hit the onboard button, the blue LED lights up, then turns off after 5 seconds or so.

I tried it on two different machines (7 64 bit / XP 32 bit).

Help! :)
Patrick

EDIT: As soon as I wrote this, I tried jumping D8 to D10 without the shield and I could get it to fire up in bootloader mode. Still don't know why it's shutting down though...

Edited by Patrick, 19 September 2010 - 04:16 AM.


#35 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 September 2010 - 04:50 AM

Patrick, Which pushbutton were you holding down the put the Netduino into bootloader mode? The one on the Netduino--or the "reset" button on the shield? Only the pushbutton on the Netduino can put it into bootloader mode... Chris

#36 Patrick

Patrick

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationTampa

Posted 19 September 2010 - 04:05 PM

Chris, I'm holding the pushbutton on the netduino; no shield at all. The issue seems to be that if I don't have D8 jumped to D10, I can't load in bootloader mode.

#37 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 September 2010 - 04:08 PM

Thanks for the detailed feedback, Patrick.

#38 jaypm

jaypm

    New Member

  • Members
  • Pip
  • 4 posts

Posted 21 September 2010 - 10:06 PM

Works for me using Adafruit SD shield. I ran the sample file-listing code without any issues! Running Windows 7 x32 Thanks!

#39 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 September 2010 - 10:13 PM

Works for me using Adafruit SD shield. I ran the sample file-listing code without any issues!


Hi jaypm,

Fantastic. Thanks for the feedback, and welcome to the Netduino community!

BTW, we're working on a v4.1.1 alpha 2 update--which speeds up SD access substantially. Should be posted within 1-2 weeks.

Chris

#40 jaypm

jaypm

    New Member

  • Members
  • Pip
  • 4 posts

Posted 23 September 2010 - 01:14 AM

Hi jaypm,

Fantastic. Thanks for the feedback, and welcome to the Netduino community!

BTW, we're working on a v4.1.1 alpha 2 update--which speeds up SD access substantially. Should be posted within 1-2 weeks.

Chris


That's great! Thanks Chris.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.