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

Chris I figured out that error causing bug! Not good for me though


  • Please log in to reply
23 replies to this topic

#1 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 24 August 2010 - 09:09 PM

Alright plain and simple: old error: Ye old "Device not connected" or freezing VS. old fix: Unplug USB, or restart PC **Magic all fixed! new error: "An error has occurred: Please check your hardware" new fix? yeah right! <_< cause?? Sure try to avoid this: While you are in debug mode and have your device running an infinite loop. DO NOT stop debug via VS, just make a way to exit the infinite loop via your device. When VS tries to redeploy your code if the device is running the previous code, good luck! So I think VS and the netduino don't get along when the netduino is busy. EDIT: It won't happed all the times! Its like a bad surprise thing u know? I minute it is fine, the next.. well yeah you can make your own unpleasant analogy. Soo Chris there you go, I hope CPR works on this thing <insert nervous laugh here> :mellow:

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 August 2010 - 09:59 PM

Hi OZ, You shouldn't be able to get your Netduino into a state where it's too busy to listen to Visual Studio. Two things: 1. When this happens, does pressing the pushbutton fix the issue during deployment? (assuming your pushbutton is in its default reset state and not being used as an InputPort) 2. If you can reproduce the issue, would you mind posting or sending me some sample code so that we can reproduce the issue here? Also, just to verify...your Netduino is physically okay, correct? Chris P.S. If you ever need to give your Netduino "firmware CPR", just press the pushbutton while plugging in your Netduino. This will boot "TinyBooter" instead of your Netduino app--allowing you to erase Netduino app, reflash the firmware, etc.

#3 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 24 August 2010 - 10:38 PM

Hi OZ,

You shouldn't be able to get your Netduino into a state where it's too busy to listen to Visual Studio.

Two things:
1. When this happens, does pressing the pushbutton fix the issue during deployment? (assuming your pushbutton is in its default reset state and not being used as an InputPort)
2. If you can reproduce the issue, would you mind posting or sending me some sample code so that we can reproduce the issue here?

Also, just to verify...your Netduino is physically okay, correct?

Chris

P.S.
If you ever need to give your Netduino "firmware CPR", just press the pushbutton while plugging in your Netduino. This will boot "TinyBooter" instead of your Netduino app--allowing you to erase Netduino app, reflash the firmware, etc.


Welll I fixed it by removing the gadget shield and loading a blank project on it, then loading the other project back on it. My code:
static int count = 0;
        
        public static void Main()
        {
            Accelerometer.Start();
            Buttons.Start();
            Light_Sensor.Start();
            Potentiometers.Start();
            
            RGB_LED.Start();
            Red_LEDs.Start();
            IR_LED.Start();

            RGB_LED.SetDutyCycleAll((uint)0);
            Red_LEDs.WriteToAll(false);

            Buttons.BottomButton_Interrupt += new NativeEventHandler(Buttons_BottomButton_Interrupt);

            while (!Buttons.Top_Pressed)
            {
                if(count == 0)
                    Red_LEDs.Chart(0, 100, (int)Light_Sensor.Light);
                else if (count == 1)
                    Red_LEDs.Chart(0, 100, (int)Potentiometers.Right_Pot);
                else if (count == 2)
                    Red_LEDs.Chart(0, 100, (int)OZ_Framework.Math.Calculations.Abs((Light_Sensor.Light-100)));
                else if (count == 3)
                    Red_LEDs.Chart(0, 100, (int)OZ_Framework.Math.Calculations.Abs((Potentiometers.Right_Pot - 100)));

            }

            //RGB_LED.SetDutyCycle((uint)Potentiometers.Left_Pot, (uint)Calculations.Abs((Light_Sensor.Light - 100F)), (uint)Potentiometers.Right_Pot);

            RGB_LED.SetDutyCycleAll((uint)0);
            Red_LEDs.WriteToAll(false);
        }

        static void Buttons_BottomButton_Interrupt(uint data1, uint data2, DateTime time)
        {
            if(data2 == 0)
                count++;
        }

I think you wont be able to recreate it unless you have this shield. if you want the whole project folder I'll attach it.

Thankfully the Netduino is very tough and was able to come back from the death [what 3 times now?! Great little device here]
And no it isn't physically damaged, I care for this thing as if it were my baby or something, it goes in a nice bubble wrapped box every night. yeah I'm not kidding.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 August 2010 - 11:30 PM

