Main Site Documentation

ASSERT on LCD after leaving my first program running


#1

I just got my FEZ Hydra and hooked up a TE35 LCD and a MulticolorLED. I did all the getting started stuff first and have .NET Micro 4.2 QFE 2 and latest firmware on the Hydra.

I then wrote my first simple program. All it does is randomly select values for RGB values every time you touch the screen and change the MulticolorLED to that color as well as print out the RGB values to the screen and debugger.

Anyways, it was running fine and then I went to bed (left it running), in the morning the screen is black with just the text ***** ASSERT ******. Am I doing something wrong?

Here is the code and the text from the debugger. You can see how the program was running fine (printing out RGB values), then all the sudden a bunch of values with byte amounts.


using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation.Media;

namespace GadgeteerApp2
{
    public partial class Program
    {  
        void ProgramStarted()
        {
            display_TE35.SimpleGraphics.AutoRedraw = true;
            display_TE35.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchDown);
            display_TE35.WPFWindow.Invalidate();
        }

        void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
        {
            display_TE35.SimpleGraphics.Clear();
            display_TE35.SimpleGraphics.DisplayText("Lazlo v3.0 Started.", Resources.GetFont(Resources.FontResources.NinaB), Colors.Yellow, 0, 0);

            Random randomInt = new Random();
            
            int redValue = randomInt.Next(254) + 1;
            int greenValue = randomInt.Next(254) + 1;
            int blueValue = randomInt.Next(254) + 1;
            
            multicolorLed.SetRedIntensity(redValue);
            multicolorLed.SetGreenIntensity(greenValue);
            multicolorLed.SetBlueIntensity(blueValue);

            string valueText = "Red: " + redValue + ", Blue: " + blueValue + ", Green: " + greenValue;
            Debug.Print(valueText);
            display_TE35.SimpleGraphics.DisplayText(valueText, 
                                                    Resources.GetFont(Resources.FontResources.NinaB),
                                                    ColorUtility.ColorFromRGB((byte)redValue, (byte)greenValue, (byte)blueValue), 0, 20);
        }
    }
}

Debug output (couldn’t paste all of it, forum doesn’t allow posts that big, but rest was pretty much a repeat of the portion between the GC lines)…


Found debugger!

Create TS.

 Loading start at 20175a40, end 201a2d84

   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.Graphics (4.2.0.0)     Assembly: Microsoft.SPOT.TinyCore (4.2.0.0)  
   Assembly: Microsoft.SPOT.IO (4.2.0.0)     Assembly: System.IO (4.2.0.0)     Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0) 
    Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0)     Assembly: Microsoft.SPOT.Touch (4.2.0.0)  
   Assembly: Microsoft.SPOT.Ink (4.2.0.0)     Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)  
   Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0)     Assembly: System.Xml (4.2.0.0)  
   Assembly: Microsoft.SPOT.Time (4.2.0.0)     Assembly: Microsoft.SPOT.Net (4.2.0.0)  
   Assembly: System (4.2.0.0)     Assembly: Microsoft.SPOT.Net.Security (4.2.0.0)  
   Assembly: System.Net.Security (4.2.0.0)  Loading Deployment Assemblies.

Attaching deployed file.

   Assembly: GHI.OSHW.Hardware (4.2.3.1)  Attaching deployed file.

   Assembly: Gadgeteer (2.42.0.0)  Attaching deployed file.

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

   Assembly: Gadgeteer.DaisyLink (2.42.0.0)  Attaching deployed file.

   Assembly: GTM.GHIElectronics.Display_TE35 (1.1.1.0)  Attaching deployed file.

   Assembly: GadgeteerApp2 (3.0.4793.37773)  Attaching deployed file.

   Assembly: GHIElectronics.Gadgeteer.FEZHydra (1.1.1.0)  Attaching deployed file.

   Assembly: GTM.GHIElectronics.MulticolorLed (1.1.1.0)  Resolving.

GC: 1msec 408396 bytes used, 5882736 bytes available

