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

SD Card With 4.2 firmware not working


  • Please log in to reply
8 replies to this topic

#1 Bainesbunch

Bainesbunch

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts
  • LocationFrance

Posted 14 January 2012 - 01:15 PM

Hello Folks,

I seem unable to get my SD card reading using VB or C# with the 4.2 firmware on a Netuino Plus. I have tried a variety of cards all 2 GIG and formatted in FAT 16 or 32. Nothing seem to work. Here is the code i used it is a c# conversion to vb from an example on the forums here. I have also compiled the original example in c# and that gives the same error


Firstly the call to "GetDirectories" returns no directories and then the call to "GetFiles("\SD")" causes the following error

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





        Dim directories As String() = System.IO.Directory.GetDirectories("\")
        Debug.Print("directory count: " + directories.Length.ToString())

        For i As Integer = 0 To directories.Length - 1
            Debug.Print("directory: " + directories(i))
        Next

        Dim files As String() = System.IO.Directory.GetFiles("\SD")
        Debug.Print("file count: " + files.Length.ToString())

        For i As Integer = 0 To files.Length - 1
            Debug.Print("filename: " + files(i))
            Dim fs As New FileStream(files(i), FileMode.Open, FileAccess.Read, FileShare.None, 512)
            Dim sr As New StreamReader(fs)
            Debug.Print("contents: " + sr.ReadToEnd())
        Next



Am I just being plain stupid or is there a problem, if it is the former then can someone please correct my errors and post me a solution.

Cheers Pete
I was going to change the world, then I discovered Netduino.
The world will have to wait.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 January 2012 - 02:45 PM

Hi Bainesbunch, If you're not seeing any directories (including no '\SD'), that means that your SD card is not mounting. Did this work with the v4.1.1 beta release? It may be an issue with the SD cards, with your board, or with the firmware. Let's narrow it down. [We do test SD on every board that ships...but perhaps it was damaged in shipping.] Chris

#3 Bainesbunch

Bainesbunch

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts
  • LocationFrance

Posted 15 January 2012 - 07:31 PM

Hi Bainesbunch,

If you're not seeing any directories (including no '\SD'), that means that your SD card is not mounting.

Did this work with the v4.1.1 beta release? It may be an issue with the SD cards, with your board, or with the firmware. Let's narrow it down.

[We do test SD on every board that ships...but perhaps it was damaged in shipping.]

Chris




Hi Chris,

I have never tried it using the 4.1 firmware, vb is not supported ;). I can get a root folder of '\SD' from it but it will not give me a file list.

if you want to post me a bit of diagonstic code i am happy to load it up and run it to test for the error. C# or VB either is OK.


Whilst i have you attention, I am also trying the find the namespace for the "onewire" class. Where is it hiding in 4.2 ?

Cheers Pete.
I was going to change the world, then I discovered Netduino.
The world will have to wait.

#4 Bainesbunch

Bainesbunch

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts
  • LocationFrance

Posted 16 January 2012 - 11:27 AM

Hi Chris,

I have never tried it using the 4.1 firmware, vb is not supported ;). I can get a root folder of '\SD' from it but it will not give me a file list.

if you want to post me a bit of diagonstic code i am happy to load it up and run it to test for the error. C# or VB either is OK.


Whilst i have you attention, I am also trying the find the namespace for the "onewire" class. Where is it hiding in 4.2 ?

Cheers Pete.



PROBLEM SOLVED


OK so you know how sometimes in life you do really stupid things ..... well I am so embarrassed to have to report that this is one of them.

I have several developments going on with the netduinos at the moment and all of them except 1 are netduinos, the last is a netduino plus. I have been re-flashing them to the latest firmware and ... yeah you guesed it I flashed the plain netduino firmware onto the netduino plus.

Having worked out my stupid mistake I thought I would share my embarrassment with the community as a cautionary tale for all others.

The SAMBA tool and the MF Loader tool both remember your last file location and also the firmware is called the same for both the normal and plus versions of the netduino .... well you can work out the rest.


But .... Chris if you or anyone else is still following this thread after my confession of stupidity I still need to know the DLLs and namespaces for the onewire class.


Cheers Pete.
I was going to change the world, then I discovered Netduino.
The world will have to wait.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 January 2012 - 01:29 PM

Hi Pete,

But .... Chris if you or anyone else is still following this thread after my confession of stupidity I still need to know the DLLs and namespaces for the onewire class.

Glad you got that sorted out :)

There is no OneWire support in the .NET MF 4.2 beta firmware (it's too big), but once the firmware goes to RTM we'll work with CW2 to incorporate his OneWire extensions into it...

Chris

#6 Bainesbunch

Bainesbunch

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts
  • LocationFrance

Posted 16 January 2012 - 01:42 PM

Hi Pete,

Glad you got that sorted out :)

There is no OneWire support in the .NET MF 4.2 beta firmware (it's too big), but once the firmware goes to RTM we'll work with CW2 to incorporate his OneWire extensions into it...

Chris



Hi Chris,

well that explains why I can’t find it :)

Can you then please point me to CW2's libs so I can use them until they get implemented into the release.


Following on from my Netduino plus issues. I am having a lot of problems getting the software deployed onto the device and even more problems actually getting into debug mode. Almost every time I "run" the application from the IDE my VB 2010 Express crashes. When is does not crash it hangs about for a long time and then tells me it cannot communicate to the device, finally it sometimes just sits there saying it is rebooting... this does not happen with my other Netduinos (non Plus).


Cheers Pete
I was going to change the world, then I discovered Netduino.
The world will have to wait.

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 January 2012 - 01:47 PM

Hi Pete, The OneWire feature needs to be compiled into the firware because it has a native code component which lives deep in the hardware layer. For the VB crash...can you post a bug report for that on netmf.codeplex.com? We can also ping someone on the VB team and see if they have any ideas... That's no fun at all! Chris

#8 Bainesbunch

Bainesbunch

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts
  • LocationFrance

Posted 16 January 2012 - 02:07 PM

Hi Pete,

The OneWire feature needs to be compiled into the firware because it has a native code component which lives deep in the hardware layer.

For the VB crash...can you post a bug report for that on netmf.codeplex.com? We can also ping someone on the VB team and see if they have any ideas... That's no fun at all!

Chris



Hi Chris,

OK will do thanks.

For now until I can get this sorted I will have to roll back to Netduino non plus and add an external SD reader. I don’t have the time to faf about with it. I have deadlines to meet.

The USB driver is the same for both plus and no plus boards right ?

Do we have any ETA for the next revision of the firmware including the onewire stuff.

Cheers Pete
I was going to change the world, then I discovered Netduino.
The world will have to wait.

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 January 2012 - 03:52 PM

Hi Pete, Next beta update is coming soon. We are hoping that bugfixes checked into netmf.codeplex.com recently will take care of quite a few issues... 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.