Hi OZ, Try commenting out your code--and then uncommenting one piece at a time. This should let you know where the issue is occuring. If it's a hardware issue with the shield, this should help you find it. If it's a software glitch in the Netduino firmware then, well, we'll see what we can do to remedy that :) Chris

#5 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 25 August 2010 - 12:24 AM

Hi OZ,

Try commenting out your code--and then uncommenting one piece at a time. This should let you know where the issue is occuring. If it's a hardware issue with the shield, this should help you find it. If it's a software glitch in the Netduino firmware then, well, we'll see what we can do to remedy that :)

Chris


When I stop debugging via VS the netduino keeps going SOMETIMES. I really haven't been able to tell why but it does it with infinite loops. I am going to test if it happens with and with out the shield on it.

#6 phil

phil

    Member

  • Members
  • PipPip
  • 11 posts

Posted 25 August 2010 - 04:45 AM

I'll toss my hat into this ring ... I also see this sometimes. No obvious pattern, it just refuses to talk to VS, probably 20% of the time, maybe 10%. I just unplug & plug the USB .. it's not so big a pain for me. The first person who is trying to preserve data in the SRAM while debugging is going to hate this, though!

#7 Flores

Flores

    Advanced Member

  • Members
  • PipPipPip
  • 64 posts

Posted 27 August 2010 - 09:28 AM

Same here.. happens sometimes.. can't pinpoint it..

#8 vajaj

vajaj

    New Member

  • Members
  • Pip
  • 2 posts
  • LocationSlovak Republic

Posted 27 August 2010 - 06:26 PM

Reading all this - I also experience problems with deploying as described - it happens with certain programs (Netduino too busy?), while with different program there is no such a problem at all. Unplugging USB does help. When I stop debugging in Visual Studio, should Netduino also stop? Mine always continues.

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 August 2010 - 03:59 AM

We've posted a pre-release firmware update that addresses this issue. http://forums.netdui...-patch-3-alpha/ Please note that this update is "alpha". To us, beta means "works well, but may have bugs and may not be complete." Alpha is pre-beta and means "for early adopters, may not work and you may need to go through some technical procedures to erase and reflash with earlier firmware." We're running on it exclusively here and having great success (including some limited support on VMWare Fusion and Sun VirtualBox). Your results may vary :) Chris

#10 Azazel

Azazel

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSweden

Posted 17 September 2010 - 08:31 AM

Reading all this - I also experience problems with deploying as described - it happens with certain programs (Netduino too busy?), while with different program there is no such a problem at all. Unplugging USB does help.

When I stop debugging in Visual Studio, should Netduino also stop? Mine always continues.


I think i have the same issue. When i deploy from visual studio my netduino looks like it is frozen (stops/pauses) and on reset the program runs as it should. When Debuging from VS i normaly only goes into debug mode after deploy(?) and then jumps out and on deply from the debug my netduino also frezez and a restart don't work but after manual deploy and reset it works again.

I found a fix last night when i updatet my firmware to 4.1.0.3 that if i use Reboot & Stop from the deploy tool my netduino will go into debug from VS and it will actually stay in debug mode and i can debug, but when i stop debug from VS it's the same issue all over again.

Any thoughts :mellow: ?

#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 17 September 2010 - 05:16 PM

Azazel, First of all, welcome to the community! Have you tried the v4.1.1 (alpha 1) firmware (over in the Netduino Beta forum)? It's pretty stable--it's just not "feature complete" so we didn't want to call it "beta" :) Chris

#12 Azazel

Azazel

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSweden

Posted 17 September 2010 - 05:35 PM

Azazel,

First of all, welcome to the community!

Have you tried the v4.1.1 (alpha 1) firmware (over in the Netduino Beta forum)? It's pretty stable--it's just not "feature complete" so we didn't want to call it "beta" :)

Chris


No i haven't tried it, just goten my netduino and the thought off it to stop working (warning text för the 4.1.1 alpha) made me just update to 4.1.0.3 instead.

#13 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 17 September 2010 - 06:19 PM

No i haven't tried it, just goten my netduino and the thought off it to stop working (warning text för the 4.1.1 alpha) made me just update to 4.1.0.3 instead.


Perhaps we warn people off _a bit too much_ :) We try to set low expectations, just in case...

Worst case, if v4.1.1 alpha doesn't work for you...you can reflash your Netduino with v4.1.0.3.

Chris

#14 Azazel

Azazel

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSweden

Posted 17 September 2010 - 07:24 PM

Perhaps we warn people off _a bit too much_ :) We try to set low expectations, just in case...