Type 0F (STRING              ):     24 bytes

Type 15 (FREEBLOCK           ): 5882736 bytes

Type 17 (ASSEMBLY            ):  31104 bytes

Type 1E (BINARY_BLOB_HEAD    ): 377196 bytes

Type 34 (APPDOMAIN_HEAD      ):     72 bytes

GC: performing heap compaction...

The debugging target runtime is loading the application assemblies and starting execution.
Ready.

'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\mscorlib.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Native.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Graphics.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.TinyCore.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.IO.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.IO.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.Usb.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.SerialPort.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Touch.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Ink.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.PWM.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.OneWire.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.Xml.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Time.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Net.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Net.Security.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.Net.Security.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI OSHW NETMF v4.2 SDK\Assemblies\le\GHI.OSHW.Hardware.dll'
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies\.NET Micro Framework 4.2\le\Gadgeteer.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.Http.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies\.NET Micro Framework 4.2\le\Gadgeteer.DaisyLink.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Modules\Display_TE35\NETMF 4.2\le\GTM.GHIElectronics.Display_TE35.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Modules\MulticolorLed\NETMF 4.2\le\GTM.GHIElectronics.MulticolorLed.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Mainboards\FEZHydra\NETMF 4.2\le\GHIElectronics.Gadgeteer.FEZHydra.dll', Symbols loaded.
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Users\Hoss\documents\visual studio 2010\Projects\GadgeteerApp2\GadgeteerApp2\bin\Debug\le\GadgeteerApp2.exe', Symbols loaded.
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
Using mainboard GHI Electronics FEZHydra version 1.2
The thread '<No Name>' (0x3) has exited with code 0 (0x0).
Red: 146, Blue: 7, Green: 146
Red: 46, Blue: 121, Green: 95
Red: 67, Blue: 151, Green: 131
Red: 147, Blue: 134, Green: 180
Red: 97, Blue: 14, Green: 231
Red: 118, Blue: 223, Green: 114
Red: 154, Blue: 30, Green: 225
Red: 175, Blue: 89, Green: 251
Red: 224, Blue: 241, Green: 81
Red: 51, Blue: 232, Green: 252
Red: 56, Blue: 180, Green: 210
Red: 143, Blue: 71, Green: 23
Red: 23, Blue: 207, Green: 182
Red: 59, Blue: 248, Green: 165
Red: 110, Blue: 67, Green: 88
Red: 158, Blue: 213, Green: 253
Red: 158, Blue: 52, Green: 46
Red: 56, Blue: 104, Green: 108
Red: 142, Blue: 253, Green: 20
Red: 237, Blue: 56, Green: 198
Red: 218, Blue: 234, Green: 110
Red: 231, Blue: 78, Green: 221
Red: 215, Blue: 42, Green: 243
Red: 46, Blue: 217, Green: 50
Red: 217, Blue: 158, Green: 67
Red: 47, Blue: 23, Green: 21
Red: 22, Blue: 81, Green: 192
Red: 154, Blue: 184, Green: 223
Red: 228, Blue: 218, Green: 64
Red: 36, Blue: 217, Green: 151
Red: 117, Blue: 164, Green: 174
Red: 149, Blue: 198, Green: 184
Red: 30, Blue: 106, Green: 212
Red: 205, Blue: 157, Green: 105
Red: 232, Blue: 220, Green: 179
Red: 133, Blue: 123, Green: 249
Red: 112, Blue: 157, Green: 193
Red: 21, Blue: 76, Green: 8
Red: 212, Blue: 195, Green: 37
Red: 12, Blue: 149, Green: 213
Red: 233, Blue: 176, Green: 181
Red: 150, Blue: 166, Green: 112
Red: 111, Blue: 112, Green: 35
Red: 81, Blue: 37, Green: 64
Red: 221, Blue: 26, Green: 53
Red: 45, Blue: 52, Green: 249
Red: 182, Blue: 186, Green: 27
Red: 148, Blue: 147, Green: 171
Red: 167, Blue: 49, Green: 46
Red: 228, Blue: 128, Green: 163
Red: 253, Blue: 45, Green: 61
Red: 174, Blue: 43, Green: 218
Red: 69, Blue: 3, Green: 55
Red: 209, Blue: 139, Green: 2
Red: 119, Blue: 175, Green: 22
Red: 4, Blue: 225, Green: 119
Red: 171, Blue: 181, Green: 61
Red: 57, Blue: 250, Green: 67
Red: 222, Blue: 225, Green: 8
Red: 24, Blue: 121, Green: 232
Red: 147, Blue: 75, Green: 54
Red: 106, Blue: 80, Green: 218
Red: 121, Blue: 78, Green: 138
Red: 34, Blue: 202, Green: 127
Red: 202, Blue: 61, Green: 109
Red: 216, Blue: 170, Green: 223
Red: 136, Blue: 202, Green: 51
Red: 8, Blue: 155, Green: 21
Red: 144, Blue: 7, Green: 240
Red: 151, Blue: 128, Green: 198
Red: 80, Blue: 195, Green: 245
Red: 71, Blue: 123, Green: 211
Red: 16, Blue: 232, Green: 173
Red: 21, Blue: 30, Green: 194
Red: 18, Blue: 45, Green: 40
Red: 173, Blue: 87, Green: 125
Red: 27, Blue: 89, Green: 13
Red: 249, Blue: 204, Green: 21
Red: 151, Blue: 210, Green: 171
Red: 100, Blue: 37, Green: 6
Red: 91, Blue: 80, Green: 213
Red: 8, Blue: 9, Green: 127
Red: 36, Blue: 69, Green: 109
Red: 80, Blue: 248, Green: 73
Red: 192, Blue: 131, Green: 198
Red: 94, Blue: 44, Green: 31
Red: 114, Blue: 78, Green: 254
Red: 246, Blue: 239, Green: 252
Red: 91, Blue: 53, Green: 138
Red: 9, Blue: 200, Green: 155
Red: 61, Blue: 75, Green: 254
Red: 227, Blue: 135, Green: 61
Red: 35, Blue: 96, Green: 232
Red: 153, Blue: 31, Green: 54
Red: 208, Blue: 241, Green: 81
Red: 141, Blue: 208, Green: 183
Red: 16, Blue: 219, Green: 65
Red: 93, Blue: 79, Green: 253
Red: 104, Blue: 73, Green: 85
Red: 212, Blue: 119, Green: 134
Red: 123, Blue: 24, Green: 166
Red: 230, Blue: 221, Green: 225
Red: 134, Blue: 72, Green: 196
Red: 247, Blue: 171, Green: 198
Red: 220, Blue: 183, Green: 8
Red: 224, Blue: 10, Green: 21
Red: 50, Blue: 88, Green: 222
Red: 28, Blue: 127, Green: 215
Red: 76, Blue: 87, Green: 76
Red: 112, Blue: 79, Green: 248
Red: 176, Blue: 18, Green: 160
Red: 121, Blue: 251, Green: 118
Red: 52, Blue: 67, Green: 189
Red: 67, Blue: 75, Green: 253
Red: 125, Blue: 13, Green: 207
Red: 139, Blue: 104, Green: 200
Red: 251, Blue: 37, Green: 103
Red: 189, Blue: 20, Green: 224
Red: 142, Blue: 18, Green: 29
Red: 162, Blue: 87, Green: 169
Red: 120, Blue: 103, Green: 217
Red: 186, Blue: 40, Green: 68
Red: 253, Blue: 69, Green: 90
Red: 139, Blue: 138, Green: 123
Red: 79, Blue: 84, Green: 68
Red: 190, Blue: 82, Green: 57
Red: 136, Blue: 32, Green: 120
Red: 237, Blue: 216, Green: 250
Red: 201, Blue: 155, Green: 238
Red: 161, Blue: 247, Green: 191
Red: 145, Blue: 212, Green: 144
Red: 169, Blue: 36, Green: 176
Red: 251, Blue: 58, Green: 217
Red: 72, Blue: 85, Green: 242
Red: 36, Blue: 249, Green: 137
Red: 100, Blue: 192, Green: 150
Red: 102, Blue: 26, Green: 219
Red: 180, Blue: 205, Green: 199
Red: 4, Blue: 87, Green: 47
Red: 118, Blue: 131, Green: 168
Red: 161, Blue: 82, Green: 219
Red: 38, Blue: 134, Green: 182
Red: 83, Blue: 119, Green: 251
GC: 28msec 766140 bytes used, 5524992 bytes available
Type 0F (STRING              ):   1476 bytes
Type 11 (CLASS               ):  18264 bytes
Type 12 (VALUETYPE           ):   1548 bytes
Type 13 (SZARRAY             ):   6432 bytes
  Type 03 (U1                  ):    252 bytes
  Type 04 (CHAR                ):    780 bytes
  Type 07 (I4                  ):   1044 bytes
  Type 0F (STRING              ):     60 bytes
  Type 11 (CLASS               ):   4212 bytes
  Type 12 (VALUETYPE           ):     84 bytes
