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?
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.