FEZ Panda Getting stuck

Hi guys,
A rather peculiar problem - one of my FEZ Pandas seems to get “stuck” at certain parts of the code.

To begin with, when uploading new code, it outputs:

Rebooting,

Done

And then stops, only when I press the reboot button does it then print

Debugger Found

Then it gets stuck on the opening curly bracket of the main function. No matter how long I wait, when I pause the code it will be at that bracket, and nothing beyond it would have executed (even if its an empty main function), however when I unpause, it will then proceed forward like nothing ever happened - happily executing the rest of the code.

Any clue what might cause either of these? Is this related in any way?

I never seen this before myself!

How are you running the program? Are you sure you’re pressing F10 or F11? Try F5 instead.

Try cleaning solution and rebuild all.

I only use F5 - I have no clue what F10 or F11 do quite frankly :slight_smile:

What does the Panda do after the boot is successful (as signified by done) and before the debugger is found? What could it be waiting for?

Edit: Architect - I’ll try that, thanks.

For now - night guys, I’ll update you tomorrow, it’s 2am here in England, and I have to be up in 5 hours. No more Panda time for me :(.

Do feel free to post any more suggestions

I think your panda is not having enough power and it is resetting.

Use power pack or powered USB hub

Thanks gus - I’ll try plugging it into my bench supply when I’m at the workshop.

Tried all the above, they didn’t help.

What does work though is Realse versions - this means I can’t debug, but at least now I know that the problem only affects the development, and the final product will work just fine.

If you do have any ideas though, do let me know please.

I’ve seen this numerous times when running in the debugger, especially if the previous run ended with an exception. Running out of memory is (for me) notorious for doing this, though I’ve seen it with things like out-of-bounds array references and such, too…

Does this problem happen with all your programs or with a specific program?

If it is a specific program, then your program is ending with an exception, as was mentioned before, or it could be in a tight loop.

When I have this condition, I often use a button at the beginning of the program and check it for depression before I start actual program execution. I use the logic below:

void main()
{
     if (!buttonDepressed)
        Thread.Sleep(1000);

  ...

The above is pseudo code…

The sleep allows time for the debugger to capture the board.

Tight loop was a problem - thanks.

Changed a sleep(10) to sleep(25) in a while loop and it worked.