Type 15 (FREEBLOCK           ): 5524992 bytes
Type 16 (CACHEDBLOCK         ):    132 bytes
Type 17 (ASSEMBLY            ):  31104 bytes
Type 18 (WEAKCLASS           ):     96 bytes
Type 19 (REFLECTION          ):    192 bytes
Type 1B (DELEGATE_HEAD       ):   1188 bytes
Type 1D (OBJECT_TO_EVENT     ):    312 bytes
Type 1E (BINARY_BLOB_HEAD    ): 697608 bytes
Type 1F (THREAD              ):   1536 bytes
Type 20 (SUBTHREAD           ):    144 bytes
Type 21 (STACK_FRAME         ):   1644 bytes
Type 22 (TIMER_HEAD          ):     72 bytes
Type 23 (LOCK_HEAD           ):     60 bytes
Type 24 (LOCK_OWNER_HEAD     ):     24 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD):     48 bytes
Type 27 (FINALIZER_HEAD      ):    144 bytes
Type 31 (IO_PORT             ):    216 bytes
Type 34 (APPDOMAIN_HEAD      ):     72 bytes
Type 36 (APPDOMAIN_ASSEMBLY  ):   3828 bytes
GC: 24msec 766008 bytes used, 5525124 bytes available
Type 0F (STRING              ):   1476 bytes
Type 11 (CLASS               ):  18264 bytes
Type 12 (VALUETYPE           ):   1548 bytes
Type 13 (SZARRAY             ):   6432 bytes
  Type 03 (U1                  ):    252 bytes
  Type 04 (CHAR                ):    780 bytes
  Type 07 (I4                  ):   1044 bytes
  Type 0F (STRING              ):     60 bytes
  Type 11 (CLASS               ):   4212 bytes
  Type 12 (VALUETYPE           ):     84 bytes
