Debug Emulation crash for Fez Cobra 480x272

This is a repost - from a seperate issue I am having with Glide, and thought it best to create a new thread for this.

Using Glide 1.0.0
NETMF 4.2
EMX 4.1.6.0

I also tried to run this on the emulator but I am getting the error

An unhandled exception of type ‘System.InvalidOperationException’ occurred in FEZCobra_GHIElectronics.NET.FEZ.dll

Additional information: FEZ Cobra not detected

I then was prompted in the ‘No source available’ tab
[ ] Always show dis assembly for missing source files
which I have now checked

When I then press continue I get a popup MSG:
Emulator
Error:Parameter is not valid

Then after a while the

popup:
Microsoft.SPOT.Emulator.Sample.SampleEmul… has stopped working
[Debug] [Close]

Any ideas? am I running the correct emulator for the Fez 480x272?

From Mike:
The GHI hardware libraries are not supported in the emulator. Remove all references to the GHI hardware, and only include the Glide library.

Hi Mike,

I removed the hardware, as suggested (and got a micro step further)

The emulator LCD size does not adapt to my 4.3" FEZ Cobra application size 480x272 (so I can only see the top left section of the screen.

The emulator does START correctly, but immediately after displaying my splash screen (with an image) I then get the following popup message.

Emulator:
Error: Parameter is not valid.

And can’t work out how to adapt the screen size, which I assume is why I am getting the error message.

I reviewed the C:\Program Files\Microsoft Device Emulator\1.0 chm file, but cant find a reference on how to resolve this.

Everyone:
Has anyone experienced this? and if so, resolved this issue?

Already searched ‘emulator’ and not discovered any other relevant posts.

TThe emulator doesn’t adapt to anything. Open up the sample emulator that cames w netmf. Change it to suit your needs. Hit compile. It will now be available from the drop down list when you select emulator.

I have finally worked out some of the issues …so here are some instructions for others to follow:

(feel free to correct these if they are incorrect)

  1. got C:\Program Files\Microsoft .NET Micro Framework\v4.1\Tools\ directory

  2. Make a backup copy of :
    Microsoft.SPOT.Emulator.Sample.SampleEmulator.exe.emulatorconfig

  3. Edit the above file in notepad or an XML editor

  4. change the following:


    <LcdDisplay id="mydisplay">
      <Width>320</Width>
      <Height>240</Height>
      <BitsPerPixel>16</BitsPerPixel>
    </LcdDisplay>
   

For Fez Cobra 480x272:


    <LcdDisplay id="mydisplay">
      <Width>480</Width>
      <Height>272</Height>
      <BitsPerPixel>16</BitsPerPixel>
    </LcdDisplay>
   

Optionally Add:


    <EmulatorSerialPort id="COM3">
      <ComPortHandle>Usart3</ComPortHandle>
    </EmulatorSerialPort>

    <EmulatorSerialPort id="COM4">
      <ComPortHandle>Usart4</ComPortHandle>
    </EmulatorSerialPort>
   

I would love to be able to select from a range of emulator devices when I configure the project properties \ .NET Micro Framework Transprot & Device settinsg instead of just seeing one device option ‘Microsoft Emulator’. Is this possible?

Now I have the screen on 480x272 in the Microsoft emulator, I started to test my GUI…
How do I emulate touch? The mouse click does not work
Is there something else to setup?

Some detailed instructions appreciated

I can’t saee any XMl ref’s to touch screen in :

Have you tried running a Microsoft example that uses touch with your modified emulator? Running the TouchCalibration worked for me. I also created a simple project that worked too. Make sure you call GlideTouch.Initialize(). Usually the first click enables touch (focus) then after it works.

Hi Josh,
I am running calibrate,
Can you advise what assemblies you are using?
I have removed NETMF.EMX, and FEZ.Cobra but let all the other SPOT references in place.

I was referring to the TouchCalibration sample provided by Microsoft.

C:\Users[b]YourUserName[/b]\Documents\Microsoft .NET Micro Framework 4.1\Samples\TouchCalibration

Here is the simple Glide project I ran in which touch worked on the emulator:

Thanks Josh,

I am able to get the mouse to emulate touch
That sample works fine under 480x272
Wish I had known all that sample code existed when I started out! might be good to have a note on the examples page to your helpful note.

Finally sorted why my mouse would not work during microsft emulation:

I had to remove the reference to Microsoft.SPOT.Touch

and disable the following code


//Microsoft.SPOT.Touch.Touch.ActiveTouchPanel.SetCalibration(CAL_POINTS, sx, sy, cx, cy);

Q: Is there a cleaner way to disable this line of code using #define statements ?