Panda II only works in debug mode

My panda board was working fine until I tried to deploy a new version of my software to the device. VS said that the software was successfully deployed, but after I pushed the reset button my software would not run. I ran it in debug mode and it worked but as soon as I stopped debugging the software stopped working. I updated the firmware on my board and that did not help. How do I get my board to work without being in debug mode?

What is the board doing? And what are you looking for to let you know whether your program is running or not?

welcome to the forum.

Simply put, you can connect to the debugging thread on your Panda using MFDeploy and see what is occurring (possibly an exception you’re not handling?). I’d suggest you open MFDeploy and select USB as the transport, in VS deploy your app, then once complete you can reset the Panda and then in MFDeploy hit F5 to connect.

The board is supposed to receive a message from CAN and turn on an LED if it receives a specific message. The program does work. I even tried deploying an old version that at one point did deploy and that will not deploy now either.

If you upgraded to the latest firmware, especially if reusing an old project, you should remove the assembly references that you previously had and add the latest versions back in. It’s tedious, but I’ve seen some strange behavior when this isn’t done.

Like Brett said, my first thought is that perhaps there’s an uncaught exception that the debugger handles for you while running but simply freezes the program when running in Release. You should determine if your program simply is not running at all or whether it is stopping at a certain point. Maybe add a routine that is always blinking an LED to let you know if the blinking even starts and at what point it stops.

Debug mode introduces some overhead that will make your program run slightly slower than it would in release. There might be something in your code (like a polling loop) where this additional latency is actually beneficial, but will cause your program to fail when it is running at “full speed.” This could be a sign that you need a delay somewhere.

I have deleted and re-added all of my references and was still getting the same response. I added a blinking LED function like you said and deployed it to the device and never see any blinking.

Hmmm, without getting into the specifics of your code, the next thing I would probably do (if you have the time and resources) would be to deploy from a different PC and/or deploy to a different Panda2 and see if the behavior changes. I would try to find out if the development environment is causing a problem with deployment or whether there might be a problem (firmware, etc.) on the board itself.

You can also go back to basics with a barebones program and see if you can at least get a simple program to work in release.

So what does MFDeploy tell you ??

After I deploy and connect my device in MFDeploy the program runs until i reset the device, then it stops working again. I have a different Panda board that I tried to get the LED on the board to blink and I am having the same issue with this board as the other one. I do not have access to a different computer to see if it is my PC.

@ Heather - In MFDeploy > Plug-in > Debug > Clear bootloader flag does it run again?

it is still doing the same thing after trying to clear the bootloader flag

What changed between when your program used to work in release and when it stopped working?

I added more CAN signals for it to look for. I tried to deploy the last version I knew it worked and it started to do the same thing with that version as well.

Did anything change on your PC? And can you deploy a barebones project (LED-blinker, for example) and have that work at a minimum?

as far as I know nothing has changed on my computer. The LED blinker has the same problem, will run in debug but not after it is deployed.

how are you powering it ? Please just leave connected to the PC and reboot the Panda, and then reconnect to it with MFDeploy. Do that several times - the app should just continue working (and the LED flashing for example). If you haven’t already done this, do not use release mode, just simply use debug build and deploy that.

This works once but after I reboot the Panda and connect again it does not work anymore. Right now I am powering it though my computer using a USB cable.

please capture the output of the Panda restarting and paste it here. I’ll create a blinking-LED Panda app an do the same.

I wonder what you mean exactly by this. Did you add a blinking led function to your existing code? Or are you running a bare minimum blinking led example?

I started a new project, targeting 4.1 framework and added the Panda2 and USBizi references. Here’s my code.

using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

namespace Panda_blinkLED
{
    public class Program
    {
        public static void Main()
        {
            OutputPort LED = new OutputPort((Cpu.Pin)GHIElectronics.NETMF.FEZ.FEZ_Pin.Digital.LED,false);
            while (true)
            {
                Thread.Sleep(125);
                LED.Write(true);
                Debug.Print(".");
                Thread.Sleep(125);
                LED.Write(false);
                Debug.Print("+");
            }

        }

    }
}

Deployed to the board from VS using F5. After that, stopped debugging in VS.

Moved over to MFDeploy. Connected to USB device, can see the alternating + and . message.

From the plug-in --> debug menu, selected restart CLR. Output is:

[quote]Rebooting…
Done.
Found debugger!
Create TS.
Loading start at 4eb34, end 56d0c
Attaching file.
Assembly: mscorlib (4.1.2821.0) (3880 RAM - 33236 ROM - 19134 METADATA)
AssemblyRef = 0 bytes ( 0 elements)
TypeRef = 0 bytes ( 0 elements)
FieldRef = 0 bytes ( 0 elements)
MethodRef = 0 bytes ( 0 elements)
TypeDef = 1112 bytes ( 139 elements)
FieldDef = 272 bytes ( 135 elements)
MethodDef = 1572 bytes ( 786 elements)

Attributes = 0 bytes ( 0 elements)
TypeSpec = 16 bytes ( 4 elements)
Resources = 232 bytes ( 29 elements)
Resources Files = 16 bytes ( 2 elements)
Resources Data = 437 bytes
Strings = 1551 bytes
Signatures = 2126 bytes
ByteCode = 11702 bytes