Type 15 (FREEBLOCK           ): 5525124 bytes
Type 17 (ASSEMBLY            ):  31104 bytes
Type 18 (WEAKCLASS           ):     96 bytes
Type 19 (REFLECTION          ):    192 bytes
Type 1B (DELEGATE_HEAD       ):   1188 bytes
Type 1D (OBJECT_TO_EVENT     ):    312 bytes
Type 1E (BINARY_BLOB_HEAD    ): 697608 bytes
Type 1F (THREAD              ):   1536 bytes
Type 20 (SUBTHREAD           ):    144 bytes
Type 21 (STACK_FRAME         ):   1644 bytes
Type 22 (TIMER_HEAD          ):     72 bytes
Type 23 (LOCK_HEAD           ):     60 bytes
Type 24 (LOCK_OWNER_HEAD     ):     24 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD):     48 bytes
Type 27 (FINALIZER_HEAD      ):    144 bytes
Type 31 (IO_PORT             ):    216 bytes
Type 34 (APPDOMAIN_HEAD      ):     72 bytes
Type 36 (APPDOMAIN_ASSEMBLY  ):   3828 bytes


#2

Can you show us the very tail end of the GC compaction dumps (say the last two passes thru)?

Assert is usually a core function has gone belly up. Seems like something real bad went on - the GC dumps might show if it’s a memory leak.

