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

ShieldBase Power Bug?

Go ShieldBase Bug?

  • Please log in to reply
19 replies to this topic

#1 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 19 January 2013 - 08:42 PM

I think I may have come across a bug when using the ShieldBase in a project.

 

Start a new VS project using the new 4.2.2 SDK on a Go! and ShieldBase running the latest versions of NETMF and ShieldBase update 5.  Connect the ShieldBase to socket 5.  Now I am using the Komodex module (I'm sure Chris has one :)) to show that there is some activity.  My application looks like this:

 

using System.Threading;
using Komodex.NETMF;
using NetduinoGo;namespace ShieldbaseBug
{
    public class Program
    {
	    public static void Main()
	    {
		    ShieldBase sb = new ShieldBase((GoBus.GoSocket) 5);
		    SevenSegmentDisplay display = new SevenSegmentDisplay();
		    while (true)
		    {
			    for (int counter = 0; counter < 9999; counter++)
			    {
				    display.SetValue(counter);
				    Thread.Sleep(200);
			    }
		    }
	    }
    }
}

 

Deploy the application to the Go! and you should see the module start counting.  Now stop the debugger and the app should keep on counting.  Unplug the Go! and then plug it back in to the PC.  Wait a while and nothing happens.  The app does not start running.

 

Now comment out the declaration of sb and repeat.  The app starts counting in both cases.

 

Bug or am I missing something?

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#2 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 19 January 2013 - 09:39 PM

Hi Mark,

 

I see the same behaviour with mine even when I define the port for the Seven Segment Display module. I have also tested it with the RGBLed module and the same happens with it. 

 

It also takes a bit after the Shield Base enumerates before any other modules enumerates. I wonder if it has to do with the auto-detection code for the Shield Base. 

 

Steve



#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 January 2013 - 09:39 PM

Hi Mark, That should work. When you plug back in your Netduino Go, does the app start? Does it get stuck on the Shield Base constructor? If you put a Debug.Print statement in the code right before the Shield Base constructor--and then unplug/re-attach the board while you're connected in MFDeploy--you can press PING to see the boot up sequence after plugging it back in. Chris

#4 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 20 January 2013 - 02:55 PM

That should work. When you plug back in your Netduino Go, does the app start? Does it get stuck on the Shield Base constructor? If you put a Debug.Print statement in the code right before the Shield Base constructor--and then unplug/re-attach the board while you're connected in MFDeploy--you can press PING to see the boot up sequence after plugging it back in.

I think I have followed your instructions correctly I get a message from MFDeploy that there is an uncaught exception.

 

BTW, the blue light on the ShieldBase socket is turned on.

 

Also, if you swap the construction order so the SevenSegmentDisplay is constructed first and the ShieldBase second then the app runs fine on power on.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#5 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 20 January 2013 - 05:43 PM

Mark, I got the same in my MFDeploy window. At first I thought I was doing incorrectly. But the Uncaught Exception would only show if I Connected (F5) to the Netduino Go as it was booting up. 

 

Steve



#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 January 2013 - 06:12 PM

Hi Mark,
I think I have followed your instructions correctly I get a message from MFDeploy that there is an uncaught exception.
If you use the pre-beta "auto-detect" feature on Shield Base, and the shield base is on GoPort 5/6/7/8, you'll get a first-chance exception while the Shield Base is being located. If you're getting an uncaught exception, or not using auto-detect with the Shield Base, I would really appreciate a short repro and info so we can investigate further. Thank you, Chris

#7 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 20 January 2013 - 07:24 PM

Chris,

 

If by "auto detect" you mean not specifying the port in the ShieldBase constructor then I'm not doing that.  I'm using the code in the first post in this thread.

 

In order to reproduce the uncaught exception I did the following:

  • Create a new Go! project using the code in the first post.  Add a Debug.Print before the ShieldBase constructor as you requested.  Deploy the application using VS.  The application will start running.
  • Disconnect VS by stopping the debugging.  The application continues to run.
  • Start MFDeploy and ping the board.  I get a TinyCLR response in MFDeploy.
  • Unplug the board wait a second or two and plug it back into the PC.
  • When the board shows up in MFDeploy hit Ping.  This generates the exception message.

Let me know if you need more information or if I have misunderstood your request from last night regarding steps to generate additional information.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 January 2013 - 08:04 PM

Hi Mark, We'll pull this into the lab and see if we can reproduce it. Thank you. Chris

#9 Denisetoo

Denisetoo

    Member

  • Members
  • PipPip
  • 22 posts

Posted 20 January 2013 - 08:50 PM

Why does the follow code work above

 

 

ShieldBase sb = new ShieldBase((GoBus.GoSocket) 5);

 

yet I must use :

 

NetduinoGo.ShieldBase sb = new NetduinoGo.ShieldBase((GoBus.GoSocket)5);

 

in order to not get an error?



#10 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 20 January 2013 - 09:18 PM

I put the following line at top of the file:

 

using NetduinoGo;

 

That makes the objects defined in the NetduinoGo namespace available without the need to prefix them with NetduinoGo.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#11 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 23 January 2013 - 02:23 PM

I think I may have come across a bug when using the ShieldBase in a project.

 

Start a new VS project using the new 4.2.2 SDK on a Go! and ShieldBase running the latest versions of NETMF and ShieldBase update 5.  Connect the ShieldBase to socket 5.  Now I am using the Komodex module (I'm sure Chris has one :)) to show that there is some activity.  My application looks like this:

 

 

using System.Threading;using Komodex.NETMF;using NetduinoGo;namespace ShieldbaseBug{    public class Program    {	    public static void Main()	    {		    ShieldBase sb = new ShieldBase((GoBus.GoSocket) 5);		    SevenSegmentDisplay display = new SevenSegmentDisplay();		    while (true)		    {			    for (int counter = 0; counter < 9999; counter++)			    {				    display.SetValue(counter);				    Thread.Sleep(200);			    }		    }	    }    }}

 

 

Deploy the application to the Go! and you should see the module start counting.  Now stop the debugger and the app should keep on counting.  Unplug the Go! and then plug it back in to the PC.  Wait a while and nothing happens.  The app does not start running.

 

Now comment out the declaration of sb and repeat.  The app starts counting in both cases.

 

Bug or am I missing something?

 

Regards,

Mark

 

 

I had same problem when unplug the NGo! and then plug it back in to the NGO. :angry:



#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 23 January 2013 - 02:39 PM

Hi supra, We're looking into this for you. We will try to repro it here in a few days. Chris

#13 JacobFriis

JacobFriis

    New Member

  • Members
  • Pip
  • 2 posts

Posted 13 February 2013 - 09:11 PM

Hey guys

 

Having the exact same problem here  :angry:

 

ShieldBase on Socket8, utilizing only COM1 on Shield.

Netduino Go Firmware: 4.2.2 Update 1

Shield Base Firmware: Beta 6  

Works perfectly fine when connected to Visual Studio, but faults when powered up afterwards.

 

Looking forward to any news on this :) I have posted a stacktrace below, if this can be any useful for the process.  :)

 

