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 2


  • Please log in to reply
12 replies to this topic

#1 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 September 2010 - 12:51 AM

Version: 4.1.1 ALPHA 2 (version 4.1.1.0 a2)

WARNING: This firmware is pre-release firmware. It may temporarily cause your Netduino to cease functioning properly. If this firmware does not work for you, you will likely need to erase your Netduino completely and re-flash the production v4.1.0.3 bootloader using Atmel SAM-BA tools (on a 32-bit Windows installation) and the production v4.1.0.3 firmware using MFDeploy.

With that warning out of the way, we've added the first new feature to the Netduino: SD card and FAT16/FAT32 file system support. We have also added some debugger enhancements to help with debugger reconnections during deployment.

If you're an early adopter and would like to help us test and refine this new feature, this alpha release may be for you.

This firmware includes the following updates:
1. Exception thrown when mounting incompatible/non-existent SD card
2. Reduced memory usage for SD card access
3. Faster mounting and communication with SD cards
4. Garbage collection 'status messages' updated

This firmware also includes the following previous updates:
1. SD card support using SPI
2. Visual Studio debugger should connect to Netduino easier during deployment (on non-virtual machines)

You may update to this pre-release firmware using the MFDeploy tool:
1. Download and unzip the attached file to a directory on your computer.
2. Go to the Start Menu > Programs > Microsoft .NET Micro Framework 4.1 > Tools
3. Run MFDeploy.exe. Be careful to run MFDeploy.exe and not MFDeploy.exe.config (as file extensions are hidden by default)
4. Plug your Netduino into your PC using a Micro USB cable. If your Netduino does not connect successfully, try plugging the USB cable into your Netduino first...and then your PC.
5. In the Device section at top, select USB instead of Serial. Your Netduino should appear in the drop-down; if not, select it.
6. Click "Browse..." and select the unzipped files from step #1 (ER_CONFIG and ER_FLASH).
7. Press "Deploy". It will take a few minutes to update your Netduino.

ASSEMBLY NOTE: You will need to manually add the SecretLabs.NETMF.IO assembly as a reference in your project to use the SD feature. You will also need to add the System.IO assembly.

Please let us know if this:
[a] works with your SD card
[b] reduces/eliminates any "could not reboot Netduino" messages in Visual Studio
[c] causes any other errors

Also, please note that some VMs may lose their connection to the Netduino when it reboots. If your VM loses its connection to the Netduino during deployment, it will give you an error that the debugger failed to connect. If this happens to you, please let us know in this thread.

Chris

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 September 2010 - 12:52 AM

Notes on this release: This release includes support for SD cards and System.IO filesystem support. It includes two new functions in the new SecretLabs.NETMF.IO namespace: StorageDevice.MountSD(...); StorageDevice.Unmount(...); The Unmount() feature is fully implemented. The MountSD() feature currently ignores all parameters except for the PATH varaible. In an upcoming release, we'll be enabling more of the MountSD() function's features. Chris

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 September 2010 - 01:00 AM

This firmware update should clear up most SD card-related issues experienced with Alpha 1. If you experience errors (lockups, invalid exceptions, or other errors), please share your experience here. We will address bug reports on this thread. Thank you, Chris

#4 bxb

bxb

    New Member

  • Members
  • Pip
  • 6 posts

Posted 30 September 2010 - 06:27 PM

This firmware update should clear up most SD card-related issues experienced with Alpha 1.


Hi,

I already tried A1 and could never connect the debugger so I had high hopes for A2.
But alas, same with A2. I can deploy my project and I can proof that it is running via blinking led,
but VS writes after the deployment 'The debugging target is not in a initialized state; rebooting...'
I can then see that the project starts, but VS can't connect to the Netduino again.
Now when I stop VS trying to connect, power off the Netduino and repower it, the device connects to the debbuger and even my breakpoints catch.

Any idea how to fix this behavior?

#5 Caffeine

Caffeine

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationSydney, Australia

Posted 30 September 2010 - 10:52 PM

Works very well with the sparkfun microSD shield (again with D10 and D8 jumpered together for the card detect) and a nokia branded 128MB microSD card.

The exception handling with no card inserted is nice too.

As above, I have to manually unplug and plug in the netduino when it comes up with the 'The debugging target is not in a initialized state; rebooting...' statement.

Code:

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using System.IO;
using SecretLabs.NETMF.IO;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace SDTest
{
    public class Program
    {
        static OutputPort LED = new OutputPort(Pins.ONBOARD_LED, false);
        static bool LEDstate = false;
        static bool mounted = false;
        public static void Main()
        {
            try
            {
                StorageDevice.MountSD("SD1", SPI_Devices.SPI1, Pins.GPIO_PIN_D10);
                mounted = true;
            }
            catch (Exception Ex)
            {
                // Just trying out the exception handling
                Debug.Print(Ex.ToString());
            }

            while (mounted)
            {
                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]);
                    if (files[i] == @"\SD1\HiLiam.txt")
                    {
                        FileStream fs = new FileStream(files[i], FileMode.Open, FileAccess.Read, FileShare.None, 512);
                        StreamReader sr = new StreamReader(fs);
                        Debug.Print("contents: " + sr.ReadToEnd());
                        fs.Close();

                    }
                }
                string path = Path.Combine(@"\SD1", "HiLiam.txt");
                string content = "Got it working :)";
                byte[] bytes = System.Text.Encoding.UTF8.GetBytes(content);
                File.WriteAllBytes(path, bytes);
                Thread.Sleep(1000);
            }
        }
    }
}

Output:

directory count: 1
directory: \SD1
file count: 26
filename: \SD1\Always here.aac
filename: \SD1\rm217_conpack_conf.cnfp
filename: \SD1\SD Content Package sd_apac_tuw
filename: \SD1\HiDermot.txt
filename: \SD1\HiLiam.txt
contents: Got it working :)
filename: \SD1\Ralph.mp3
filename: \SD1\spiderpig.mp3
filename: \SD1\Belly dance.aac
filename: \SD1\Com você.aac
filename: \SD1\Cycle.aac
filename: \SD1\Electronic.aac
filename: \SD1\Glow.aac
filename: \SD1\Nuance.aac
filename: \SD1\Peal.aac
filename: \SD1\Pick it up.aac
filename: \SD1\Polaris.aac
filename: \SD1\Roadster.aac
filename: \SD1\Rock.aac
filename: \SD1\Sunset.aac
filename: \SD1\Tinkly.aac
filename: \SD1\Image004.jpg
filename: \SD1\Alma_Bay_Mel_Paddling.jpg
filename: \SD1\Image005.jpg
filename: \SD1\Image006.jpg
filename: \SD1\Cleat.gif
filename: \SD1\Image003a.jpg


#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 September 2010 - 10:53 PM

Hi bxb, Can you write up what you're doing in detail and PM it to me (or post it here)? Preferably with screenshots? If we can reproduce it, we can try to tackle it :) Also, what version of Windows are you running--and are you running it in Virtual Machine software? Chris

#7 bxb

bxb

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 October 2010 - 06:37 PM

Hi bxb,

Can you write up what you're doing in detail and PM it to me (or post it here)? Preferably with screenshots? If we can reproduce it, we can try to tackle it :)

Also, what version of Windows are you running--and are you running it in Virtual Machine software?

Chris


Hi Chris,

sorry for the delay but I was on a business trip, so no time for netduino :-(
Meanwhile I can surely say this is an issue with FW 4.1.x. I tried the OneWire Alpha FW by CW2 and the P4 of 4.0.1 and both worked absolutely flawless. I just flashed the A2 of 4.1.x and at once had the same behavior. So to answer your questions:

I'm running on WinXP SP4, VS2010 no VM, Lenovo T61 Notebook. It's a dead simple Project, just reading the directory of the card and printing the filenames via Debug.Print. The shield I use is the datalogger shield from Nuelectronics Link. BTW I can reproduce the behavior with MFDeploy, after erasing my application, MFDeploy also wants to reset the netduino and i also fails to reconnect, so for me the whole issue seems to be, that the netduino does not reset, but keeps hanging somewhere.

Any more info I can provide?

BTW thanks for the great product!

bye, sascha

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 12 October 2010 - 02:15 AM

Hmm, interesting. If you could please post a zip file with your project, we can try to reproduce here... Thanks bxb! Chris

#9 bxb

bxb

    New Member

  • Members
  • Pip
  • 6 posts

Posted 14 October 2010 - 01:13 PM

Hmm, interesting. If you could please post a zip file with your project, we can try to reproduce here...

Thanks bxb!

Chris


Here you go!

bye, sascha

Attached Files



#10 Stephen_P

Stephen_P

    New Member

  • Members
  • Pip
  • 7 posts

Posted 02 November 2010 - 03:22 PM

Notes on this release:

This release includes support for SD cards and System.IO filesystem support.

It includes two new functions in the new SecretLabs.NETMF.IO namespace:
StorageDevice.MountSD(...);
StorageDevice.Unmount(...);

The Unmount() feature is fully implemented. The MountSD() feature currently ignores all parameters except for the PATH varaible. In an upcoming release, we'll be enabling more of the MountSD() function's features.

Chris


Hello Chris

I'm trying to use the SD card in the Arduino ETHShield board, see my earlier post at...
http://forums.netdui...write-problems/

Just reading above now I see you say the MountSD() parameters are not yet implemented. I guess this means the chip select isn't working either? (Always defaults to D10 regardless?) I would try jumping D10 to D4 to select my SD card correctly but the W5100 is already on D10.
So, are my assumptions correct? If so any work round or update due.

Many thanks

Stephen

#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 02 November 2010 - 06:44 PM

Hi Stephen, We will have an update later in November which will enable the chip select. If you need a special build which uses pin D4 for SD chip select, we could make one and post it here in the meantime to get you started... Chris

#12 Stephen_P

Stephen_P

    New Member

  • Members
  • Pip
  • 7 posts

Posted 02 November 2010 - 07:41 PM

Hi Stephen,

We will have an update later in November which will enable the chip select. If you need a special build which uses pin D4 for SD chip select, we could make one and post it here in the meantime to get you started...

Chris


Hello Chris

Thank you for you rapid response.
Note: I'm confusing the issue by having two threads open on the same topic so I'll suggest we just follow this one.

I would love a special build now but to be honest can't claim it is really urgent so I'll let you decide. I guess there might be a few other people using the same card as me so it possible others would benefit as well?

In fact I think I can cut the tracks on the SD/Ethernet card and swap the chip select lines. That should get me going in the mean time and prove where the problem lies. Given this is still development and you plan to update the firmware quite soon I think that is a solution.

Thanks
Stephen

Update. I did swap the CS lines round. I couldn't get the W5100 chip to work on D4 though, suspect some issue with hidden track on the board but it did work on D5. SD Card can now read and write using CS on D10.

Thanks again.

#13 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 November 2010 - 04:05 AM

But alas, same with A2. I can deploy my project and I can proof that it is running via blinking led,
but VS writes after the deployment 'The debugging target is not in a initialized state; rebooting...'


Hi bxb,

Can you try "alpha 3" and let me know if we've fixed the issue now?
http://forums.netdui...e-v411-alpha-3/

If not, is the issue fixed with v4.1.0.6 beta 1?

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.