I was going to suggest starting it again and seeing how long it takes to fail again but it could be a long boring process :slight_smile:


#3

My guess:

Move the line:

 Random randomInt = new Random();

To ProgramStarted(). You will have to make randomint a class variable.

Because you “new” randomInt in a function it adds garbage to the garbage collector (i.e. the GC you see in the debug window (garbage collector?))

namespace GadgeteerApp2
{
    public partial class Program
    {  
        private Random randomInt;

        void ProgramStarted()
        {
            randomInt = new Random();
            display_TE35.SimpleGraphics.AutoRedraw = true;
            display_TE35.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchDown);
            display_TE35.WPFWindow.Invalidate();
        }

      ...


#4

No problem. Here are the last two GC blocks. Looks like same values. FYI, there were 41 GC blocks total. I’ll leave it running again tonight. Although I don’t know when it crashes, the debug output is not time stamped. I would have to put a timer or something in my code to output the time (or call the event handler method with a timer and add timestamp to the RGB output string).


GC: 24msec 766008 bytes used, 5525124 bytes available
Type 0F (STRING              ):   1476 bytes
Type 11 (CLASS               ):  18264 bytes
Type 12 (VALUETYPE           ):   1548 bytes
Type 13 (SZARRAY             ):   6432 bytes
  Type 03 (U1                  ):    252 bytes
  Type 04 (CHAR                ):    780 bytes
  Type 07 (I4                  ):   1044 bytes
  Type 0F (STRING              ):     60 bytes
  Type 11 (CLASS               ):   4212 bytes
  Type 12 (VALUETYPE           ):     84 bytes
Type 15 (FREEBLOCK           ): 5525124 bytes
Type 17 (ASSEMBLY            ):  31104 bytes
Type 18 (WEAKCLASS           ):     96 bytes
Type 19 (REFLECTION          ):    192 bytes
Type 1B (DELEGATE_HEAD       ):   1188 bytes
Type 1D (OBJECT_TO_EVENT     ):    312 bytes
Type 1E (BINARY_BLOB_HEAD    ): 697608 bytes
Type 1F (THREAD              ):   1536 bytes
Type 20 (SUBTHREAD           ):    144 bytes
Type 21 (STACK_FRAME         ):   1644 bytes
Type 22 (TIMER_HEAD          ):     72 bytes
Type 23 (LOCK_HEAD           ):     60 bytes
Type 24 (LOCK_OWNER_HEAD     ):     24 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD):     48 bytes
Type 27 (FINALIZER_HEAD      ):    144 bytes
Type 31 (IO_PORT             ):    216 bytes
Type 34 (APPDOMAIN_HEAD      ):     72 bytes
Type 36 (APPDOMAIN_ASSEMBLY  ):   3828 bytes
GC: 24msec 766008 bytes used, 5525124 bytes available
Type 0F (STRING              ):   1476 bytes
Type 11 (CLASS               ):  18264 bytes
Type 12 (VALUETYPE           ):   1548 bytes
Type 13 (SZARRAY             ):   6432 bytes
  Type 03 (U1                  ):    252 bytes
  Type 04 (CHAR                ):    780 bytes
  Type 07 (I4                  ):   1044 bytes
  Type 0F (STRING              ):     60 bytes
  Type 11 (CLASS               ):   4212 bytes
  Type 12 (VALUETYPE           ):     84 bytes
