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

Hang during debug with ethernet connected


  • Please log in to reply
21 replies to this topic

#1 Luke

Luke

    Member

  • Members
  • PipPip
  • 18 posts

Posted 10 January 2011 - 10:37 PM

I have a small app for my Netduino Plus that reads the values of a photo detector and a temperature sensor every minute, Debug.Print()s the values, and updates a Pachube feed. The Pachube update is written into a try/catch to keep the code from crashing if there is an issue with network connectivity. If I start debugging this code from VS with the ethernet disconnected, it will run for hours without any error. If ethernet is connected, it will only make it a few minutes before hanging. When it hangs there is no error, etc. Before it hangs, it worked as expected updating Pachube, etc. Basically VS just acts like everything is still working but there is no output from the Netduino Plus. I also have a background thread blinking the onboard LED that stops running. I'm running v4.1.1 ALPHA 5, but it also did this with v4.1.0 (update 6) BETA 1 and v4.1.0 (update 5). I've even tried it with simpler code that has no network functionality and get the same results. Any ideas on what could be going on or how I could debug? Thanks, Luke

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 January 2011 - 04:19 AM

Hi Luke, Are you catching exceptions in your program? Perhaps a network connection attempt is failing and an exception is thrown (and not caught...causing your program to stop)? Do you have a sample which we could use to reproduce the issue? We'd love to dig into it... We're working on a series of networking-related bugfixes for .NET MF right now so this is very timely. Chris

#3 Luke

Luke

    Member

  • Members
  • PipPip
  • 18 posts

Posted 11 January 2011 - 02:19 PM

Hi Luke,

Are you catching exceptions in your program? Perhaps a network connection attempt is failing and an exception is thrown (and not caught...causing your program to stop)?

Do you have a sample which we could use to reproduce the issue? We'd love to dig into it... We're working on a series of networking-related bugfixes for .NET MF right now so this is very timely.

Chris


Chris,

Thanks for the reply. I am catching exceptions in my program when doing anything network related. It works fine without ethernet connected. The exceptions are caught and dumped to the debug output and it will run for hours (let it run for over 16 hours last night).

This morning I created this simple program:

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;

namespace NetduinoPlusSimpleTest
{
    public class Program
    {
        public static void Main()
        {
            OutputPort LED = new OutputPort(Pins.ONBOARD_LED, false);

            while (true)
            {
                Debug.Print(DateTime.Now.ToString());
                LED.Write(!LED.Read());
                Thread.Sleep(1000);
            }
        }
    }
}

This hung with the system time at 2 minutes, 11 seconds when the ethernet was attached. I'll do some more testing to see if the time is always the same. It hasn't stopped yet without ethernet attached and I'm at 5 minutes. I'll let it run today just to be sure that it doesn't crash.

OK, update: I'd been using my ethernet cable from my desktop to test. I just moved it to another cable so that I could write in the forum while it's running and it hasn't stopped yet. My desktop is connected directly to my 2wire AT&T U-verse modem. The other connection is to a Netgear GS108 gigabit switch (which is then connected to the U-verse modem). They are both on the same layer 2 network.

I'll test some more tonight and let you know what I find.

#4 Luke

Luke

    Member

  • Members
  • PipPip
  • 18 posts

Posted 11 January 2011 - 03:17 PM

OK, that doesn't seem to be it, just a weird anomaly. It ran for 5 minutes or so with the simple program on the other switch so I loaded the Pachube app back on and left it running. It seemed that it was going to be ok, but I found later that it died after about 3 or 4 minutes. I've got to head to work and will test some more tonight.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 January 2011 - 03:40 PM

Hi Luke, Very interesting. Are you using Static IP or DHCP? And just to confirm, this is plugged into your Netgear switch? Chris

#6 Luke

Luke

    Member

  • Members
  • PipPip
  • 18 posts

Posted 11 January 2011 - 04:51 PM

Very interesting. Are you using Static IP or DHCP? And just to confirm, this is plugged into your Netgear switch?


I'm using static IP. It's doing this on both switches. At first it seemed that switching to the Netgear fixed the issue, but that wasn't the case.

#7 Luke

Luke

    Member

  • Members
  • PipPip
  • 18 posts

Posted 12 January 2011 - 03:09 PM

