Main Site Documentation

Bricked?


#1

Uh, oh. I’ve been having fun learning with a FEZ Domino, but have managed to get to what I fear is a bad place. I started with the simple examples in the tutorial and beginners’ guide and everything was working just fine. Unfortunately, things have gone south.

It started with weirdness in Visual Studio hanging on a deploy, then in trying to figure out I found the device won’t even ping. Could it have been the code I was tinkering with? I was trying to setup an interrupt handler on LDR, but forgot to add the last parameter (interrupt mode).

What’s the procedure to “reset hardware to factory defaults”? Please?

Thanks,
CP


#2

Your could should never cause the board to lock up! If you were able to do so then you are very good at braking things :wink: and I would love to see the program that caused it!

You can alway get into the loader (hold LDR then reset) and erase everything or erase just your application. Follow the video for firmware update procedure.

Have you ever update the firmware? If not then this is where your problem is. We have release a new SDK few days ago and you should be using the latest firmware.


#3

Oh, I’m good at breaking things. :slight_smile:

Thanks for the quick response! I found the boot loader solution just now, and erased the managed application and am now back in business. The whole idea of using the same IDE and tools to write code on embedded devices, my PC, my servers and for a cluster is just unreal. All with debugging support, too!

I haven’t updated the firmware yet (just got the board yesterday) but will do so now just to be on the safe side. If I can recreate the problem after putting on the new firmware I’ll post it here. Otherwise, case closed.

This is really cool.


#4

Yeah, I’m that bad. Even after updating the firmware:

SolutionReleaseInfo.solutionVersion: 4.0.2.0

The following code, when deployed or debugged, will cause the device to hang on the line that adds the interrupt handler:

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using System.Threading;

namespace MyMicroFezApp
{
    public class Program
    {
        public static void Main()
        {
            OutputPort p = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, false);
            
            InputPort i = new InputPort((Cpu.Pin)FEZ_Pin.Digital.LDR, false, Port.ResistorMode.PullUp);
            
            i.OnInterrupt += (pin, value, t) =>
            {
                p.Write(value == 0);
            };
            
            Microsoft.SPOT.ExtendedTimer timer = new ExtendedTimer(
                (o) => 
                { 
                    if (i.Read()) p.Write(p.Read());
                }, null, ExtendedTimer.TimeEvents.Second);
            
            while (true)
            {
//                p.Write(!p.Read());
                Thread.Sleep(500);
            }
            
            Debug.Print("Hello World!");
        }

    }
}

Yeah, I can see how this would be a bad idea now, but given I don’t know a dang thing about embedded programming I walked right into it.


#5

We will try it here but are you sure it “hangs” not raise an exception?


#6

How would I know if it raised an exception? I’m not seeing anything in the debugger (IDE). I can tell you that the processor gets a tad warm in the “hung” state, which to me indicates a busy loop (but I’m only 24-hours away from complete ignorance on the subject).


#7

Yes we see the problem with installing interrupts. Let us test and get back to you.


#8

You are using Input port which doesn’t support interrupts. You need InterruptPort instead.

We are still looking on why it is hanging instead of raising an exception


#9

We confirmed the issue with Microsoft and it will be fixed in future to just throw an exception.