Type 15 (FREEBLOCK           ): 5525124 bytes
Type 17 (ASSEMBLY            ):  31104 bytes
Type 18 (WEAKCLASS           ):     96 bytes
Type 19 (REFLECTION          ):    192 bytes
Type 1B (DELEGATE_HEAD       ):   1188 bytes
Type 1D (OBJECT_TO_EVENT     ):    312 bytes
Type 1E (BINARY_BLOB_HEAD    ): 697608 bytes
Type 1F (THREAD              ):   1536 bytes
Type 20 (SUBTHREAD           ):    144 bytes
Type 21 (STACK_FRAME         ):   1644 bytes
Type 22 (TIMER_HEAD          ):     72 bytes
Type 23 (LOCK_HEAD           ):     60 bytes
Type 24 (LOCK_OWNER_HEAD     ):     24 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD):     48 bytes
Type 27 (FINALIZER_HEAD      ):    144 bytes
Type 31 (IO_PORT             ):    216 bytes
Type 34 (APPDOMAIN_HEAD      ):     72 bytes
Type 36 (APPDOMAIN_ASSEMBLY  ):   3828 bytes


#5

I will try that tomorrow, I want to see if it will repro again tonight. If so, I’ll try your suggestion and if it no longer repros, that will be good info to know where the issue is.


#6

Actually, good point Mark13, but I wouldn’t have expected the GC churn to lead to an ASSERT. I would create the object outside ProgramStarted as well, since it’ll actually get GCed and you’ll lose the reference and might be no better off. Declare it in your Program class and that should hold it forever.

The GCs seem to stay consistent, so it seems that the churn isn’t because of a large obvious issue - but when idle and in relatively simple code like you have, I would have expected them not to come up at all.


#7

So I ran the app yesterday (without moving Random, so same code from my first post) before work and when I got home, it had the ASSERT. Debug output in VS looked the same as my first post (but less GC blocks).

Then I moved Random to be a class variable, ran the app, and let it sit overnight. This morning had the same ASSERT,same Debug output (only 5 GC blocks)

New code (with moved Random)…


using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation.Media;

namespace GadgeteerApp2
{
    public partial class Program
    {
        Random randomInt = new Random();

        void ProgramStarted()
        {
            display_TE35.SimpleGraphics.AutoRedraw = true;
            display_TE35.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchDown);
            display_TE35.WPFWindow.Invalidate();
        }

        void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
        {
            display_TE35.SimpleGraphics.Clear();
            display_TE35.SimpleGraphics.DisplayText("Lazlo v3.0 Started.", Resources.GetFont(Resources.FontResources.NinaB), Colors.Yellow, 0, 0);

            int redValue = randomInt.Next(254) + 1;
            int greenValue = randomInt.Next(254) + 1;
            int blueValue = randomInt.Next(254) + 1;
            
            multicolorLed.SetRedIntensity(redValue);
            multicolorLed.SetGreenIntensity(greenValue);
            multicolorLed.SetBlueIntensity(blueValue);

            string valueText = "Red: " + redValue + ", Blue: " + blueValue + ", Green: " + greenValue;
            Debug.Print(valueText);
            display_TE35.SimpleGraphics.DisplayText(valueText, 
                                                    Resources.GetFont(Resources.FontResources.NinaB),
                                                    ColorUtility.ColorFromRGB((byte)redValue, (byte)greenValue, (byte)blueValue), 0, 20);
        }
    }
}


#8

I’ve spent some more time on this. It doesn’t appear to have anything to do with Random object. After all the previous posts, I wrote another version without Random, and I still get the ASSERT. The code…


public partial class Program
    {
        void ProgramStarted()
        {
            display_TE35.SimpleGraphics.AutoRedraw = true;
            display_TE35.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchDown);
            display_TE35.WPFWindow.Invalidate();
        }

        void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
        {
            display_TE35.SimpleGraphics.Clear();
            display_TE35.SimpleGraphics.DisplayText("Lazlo v3.0 Started.", Resources.GetFont(Resources.FontResources.NinaB), Colors.Yellow, 0, 0);

            int redValue = 255;
            int greenValue = 255;
            int blueValue = 255;
            
            multicolorLed.SetRedIntensity(redValue);
            multicolorLed.SetGreenIntensity(greenValue);
            multicolorLed.SetBlueIntensity(blueValue);

            string valueText = "Red: " + redValue + ", Blue: " + blueValue + ", Green: " + greenValue;
            Debug.Print(valueText);
            display_TE35.SimpleGraphics.DisplayText(valueText, 
                                                    Resources.GetFont(Resources.FontResources.NinaB),
                                                    ColorUtility.ColorFromRGB((byte)redValue, (byte)greenValue, (byte)blueValue), 0, 20);
        }
    }