I tested some more last night and couldn't get repeatable results with any particular configuration. I did notice when doing a packet capture for something else I'm working on that my U-verse receivers are sending a lot of broadcast packets and ARP requests around. I also know that U-verse extensively uses IGMP v3 so I'm wondering if there isn't something weird about my environment that's causing problems with the IwIP stack. I'll try to isolate the Netduino Plus on a small switch separate from the rest of my network and see if it's stable there. If so, I'll see if I can find a hub to wedge between it and the network so that I can perform a good packet capture of everything that it's seeing. Will keep you posted.

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 12 January 2011 - 07:33 PM

Thanks, Luke. That's good info. Any info you can post is helpful :) Chris

#9 light

light

    Member

  • Members
  • PipPip
  • 13 posts

Posted 12 January 2011 - 10:38 PM

I had a similar issue. I was trying to use some of the networking examples and VS2010 froze during a depolyment. Now it can not detect the NetduinoPlus. I switched over to the deployment tool. When I switch the MFDeploy.exe to "USB" it will list the NetduinoPlus_NetduinoPlus but it will not allow me to do anything with it. If I try to ping it I get "Pinging... Error: No response from device". I also tried the Erase button with the same error. BTW does this erase the program or the firmware? If I deleted the firmware, how can I get it back on? Thanks Ron

#10 darkSol

darkSol

    Member

  • Members
  • PipPip
  • 13 posts

Posted 12 January 2011 - 11:23 PM

As a quick aside - how do you know what firmware you have installed? I just received my second Netduino (regular and now PLUS!) but don't know what's "on them" Is their a program or do you just reflash and use the current version? Thanks!

#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 January 2011 - 02:57 AM

I had a similar issue. I was trying to use some of the networking examples and VS2010 froze during a depolyment. Now it can not detect the NetduinoPlus. I switched over to the deployment tool. When I switch the MFDeploy.exe to "USB" it will list the NetduinoPlus_NetduinoPlus but it will not allow me to do anything with it. If I try to ping it I get "Pinging... Error: No response from device". I also tried the Erase button with the same error. BTW does this erase the program or the firmware? If I deleted the firmware, how can I get it back on?


Hi Ron,

If an app ever locks you out of your Netduino Plus:
1. Unplug your Netduino Plus from your computer and make sure it's powered down.
2. Start up MFDeploy.exe on your computer (Start > Programs > .NET Micro Framework SDK > Tools > MFDeploy.exe)
3. Select USB transport
4. Hold down the pushbutton on your Netduino Plus and plug it into your PC. Keep holding down the button.
5. In MFDeploy, make sure your Netduino Plus appears in the top section next to USB.
6. Press the PING button. You should see a message "Pinging...TinyBooter" or "Pinging...Netduino Plus by Secret Labs"
7. Press the ERASE button. This will erase your Netduino app, and not the .NET MF firmware.
8. Unplug your Netduino Plus. You're good to go.

If you erase the firmware (using the advanced features of MFDeploy), it's available at the top of the respective forum.

Chris

#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 January 2011 - 02:58 AM

As a quick aside - how do you know what firmware you have installed?


Great question. Using MFDeploy (see previous post), select the Target Menu and the "Device Capabilities" menu option. This will show you lots of detail, including the version of Netduino firmware.

You'll use this tool to update the firmware as well.

Chris

#13 light

light

    Member

  • Members
  • PipPip
  • 13 posts

Posted 13 January 2011 - 07:09 AM

Well I guess I really did it... Now it comes up as an unknown device and is not listed in the dropdown in the deployment tool.
-Ron

Hi Ron,

If an app ever locks you out of your Netduino Plus:
1. Unplug your Netduino Plus from your computer and make sure it's powered down.
2. Start up MFDeploy.exe on your computer (Start > Programs > .NET Micro Framework SDK > Tools > MFDeploy.exe)
3. Select USB transport
4. Hold down the pushbutton on your Netduino Plus and plug it into your PC. Keep holding down the button.
5. In MFDeploy, make sure your Netduino Plus appears in the top section next to USB.
6. Press the PING button. You should see a message "Pinging...TinyBooter" or "Pinging...Netduino Plus by Secret Labs"
7. Press the ERASE button. This will erase your Netduino app, and not the .NET MF firmware.
8. Unplug your Netduino Plus. You're good to go.

If you erase the firmware (using the advanced features of MFDeploy), it's available at the top of the respective forum.

Chris



#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 January 2011 - 08:18 AM

Well I guess I really did it... Now it comes up as an unknown device and is not listed in the dropdown in the deployment tool.


Ron,

Did you erase the Netduino Plus using the ERASE pad? Or switch the deployment transport to serial? Or use the UsbClient feature in your code?