Best regards



#14 JacobFriis

JacobFriis

    New Member

  • Members
  • Pip
  • 2 posts

Posted 13 February 2013 - 09:12 PM

Gosh, I forgot the StackTrace  :huh:

 

 

[22:01:24 13-02-2013] Before ctor (ShieldBase)
[22:01:28 13-02-2013] Exception was thrown: System.Exception
[22:01:28 13-02-2013] GoBus.GoBusSerialTransport::ResetSlave
[22:01:28 13-02-2013] GoBus.GoBusSerialTransport::.ctor
[22:01:28 13-02-2013] NetduinoGo.ShieldBase::Initialize
[22:01:28 13-02-2013] NetduinoGo.ShieldBase::.ctor
[22:01:28 13-02-2013] OneP.HomeAutomation.Netduino.Probe.Program::Main
[22:01:28 13-02-2013] 
[22:01:28 13-02-2013]  Uncaught exception 


#15 Andy J

Andy J

    New Member

  • Members
  • Pip
  • 5 posts

Posted 10 March 2013 - 09:27 PM

This may be an initialization timing issue.  I encountered this problem even after updating GO/SB firmware.  Adding a one second delay as the very first line of code resolved it for me.

 

public static void Main()        {            System.Threading.Thread.Sleep(1000);            NetduinoGo.ShieldBase sb =  new NetduinoGo.ShieldBase(GoSockets.Socket2);


#16 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 20 March 2013 - 02:38 PM

Have the same issue, cry :(



#17 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 20 March 2013 - 05:22 PM

Chris If you can not reproduce it in lab, I work in NY I could bring mine for investigation



#18 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 20 March 2013 - 10:40 PM

Solved by
 
Thread.Sleep(1000);
NetduinoGo.ShieldBase sb = new NetduinoGo.ShieldBase((GoBus.GoSocket)4);
 
Something wrong with all SB concept in new FW, I have also delay related problems with stepper and sonar range sensor 


#19 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 March 2013 - 01:45 AM

Hmm, interesting. It sounds like the Shield Base is having troubles transitioning between enumeration and GoBus communication in this circumstance. We haven't been able to reproduce this here, but I'll see what we can do to eliminate the delay workaround. We should definitely be able to fix this in a firmware update. At first glance it sounds like the board is still booting during enumeration and we might be rebooting it before it gets a chance to start. eplaksienko--I might take you up regarding taking a look on your hardware. Chris

#20 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 21 March 2013 - 02:01 AM

I could get to you Monday or Tuesday

 

Actually 1 sec Sleep is not enough, 3 sec is sure number






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.