Also, in between trying this and that with this issue, I also spent some time playing with the LCD screen (drawing ellipses etc). I noticed that the touch events (especially up vs down) is somewhat erratic, not very consistent (as in, doesn’t always fire an event, or get just an up but never got a down, etc.). Also, the coordinates the touch events return seem to be sporadic as well, sometimes accurate, right where I touch, often in various other random places on the screen. I’ve checked the cables and made sure everything is plugged in good.

Is it possible that my LCD screen is having a problem of some sort?


#9

Not sure if anyone is paying attention to this thread, but I’ll keep posting anyways. :slight_smile:

So I shortened up the code to eliminate the multicolor LED, debug logging, and extra DisplayText line. Trying to narrow it down to the least amount of code needed. When I got home from work, there was another ASSERT using the following code.


    public partial class Program
    {
        void ProgramStarted()
        {
            display_TE35.SimpleGraphics.AutoRedraw = true;
            display_TE35.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchDown);
            display_TE35.WPFWindow.Invalidate();
        }

        void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
        {
            display_TE35.SimpleGraphics.Clear();

            int redValue = 255;
            int greenValue = 255;
            int blueValue = 255;

            string valueText = "Red: " + redValue + ", Blue: " + blueValue + ", Green: " + greenValue;

            display_TE35.SimpleGraphics.DisplayText(valueText, 
                                                    Resources.GetFont(Resources.FontResources.NinaB),
                                                    ColorUtility.ColorFromRGB((byte)redValue, (byte)greenValue, (byte)blueValue), 0, 20);
        }
    }

Tonight I’ll try the following to see if it repros…


    public partial class Program
    {
        void ProgramStarted()
        {
            display_TE35.SimpleGraphics.AutoRedraw = true;
            display_TE35.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchDown);
            display_TE35.WPFWindow.Invalidate();
        }

        void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
        {
            display_TE35.SimpleGraphics.Clear();
            display_TE35.SimpleGraphics.DisplayText("Hello World", 
                                                    Resources.GetFont(Resources.FontResources.NinaB),
                                                    Colors.Red, 0, 20);
        }
    }


#10

Yes we are keeping an eye on this but it still seem very random. Hopefully we can nail it down to a simple program that causes the assert on every device and every time.


#11

Thanks. Note this is 100% repro. Not sure what you mean by every device though. I only have the one Hydra and TE35 board (I also have multicolor LED but it’s now disconnected and no longer part of this scenario).

So yesterday I tried the below code and it reproed in like an hour or so. This is very fast, normally takes several hours.

I then tried removing the DisplayText() line (leaving just the Clear() line in the event handler method) and after all night it has not reproed. So the below code seems to be the minimal amount of code that reliably repros this.


    public partial class Program
    {
        void ProgramStarted()
        {
            display_TE35.SimpleGraphics.AutoRedraw = true;
            display_TE35.WPFWindow.TouchDown += new Microsoft.SPOT.Input.TouchEventHandler(WPFWindow_TouchDown);
            display_TE35.WPFWindow.Invalidate();
        }
 
        void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
        {
            display_TE35.SimpleGraphics.Clear();
            display_TE35.SimpleGraphics.DisplayText("Hello World", 
                                                    Resources.GetFont(Resources.FontResources.NinaB),
                                                    Colors.Red, 0, 20);
        }
    }


#12

Hello,

