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


  • Please log in to reply
31 replies to this topic

#21 shum

shum

    New Member

  • Members
  • Pip
  • 2 posts

Posted 19 August 2011 - 08:25 PM

Soon I'll lose all my hair

+1 :rolleyes:


An unhandled exception of type 'System.IO.IOException' occurred in SecretLabs.NETMF.IO.dll

public class Program
    {
        public static void Main()
        {
            StorageDevice.MountSD("SD", SPI_Devices.SPI1, Pins.GPIO_PIN_D10);
        } 
...

Pins seems to be plugged right.

DeviceInfo:
  HAL build info: 4.1.2821.0, Netduino (v4.1.1.0 b1) by Secret Labs LLC
  OEM Product codes (vendor, model, SKU): 34, 177, 4096
  Serial Numbers (module, system):
    00000000000000000000000000000000
    0000000000000000
  Solution Build Info: 4.1.1.0, Netduino (v4.1.1.0 b1) by Secret Labs LLC
  AppDomains:
    default, id=1
  Assemblies:
    mscorlib,4.1.2821.0
    Microsoft.SPOT.Native,4.1.2821.0
    Microsoft.SPOT.Hardware,4.1.2821.0
    Microsoft.SPOT.Hardware.SerialPort,4.1.2821.0
    Microsoft.SPOT.IO,4.1.2821.0
    System.IO,4.1.2821.0
    Microsoft.SPOT.Hardware.Usb,4.1.2821.0
    SecretLabs.NETMF.Hardware,4.1.0.0
    SecretLabs.NETMF.Diagnostics,4.1.0.0
    SecretLabs.NETMF.IO,4.1.0.0
    SecretLabs.NETMF.Hardware.Netduino,4.1.0.0
    NetduinoApplication1,1.0.0.0

SD Card PQI, 256MB, FAT32
Sparkfun Breakout SD Board.

#22 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 August 2011 - 08:38 PM

Hi shum, Do you have any other MicroSD cards you can try? Welcome to the Netduino community, Chris

#23 shum

shum

    New Member

  • Members
  • Pip
  • 2 posts

Posted 19 August 2011 - 08:57 PM

oops, sorry - i have Netduino (Not Plus). Could you please, move the post to the related topic in Netduino forum. Thanks!

#24 Laurelle

Laurelle

    Member

  • Members
  • PipPip
  • 16 posts
  • LocationFrance

Posted 14 September 2011 - 03:57 PM

I had similar problems with a SD car (2G Sandisk) not detected when plugged into the board before powering it up thru USB.
When trying to do
OutputPort SdPower = new OutputPort((Cpu.Pin)25, false); // ensure that the SD card is powered
InputPort sdDetected = new InputPort((Cpu.Pin)57, false, Port.ResistorMode.PullUp);
Debug.Print("sd detected: " + (!sdDetected.Read()).ToString());
sdDetected.Dispose();

Debug.Print("Current directory (before): " + Directory.GetCurrentDirectory());
try
{
                Directory.SetCurrentDirectory("\\SD");
}
catch
{
                Debug.Print("Exception occurred while calling SetCurrentDirectory");
}
Debug.Print("Current directory (after): " + Directory.GetCurrentDirectory());
I get the following error:
sd detected: True
Current directory (before): \
A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.SPOT.IO.dll
A first chance exception of type 'System.IO.IOException' occurred in System.IO.dll
Exception occurred while calling SetCurrentDirectory
Current directory (after): \

Now When I force in my code a soft reset using
PowerState.RebootDevice(false);
I get the following:
sd detected: True
Current directory (before): \
Current directory (after): \SD

So it looks like there is a problem after a cold boot to detect the card but not after a soft boot.
PS: I'm using the 4.2 framework beta version
Doing dev is like doing sport. It's healthy :-)

#25 CarTech

CarTech

    New Member

  • Members
  • Pip
  • 9 posts

Posted 14 April 2012 - 03:41 PM

I'm using 4.2 RC4 and I can't get the sparkfun 1GB card to work. I have the netduino firmware loaded onto a netduino plus. A 2GB sandisk card works perfectly. With the sparkfun card, I can't get it to mount (doesn't return "\SD" when I search for directories on "\"). Any suggestions for what I should try?

#26 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 April 2012 - 09:11 PM

Hi CarTech,

I'm using 4.2 RC4 and I can't get the sparkfun 1GB card to work. I have the netduino firmware loaded onto a netduino plus. A 2GB sandisk card works perfectly. With the sparkfun card, I can't get it to mount (doesn't return "\SD" when I search for directories on "\").

Any suggestions for what I should try?

Can you try formatting the card using Windows really quick? If that doesn't work, there's also an official SD card formatter here: https://www.sdcard.o...ds/formatter_3/

I've had more luck with the Windows formatter...but technically the official SD Card Formatter should always work.

Chris

#27 Codiak

Codiak

    New Member

  • Members
  • Pip
  • 3 posts

Posted 24 June 2012 - 03:26 PM

I recently moved to v4.2 with my Netduino Plus. I migrated my application and had it working for the past couple days. Last night after ejecting and reinserting my SD card, the application fails constantly with "first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll" Testing pin 57 returns false every call. Is this a SD slot failure? UPDATE: I've reverted to 4.1 and the application still the SD card still fails. Card is readable on multiple other machines and has been working in the N+ for 6 weeks.

#28 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 June 2012 - 10:34 PM

Hi Codiak,

UPDATE: I've reverted to 4.1 and the application still the SD card still fails.
Card is readable on multiple other machines and has been working in the N+ for 6 weeks.

Do you have another SD card that you could try? It seems very odd that you'd have a hardware failure at the same time you updated your firmware.

Also...do you see the folder "\SD" in your directories when the card is inserted? If you run the regular Netduino firmware on your board and manually mount...do you see the folder/files then?

Chris

#29 Codiak

Codiak

    New Member

  • Members
  • Pip
  • 3 posts

Posted 25 June 2012 - 04:12 AM

Hi Codiak,


Do you have another SD card that you could try? It seems very odd that you'd have a hardware failure at the same time you updated your firmware.

Also...do you see the folder "\SD" in your directories when the card is inserted? If you run the regular Netduino firmware on your board and manually mount...do you see the folder/files then?

Chris


Hi Chris,

I've got another 2g card on order to try later I the week. I tend to agree and just think whatever happened is coincidence. 4.2 was running fine and I had 24 hour of logs from a burnin test, it was only after I swapped the card in a out a couple times that things stopped working.

As the the "\SD" directory, no it is not present when the card is inserted. It was a directory.setcurrent request that started failing.

I haven't tried the regular netduino firmware, will give it a test tomorrow.

Thanks for the follow up

Codiak

#30 philippej

philippej

    New Member

  • Members
  • Pip
  • 1 posts

Posted 28 June 2012 - 06:06 PM

Hello, I'm new with a NetDuino, i update it with the last firmware 4.2 : ok afraid few minutes but ok Like i discover visual c# and the world of .NET and NetDuino... lot of thing to learn and long time just to try shield... Two questions : I use a Sparkfun CAN-Bus Shield. After two days : ok the CAN work After 4 days : matter to use the SD Card... Today, i re re read posts and see 'perhaps i have to add the system.io.dll.. Visual C# say : i can copy .../le/system.io.xxx... .../be/system.io.xxx : ok i create and copy files -> have i a other solution or a window where i can add a path ? Now : Yes i can read one SD (2Go) No i can not read one SDHC (4go) Like first i use a prototype with a Arduino, i try to do the same thing with the old arduino : he can read SDHC 4go... Hummmm... In a next firmware/update perhaps... Oh, i'm checking one thing during i write this post. Format the SDHC 4go in FAT (actual format was FAT32) => Now, i can read the SDhc 4go but error when i try to open a file (strange name) 6 files and i have only one in the SD ? and my last question : this card has also a serial LCD port but use a binary D6 : is it possible to use a serialport with a D6 (Tx only i think) i don't test the EM-486 port because i don't need it (for a GPS) i have to try now if the CAN and the SD can work together Many thanks for your help and sorry for my poor english Philippe

#31 Dano142

Dano142

    New Member

  • Members
  • Pip
  • 3 posts

Posted 30 June 2012 - 02:33 AM

So I have a SanDisk 4GB card running 4.2FW. I get the \SD folder to list...but no sub folders. Its formatted as FAT16. --Dan

#32 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 30 June 2012 - 07:21 AM

Hi Dano142, The 4.2 firmware has no SDHC support yet. So >2GB cards will not work properly.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs




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.