G120 Boot issue

Happy New Year to all !!

Any suggestion why during startup the system hangs and reboots after a while… this is what the debug windows in VS2010 show.
It never reaches the first line in Main()

Found debugger!

Create TS.

Loading start at a0e00000, end a0e0fc38

Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Loading Deployment Assemblies.

Attaching deployed file.

Assembly: MFClassLibrary (1.0.0.0) Attaching deployed file.

Assembly: GHI.Premium.IO (4.2.7.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Graphics (4.2.0.0) Attaching deployed file.

Assembly: EMXApplication (1.0.0.0) Attaching deployed file.

Assembly: GHI.Premium.System (4.2.7.0) Attaching deployed file.

Assembly: System (4.2.0.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Net (4.2.0.0) Attaching deployed file.

Assembly: GHI.Premium.Net (4.2.7.0) Attaching deployed file.

Assembly: System.IO (4.2.0.0) Attaching deployed file.

Assembly: GHI.Premium.Native (4.2.7.0) Attaching deployed file.

Assembly: Microsoft.SPOT.IO (4.2.0.0) Attaching deployed file.

Assembly: GHI.Premium.Hardware (4.2.7.0) Attaching deployed file.

Assembly: GHI.Premium.Hardware.EMX (4.2.7.0) Attaching deployed file.

Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0) Attaching deployed file.

Assembly: GHI.Premium.Hardware.G120 (4.2.7.0) Resolving.

GC: 1msec 418884 bytes used, 6920784 bytes available

Type 0F (STRING ): 24 bytes

Type 15 (FREEBLOCK ): 6920784 bytes

Type 17 (ASSEMBLY ): 20604 bytes

Type 1E (BINARY_BLOB_HEAD ): 398184 bytes

Type 34 (APPDOMAIN_HEAD ): 72 bytes

GC: performing heap compaction…

Ready.

First of all,

Have you tried to update the firmware with the last 4.2 QFE2 ?

this is the main problem reported on the forum, that in any case, you must start by this point before trying to put anything in the device ! And this however you think it is already the case !

Yes, i’m sure using the latest…

I do not understand why you have EMX and G120 Assembly deployed both ?

Remove EMX assembly.

Yes, I think if it is a G120, no way to use the EMX !

There is no EMX assembly… The name you see in the list might be confusing but it is just the name of the application assembly. Before i used EMX instead of G120 :slight_smile:

Take a closer look :wink:

Assembly: GHI.Premium.Hardware.EMX (4.2.7.0) Attaching deployed file.

@ RobvanSchelven - Assembly: GHI.Premium.Hardware.EMX (4.2.7.0) Attaching deployed file. is still in the list…

*Edit lol - 10sec too late

Arhcitect is Lucky Luke ! :dance:

Thanks so much !!! Yes you are right… Cheers !!

You are welcome!

Several Couple of eyes are often better ! You’re welcome

Yes, that’s right… Unfortunately removing the assembly did not solve this problem (and other issues with G120 / MF4.2)

At the same step ? or does it start at least ?

Yes at the same step, but it is not always… sometimes it starts fine sometimes it won’t, i am still working on it.
I made 2 steps at a time…from EMX & MF 4.1 to a custom board G120 & MF 4.2. To make sure its not related to G120 i will go back to EMX but with MF 4.2

What is you Main function looks like?


     public static void Main()
        {
 #if DEBUG
            Debug.EnableGCMessages(true);
 #else
            Debug.EnableGCMessages(false);
 #endif
            StatusLed.On();

            try
            {
                var dt = RealTimeClock.GetTime();
                Utility.SetLocalTime(dt);
            }
            catch
            {
                var dt = new DateTime(2013, 1, 1, 0, 0, 0);
                Utility.SetLocalTime(dt);
                RealTimeClock.SetTime(dt);
            }


            // TODO WatchDog

            LipoModule.Init();
            LipoModule.Notification += LipoModuleNotification;

            DebugHelper.DebugPrint("Setup persistence storage");
            try
            {
                var ps = new PersistentStorage("SD");
                ps.MountFileSystem();
            }
            catch
            {
                SystemError();
            }


            SetupWirelessConnection();

            IResourceServer resourceServer = new ResourceServer(@ "SD", @ "SD\data\");
            var cfgvars = new ConfigVars();
            resourceServer.Store = cfgvars.Set;
            resourceServer.Retrieve = cfgvars.Get;

            DebugHelper.DebugPrint("Setup Websocket handler");
            var requestThread = new Thread(() => WebSocket.WebSocketHandler(new SocketCommandHandler(StatusLed)));
            requestThread.Start();

            DebugHelper.DebugPrint("Setup HTTP handler");
            var server = new MyHttpServer(resourceServer);
            StatusLed.Off();
            DebugHelper.DebugPrint("Run");
            server.Run();
        }

Can you put

Thread.Sleep(Timeout.Infinite);

at the end of your main function?

and also if I’m right, and my eyes are OK, there’s no RealTime quartz on my G120 HDR… (Q1). Did you solder one ?

If n,ot, I’m quite sure that RealtimeClock has no interest here…

Can you also underline us where it throw an exception in your code ?