Monday, April 25, 2005

Using a Custom SDK and Emulator with EVC

If you're not debugging on a physical device, you need a good emulator for testing code. In our case, our hardware spec still wasn't finished and a prototype wasn't close to being complete. But we did know that our 15" flat-panel display would run at 1024x768, which meant that the emulator default of 800x600 cut off a significant portion of our screen.

So we needed a custom emulator to run at that resolution. (We also needed it to handle the custom IOCTLs that we were sending, but that wouldn't come till later.) This shouldn't have been very hard to do, but as with all things just starting out, we didn't even know where to start troubleshooting because we didn't have a "known good" reference point.

Note: In my case, I had installed Platform Builder 4.2, then installed PB 5.0. When our SBC vendor told us that they only had a BSP for 4.2 I uninstalled version 5. This led to several wasted days of troubleshooting why coreroller.dll wasn't correctly registered, even after reinstalling v4.2. Moral of the story: don't try running 4.2 and 5.0 on the same system, as this search will attest to.

1. Make sure that you have a good platform and the Emulator Debug configuration is working.

Note: Make sure that in Platform Settings, for the emulator configuration, the Enable KITL option is unchecked! If you build a platform and export an SDK with this option turned on, eVC will not connect to the emulator unless Platform Builder is running and it can connect via KITL.

If you need to, rebuild the platform for that configuration.

2. Select Platform, Configure SDK... The SDK Roller will start in "Export SDK Wizard" mode. Run through the wizard and select the options for your platform. In our case we're using MFC for applications.

3. At the end of the wizard click Finish, but don't build the SDK yet. Select Platform, Configure SDK again, which now starts up the SDK Configuration Settings dialog. You may want to change some settings. For example, make sure that TCP/IP is the default transport. We wanted to mirror our device as closely as possible, so in the emulation tab we set the following:

  • Fixed screen resolution: width: 1024, height: 768, color: 16 (bits)
  • Memory: 64 (MB)

Note: If you plan on buildling multiple SDKs--we're on version 9 right now--you'll want to make sure to put the version number in the that the Platform name, and maybe even in the MSI file name setting. Otherwise, when you use Windows' uninstall applet, all of your SDKs in the uninstall list will have the exact same name.

4. When you've configured your settings, select Platform, Build SDK and watch it build (or work on something else if you're the industrious type). It should take a few minutes to build the MSI file and add the customized help, ending with this message:

MSI file construction completed. 0 error(s), 0 warning(s).

5. If you've been using eVC you should exit it now. The Platform Manager behaves strangely if you install an SDK while it's still running. Closing eVC usually terminates the Platform Manager as well, but after several bad experiences I always check-and-terminate cemgr.exe if it's still running. For good measure, I also exit Platform Builder.

6. Install the MSI file you created. It should take a few minutes, depending on which options you installed. When you restart eVC you'll see a new option in the Select Active WCE Configuration combo box of the WCE Platform toolbar (or select the Build, Set Active Platform menu). Rebuild your project under that platform and launch the emulator.

Note: If eVC fails to connect to the emulator you might need to reboot and restart eVC. Some people recommend always rebooting after installing an SDK, although I can usually get away without having to do that. If it still fails to connect, make sure that the KITL transport option is unchecked for your platform.

Another Note:The Platform Builder Help also has a step-by-step topic entitled Exporting an SDK.

Once we had our custom emulator up and running we never looked back. (For one thing, screen design was so much easier when we could see the entire screen!) Using the emulator made our development time so much faster. Even after we got our prototype, if we wanted to test the app, we would have to pull out the CF card from the hardware, copy the new executable to the card, put the card back into the prototype, reboot it, and run the app. Using the emulator meant that we could compile, download and run in a matter of seconds.

Last note: Compared with hardware, the emulator is of course slow, especially when debugging, but for quick testing it's more than adequate. Some of these eVC tips show how to get the most out of your emulator cycles.

6 Comments:

At 2/05/2007 3:41 AM, Anonymous Anonymous said...

best regards, nice info »

 
At 2/21/2007 8:54 AM, Anonymous Anonymous said...

Cool blog, interesting information... Keep it UP » » »

 
At 2/23/2007 3:24 PM, Anonymous Anonymous said...

www.mtechgraphics.com GRAPHIC KITS FROM ONLY $25 LOWEST PRICE ANYWHERE ONLINE AND OFFLINE THE LOWEST PRICE IN THE WORLD!!!!!! 11" X 90" KITS ARE ONLY $35 A SET HURRY UP LIMITED TIME ONLY!!!!!!!!!!!

 
At 1/24/2008 9:16 AM, Blogger Guna said...

hi i have a problem with WinCE6 connecting to the device.
For me it works fine with launching the emulator from OS Design project. But when i use my custom SDK(No KITL) the emulator launches but doesnt connects, after sometime it fails with RPC Server unavailable error?
any clues?

 
At 1/24/2008 9:39 AM, Blogger Guna said...

ok i got it running........actually it was OS failing somewhere.....


now the console window condirms this

 
At 2/02/2010 4:04 PM, Anonymous Anonymous said...

My friend and I were recently talking about the prevalence of technology in our day to day lives. Reading this post makes me think back to that discussion we had, and just how inseparable from electronics we have all become.


I don't mean this in a bad way, of course! Ethical concerns aside... I just hope that as the price of memory falls, the possibility of copying our memories onto a digital medium becomes a true reality. It's a fantasy that I dream about all the time.


(Posted on Nintendo DS running [url=http://kwstar88.zoomshare.com/2.shtml]R4 SDHC[/url] DS SPPost)

 

Post a Comment

<< Home