Worst case, you can erase your Netduino Plus completely using the ERASE pad and then flash it from scratch (first the bootloader using Atmel SAM-BA on a Windows XP/Vista machine and then the Netduino Plus firmware using MFDeploy).

Either way, let's step through it and get you back up and running here...

Chris

#15 light

light

    Member

  • Members
  • PipPip
  • 13 posts

Posted 13 January 2011 - 08:06 PM

I think I erased the firmware. How can I tell if I erased the boot loader?
Thanks
Ron

Ron,

Did you erase the Netduino Plus using the ERASE pad? Or switch the deployment transport to serial? Or use the UsbClient feature in your code?

Worst case, you can erase your Netduino Plus completely using the ERASE pad and then flash it from scratch (first the bootloader using Atmel SAM-BA on a Windows XP/Vista machine and then the Netduino Plus firmware using MFDeploy).

Either way, let's step through it and get you back up and running here...

Chris



#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 January 2011 - 08:21 PM

I think I erased the firmware. How can I tell if I erased the boot loader?
Thanks
Ron


Please try this:
1. Unplug your Netduino from your computer. Make sure it's powered down. Unplug anything that's plugged into it.
2. Plug your Netduino into your PC using a MicroUSB cable. The white and blue LEDs will turn on.

If the blue LED turns off after ~2.5 seconds, your Netduino is fully programmed.



If the blue LED never turns off, open up MFDeploy on your computer (Start > Programs > .NET Micro Framework SDK > Tools > MFDeploy.exe). Select USB transport.

If your Netduino appears in the pull-down, the bootloader is programmed (and if you press PING, it should respond TinyBooter). If the Netduino does not appears, you've erased the firmware completely.



If you have erased your Netduino Plus completely, grab the 64KB TinyBooter bootloader and flash it using SAM-BA. Then, deploy the Netduino Plus firmware using MFDeploy. You should be back up and running in a few minutes.

I'd be more than happy to pull together the files you need if you'd like.

Chris

#17 light

light

    Member

  • Members
  • PipPip
  • 13 posts

Posted 13 January 2011 - 08:58 PM

The blue light comes on and stays on and the device does not show up under the list of USB devices in MFDeploy.
I will download and install SAM-BA. I would appreciate help finding the files.
Thanks
Ron

Please try this:
1. Unplug your Netduino from your computer. Make sure it's powered down. Unplug anything that's plugged into it.
2. Plug your Netduino into your PC using a MicroUSB cable. The white and blue LEDs will turn on.

If the blue LED turns off after ~2.5 seconds, your Netduino is fully programmed.



If the blue LED never turns off, open up MFDeploy on your computer (Start > Programs > .NET Micro Framework SDK > Tools > MFDeploy.exe). Select USB transport.

If your Netduino appears in the pull-down, the bootloader is programmed (and if you press PING, it should respond TinyBooter). If the Netduino does not appears, you've erased the firmware completely.



If you have erased your Netduino Plus completely, grab the 64KB TinyBooter bootloader and flash it using SAM-BA. Then, deploy the Netduino Plus firmware using MFDeploy. You should be back up and running in a few minutes.

I'd be more than happy to pull together the files you need if you'd like.

Chris



#18 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 January 2011 - 09:53 PM

The blue light comes on and stays on and the device does not show up under the list of USB devices in MFDeploy.

I will download and install SAM-BA. I would appreciate help finding the files.


Here you go.

I'd recommend using the v4.1.0.5 (production) firmware. These zip files contain both the TinyBooter bootloader and the .NET MF firmware files.

Chris

#19 light

light

    Member

  • Members
  • PipPip
  • 13 posts

Posted 13 January 2011 - 10:50 PM

Thank you.
I have now erased the netduino plus via the erase pad by pin D0.
As expected my computer says new device found, but will not automatically find the driver.
Are there two versions of SAM-BA? I see a SAM-BA_CDC.exe and a SAM_BA.exe.
I tried updating the driver to the atm6124_cdc.inf that the Readme_CDC.txt refers to, but
windos just says no driver found or invalid driver. As a result I can not select the port
when running SAM-BA.
Thanks
Ron

Here you go.

I'd recommend using the v4.1.0.5 (production) firmware. These zip files contain both the TinyBooter bootloader and the .NET MF firmware files.

Chris



#20 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 January 2011 - 12:11 AM

light, Be sure to use SAM-BA v2.09 ("AT91 tools v1.13"). If you're running Windows 7 64-bit, you'll want to run it under Windows XP Mode. SAM-BA is really meant for production more than everyday use, but it's a good tool once you get it working. 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.