Main Site Documentation

Problem with too many assemblies?


#1

Hi,

I am new to the Fez and to the MS Micro framework.

I have been able to run the simple console and blinky applications, however when I try to run a project with a few more assemblies (e.g the USB host demo) the program exits without reaching Main():

“The program ‘[6] Micro Framework application: Managed’ has exited with code 0 (0x0).”

This happens even if I run a working blinky project, and add a couple of assemblies that I don’t need (without even changing the code). It doesn’t appear to be a specific assembly causing the problem. It looks like some sort of memory problem, but the programs are actually pretty tiny.

Am I missing something obvious here?

Jon


#2

Hey Jon

I assume that you have updated your firmware. If not please look @


#3

I am not sure why many are missing the firmware update step! There is a large red alert pointing this out and we make it very clear in the “first power up” video.

The good news is that the production release is out now and all FEZ devices are now shipping with the productions release so there is no need for firmware update…for the next few months at least :slight_smile:


#4

Ok, that’ll teach me to dive forward before reading the (not so) fine print. It’s working now. Thanks for taking the time to answer such a dumb question.


#5

You are not the only one to miss it so this i snot a dumb problem at all. We are trying to see how can we come around this so it is more clear to new users :slight_smile:

We are ready for your next question :wink:


#6

The program ‘[x] Micro Framework application: Managed’ has exited with code 0 (0x0).

x= some number.

Is this a firmware update related issue? I’ve already updated my Fez to the Firmware that came with my SDK.

[quote]
ClrInfo.clrVersion: 4.0.1681.0
ClrInfo.clrVendorInfo: Microsoft Copyright © Microsoft Corporation. All rig
ClrInfo.targetFrameworkVersion: 4.0.1681.0
SolutionReleaseInfo.solutionVersion: 4.0.3.0
SolutionReleaseInfo.solutionVendorInfo: GHI Electronics, LLC
SoftwareVersion.BuildDate: May 21 2010
SoftwareVersion.CompilerVersion: 310739[/quote]


#7

Looks like you have the latest firmware so you are good to go.


#8

The program ‘[x] Micro Framework application: Managed’ has exited with code 0 (0x0).

So this is a code related error? Is this an error?


#9

It’s not an error, it means that your program has finished running the main() method. If you are doing something where you subscribed to USB events and don’t do anything more in main(), you need to add Thread.Sleep(timeout.infinite); to the end of the method, after your USB subscription code.


#10

I see, thanks for clarifying.


#11
public static void Main()
        {
            USBHostController.DeviceConnectedEvent += DeviceConnectedEvent;

            // Sleep forever 
            Thread.Sleep(Timeout.Infinite);
        }

        static void DeviceConnectedEvent(USBH_Device device)
        {
            Debug.Print("Device connected");

            switch (device.TYPE)
            {
                case USBH_DeviceType.Serial_FTDI: // FTDI connected 
                    Debug.Print("FTDI");

                    serialUSB = new USBH_SerialUSB(device, 115200, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
                    serialUSB.Open();

                    serialUSBThread = new Thread(SerialUSBThread);

                    serialUSBThread.Start();
                    break;
            }
        }

Stripped - down version of my USB host code. As you can see (and like chris told you) you should use

Thread.Sleep(Timeout.Infinite);

Good luck!


#12

I’ve got an idea to help make people remember to do their firmware updates.

In the signup for the forum, put a checkbox next to a big red alert image that says “I’ve updated my firmware and I’m not going to ask a question about a “problem” that is caused by me not updating my firmware” and a link to the video.

At least it’s the right point in time when people are thinking about their error and are signing up going to ask that question :slight_smile:


#13

I think that there to many different descriptions on how to get started. There are two different pdf’s and at least one video, maybe more? And when I set up my board I got the firmware update right, but missed the information regarding inclusion of assemblies, which I think differ a bit between these documents.

One way to solve the problem could be to ship the boards without firmware.

/Mats