You mean if we run that code, about 1-2 hours, will that bug be happened without any touching? Or do we have to keep touching continuosly during 1-2 hours?
Sorry because we want to know the easiest way to reproduce that issue.
Thanks for your help.


#13

I only touch it once or twice after the program starts, just to trigger the TouchDown event so that “Hello World” appears on the screen. After that, I just leave it without touching it or anything.

Note, although the issue is 100% reproducible for me, the last time when it did it in like an hour or so, was the first time it did it that fast. Normally it does it after several hours while I’m at work or overnight while sleeping. There are no timestamps or anything, so not sure how long. Although, there are GC blocks (see original post) that keep appearing in the debug output window, if these run on a regular basis, it might indicate time frames? I think I typically get around 30-50 GC blocks before the ASSERT. The short one yesterday didn’t even produce 1 GC block.

Thanks for looking at this!


#14

Any luck on reproing this or anything?

Its kind of important to me, as it kind of ruins the point of having an LCD screen if it keeps displaying ASSERT on it. :slight_smile:

Here’s a bit more info if it helps…

So I got a new module from Justin and while trying it out, I had the TE35 plugged into the Hydra, but removed the TE35 from the designer. I compiled the below program and ran it. Justin’s module was running fine and I went to bed for the night and left it running all night. In the morning, there was an ASSERT on the screen. So I’m getting them without any TE35 code in my program, and while not even present in the designer. Also note, that when running this program, there were no GC blocks in the debug output.


namespace LedLevelScratch
{
    public partial class Program
    {  
        void ProgramStarted()
        {
            ledLevel.CylonLeds = 3;
            ledLevel.CylonSleep = 5;
            ledLevel.StartCylon();
        }
    }
}

One last thing I noticed. When the ASSERT is present, my app is still running, new method calls to clear the screen or draw something still work (tested with other programs, nothing to do with the sample code in this reply). So the ASSERT is not crashing/stopping my program.


#15

We were not able to repro, not a single time :frowning: Do you have a good power source?


#16

@ Hoss -

I tried to test it, the first time is about 2 hours, the second time is about 8 hours. My Hydra is still working. Only one thing we are not happy that is very hard to touch, but there is no ASSERT found.

And, you told us that you can see debug GC msg, does it mean you keep connecting with PC and VS2010 was running overnight?
We will try again.


#17

As i said in another thread, i will join the Hydra fan club and try my end…


#18

I have a USB Client SP Module v1.3 connected to my desktop PC. I also tried connecting it to a USB hub once and it still reproed.

Is it possible the TE35 or Hydra is bad? I ask because I’ve had other problems with it (see http://www.tinyclr.com/forum/topic?id=10752), which may or may not be related. I haven’t mentioned it yet (I was watching another thread from someone else with same issue), but I’ve had problems with the touch events. They are erratic and not accurate. I often get up events without down events and vice versa. Not saying its related, just possible more info.

So far I’ve not had much luck with Gadgeteer. I only have 3 modules though so really haven’t been able to try much. I just ordered 8 more modules from GHI last night, so maybe that may help identify or narrow down an issue?

Thanks for keeping up with this!


#19

Just FYI, but in my previous examples, I did see GC messages. In the latest example (where I didn’t have any display code or even have TE35 in the designer) though, there were no GC messages.

But yes, other than one time I tried it connected to a hub (where I still saw the problem), I’ve always had it connected to USB to PC and compile and run app from VS2010 Express and leave VS running while the app is running on the Hydra.

Note, it has reproed both when compiled as debug or as release.


#20

So, just to throw more info out there… (if I should start a separate topic for this, let me know)

While trying to play with the multicolorled I got an null reference exception in VS2010 when I touched the TE35 display by accident, which is plugged in and connected in the designer, but no code in program that was using it).

So I removed the multicolorled from the designer, unplugged it from the Hydra, and compiled and ran the below app (yes, it has no lines of code to run) and I get the same exception when I touch the screen…


    public partial class Program
    {  
        void ProgramStarted()
        {
        }
    }