Loading Deployment Assemblies.
Attaching deployed file.
Assembly: GHIElectronics.NETMF.Hardware.USBizi (4.1.8.0) (172 RAM - 304 ROM - 95 METADATA)
AssemblyRef = 4 bytes ( 1 elements)
TypeRef = 4 bytes ( 1 elements)
FieldRef = 0 bytes ( 0 elements)
MethodRef = 4 bytes ( 1 elements)
TypeDef = 16 bytes ( 2 elements)
FieldDef = 0 bytes ( 0 elements)
MethodDef = 4 bytes ( 1 elements)

Attributes = 0 bytes ( 0 elements)
TypeSpec = 0 bytes ( 0 elements)
Resources = 0 bytes ( 0 elements)
Resources Files = 0 bytes ( 0 elements)
Resources Data = 0 bytes
Strings = 75 bytes
Signatures = 3 bytes
ByteCode = 5 bytes

Attaching deployed file.
Assembly: FEZPanda_II_GHIElectronics.NETMF.FEZ (4.1.8.0) (304 RAM - 904 ROM - 495 METADATA)
AssemblyRef = 12 bytes ( 3 elements)
TypeRef = 44 bytes ( 11 elements)
FieldRef = 0 bytes ( 0 elements)
MethodRef = 20 bytes ( 5 elements)
TypeDef = 72 bytes ( 9 elements)
FieldDef = 12 bytes ( 6 elements)
MethodDef = 4 bytes ( 2 elements)

Attributes = 0 bytes ( 0 elements)
TypeSpec = 0 bytes ( 0 elements)
Resources = 0 bytes ( 0 elements)
Resources Files = 0 bytes ( 0 elements)
Resources Data = 0 bytes
Strings = 182 bytes
Signatures = 35 bytes
ByteCode = 98 bytes

Attaching deployed file.
Assembly: Panda_blinkLED (1.0.0.0) (284 RAM - 860 ROM - 444 METADATA)
AssemblyRef = 12 bytes ( 3 elements)
TypeRef = 52 bytes ( 13 elements)
FieldRef = 0 bytes ( 0 elements)
MethodRef = 36 bytes ( 9 elements)
TypeDef = 24 bytes ( 3 elements)
FieldDef = 4 bytes ( 2 elements)
MethodDef = 12 bytes ( 5 elements)

Attributes = 0 bytes ( 0 elements)
TypeSpec = 0 bytes ( 0 elements)
Resources = 16 bytes ( 2 elements)
Resources Files = 8 bytes ( 1 elements)
Resources Data = 13 bytes
Strings = 107 bytes
Signatures = 64 bytes
ByteCode = 127 bytes

Attaching deployed file.
Assembly: Microsoft.SPOT.Native (4.1.2821.0) (1144 RAM - 6516 ROM - 4479 METADATA)
AssemblyRef = 4 bytes ( 1 elements)
TypeRef = 80 bytes ( 20 elements)
FieldRef = 0 bytes ( 0 elements)
MethodRef = 60 bytes ( 15 elements)
TypeDef = 336 bytes ( 42 elements)
FieldDef = 192 bytes ( 95 elements)
MethodDef = 224 bytes ( 111 elements)

Attributes = 48 bytes ( 6 elements)
TypeSpec = 0 bytes ( 0 elements)
Resources = 72 bytes ( 9 elements)
Resources Files = 8 bytes ( 1 elements)
Resources Data = 747 bytes
Strings = 648 bytes
Signatures = 595 bytes
ByteCode = 418 bytes

Attaching deployed file.
Assembly: Microsoft.SPOT.Hardware (4.1.2821.0) (1752 RAM - 11440 ROM - 7371 METADATA)
AssemblyRef = 8 bytes ( 2 elements)
TypeRef = 124 bytes ( 31 elements)
FieldRef = 24 bytes ( 6 elements)
MethodRef = 120 bytes ( 30 elements)
TypeDef = 496 bytes ( 62 elements)
FieldDef = 176 bytes ( 88 elements)
MethodDef = 444 bytes ( 222 elements)

Attributes = 0 bytes ( 0 elements)
TypeSpec = 0 bytes ( 0 elements)
Resources = 0 bytes ( 0 elements)
Resources Files = 0 bytes ( 0 elements)
Resources Data = 0 bytes
Strings = 1329 bytes
Signatures = 1067 bytes
ByteCode = 2611 bytes

Resolving.

Total: (6396 RAM - 53260 ROM - 32018 METADATA)
AssemblyRef = 40 bytes ( 10 elements)
TypeRef = 304 bytes ( 76 elements)
FieldRef = 24 bytes ( 6 elements)
MethodRef = 240 bytes ( 60 elements)
TypeDef = 2056 bytes ( 257 elements)
FieldDef = 656 bytes ( 326 elements)
MethodDef = 2260 bytes ( 1127 elements)

DebuggingInfo = 1140 bytes

Attributes = 48 bytes ( 6 elements)
TypeSpec = 16 bytes ( 4 elements)
Resources Files = 96 bytes ( 4 elements)
Resources = 320 bytes ( 40 elements)
Resources Data = 1197 bytes
Strings = 3892 bytes
Signatures = 3890 bytes
ByteCode = 14961 bytes

Ready.
.
+
.
+
.
+
.
+
.
[/quote]

That works reliably many times over. Many many many times.

Have you confirmed your firmware and SDK match?