Worst case, if v4.1.1 alpha doesn't work for you...you can reflash your Netduino with v4.1.0.3.

Chris


Have just flashed to the 4.1.1 alpha but i still have the same debug issues i mentioned before, no change at all between v4.1.0.2, v4.1.0.3 and v4.1.1.1 what i can se.

#15 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 17 September 2010 - 07:53 PM

Okay, thanks. That sounds like a different issue then. Does this happen with the "Blinky" sample app from the tutorial? Does this happen if you just create a blank Netduino App and deploy that? Chris

#16 Azazel

Azazel

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSweden

Posted 18 September 2010 - 07:04 AM

Okay, thanks. That sounds like a different issue then.

Does this happen with the "Blinky" sample app from the tutorial?

Does this happen if you just create a blank Netduino App and deploy that?

Chris


Have just tried some , and cant even get into debuging mode. The old trick of reboot and stop and then debug dont work any more maybe since i flashed it to 4.1.1, think i got into debug yesterday with that trick to.

Have tried with a fresh project with no extra code, and with only
thread.sleep(timeout.infinitive);
but cant get it to stop on my breakpoints. VS only jumps into debug mode and out with the output(last lines)
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
The thread '<No Name>' (0x1) has exited with code 0 (0x0).
The program '[44] Micro Framework application: Managed' has exited with code 0 (0x0).


#17 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 September 2010 - 04:41 PM

Hi Azazel, Let's try erasing your current Netduino app--and then see if you can deploy the "empty with infinite timeout" app successfully. To erase your current Netduino app (using the backup procedure) 1. Go to the Start button > Programs > .NET Micro Framework v4.1 > Tools > MFDeploy.exe (run the MFDeploy app) 2. Change the transport from Serial to USB 3. Unplug your Netduino from any/all connections--power, shields, USB, etc. 4. Plug the USB cable into your Netduino. 5. Hold down the pushbutton on your Netduino. 6. While continuing to hold down the pushbutton, plug the Netduino into your PC. 7. Within 5 seconds, press the ERASE button in MFDeploy. This will erase your Netduino app. 8. Disconnect and reconnect your Netduino to reboot it. Chris

#18 Azazel

Azazel

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSweden

Posted 19 September 2010 - 11:14 AM

Hi Azazel,

Let's try erasing your current Netduino app--and then see if you can deploy the "empty with infinite timeout" app successfully.

To erase your current Netduino app (using the backup procedure)
1. Go to the Start button > Programs > .NET Micro Framework v4.1 > Tools > MFDeploy.exe (run the MFDeploy app)
2. Change the transport from Serial to USB
3. Unplug your Netduino from any/all connections--power, shields, USB, etc.
4. Plug the USB cable into your Netduino.
5. Hold down the pushbutton on your Netduino.
6. While continuing to hold down the pushbutton, plug the Netduino into your PC.
7. Within 5 seconds, press the ERASE button in MFDeploy. This will erase your Netduino app.
8. Disconnect and reconnect your Netduino to reboot it.

Chris


Followed theses instructions but still no sucess on geting into and staying in debug (stop at breakpoint).

Got new last lines from output thogh.
Waiting for debug commands...

The program '[49] Micro Framework application: Managed' has exited with code 0 (0x0).


#19 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 September 2010 - 04:00 PM

Azazel, Can you post a copy of your "empty with infinite timeout" solution (as a ZIP file)? We can take a look at that. If that looks fine, we may need you to take some sort of video showing what you're doing so we can understand all the variables. It almost looks like you're running in a virtual machine that can't attach the debugger or something... [In the meantime, can you go back to the production 4.1.0.3 firmware and use the "stop and debug" method you mentioned?] Chris

#20 Azazel

Azazel

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSweden

Posted 19 September 2010 - 04:31 PM

Azazel,

Can you post a copy of your "empty with infinite timeout" solution (as a ZIP file)? We can take a look at that.

If that looks fine, we may need you to take some sort of video showing what you're doing so we can understand all the variables. It almost looks like you're running in a virtual machine that can't attach the debugger or something...

[In the meantime, can you go back to the production 4.1.0.3 firmware and use the "stop and debug" method you mentioned?]

Chris


ziped down the blank project. I am using a real machine, i do have virtualizing software on this computer but im not running vs or netduino through it. I'll try going back to the 4.1.0.3 and se if i can get the debug working again.

Edit: Flashed back to 4.1.0.3 but still no success on geting a stop on breakpoint in debug, still the same problem and the reboot & stop also fails now on the 4.1.0.3.

Attached Files






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.