First image
Hello, my name is David Shoemaker and I am one of the developers of Silverlight for Windows Embedded (SWE). In this blog entry I am going to walk you through the basic setup of the Windows Embedded Compact 7 CTP and getting your first SWE enabled image up and running.
I assume you have Visual Studio 2008 SP1, some flavor of Virtual PC*, Blend 3 and the CTP installed. If not, go back to the previous blog entry by David Franklin and install the CTP.
*For Windows 7 you can get XP Mode and Virtual PC from https://www.microsoft.com/windows/virtual-pc/download.aspx
Open Visual Studio (if this is the first time you have run VS with PB installed there will be some configuration dialogs about default settings).
- File -> New -> Project (I named mine Blog1)
- Project type = Platform Builder 2008
- Click the OK button which brings up the CE OS design wizard.
- [Next]
- BSP select the Virtual PC : x86 [Next]
- Design template = PDA Device -> Enterprise Web Pad [Next]
- Applications / Media (no changes) [Next]
- Network communications (no changes) [Next]
- OS Design Project Wizard Complete (Don't select "Build the following configuration after I click Finish") [Finish]
- Acknowledge any security warnings or license dialogs that come up.
You should now be in VS with the solution open. We didn't just build at the end of the wizard because we want to add a couple of things to the image before we build.
Select the Catalog Items View tab (if not visible you can use View -> Other Windows -> Catalog Items View).
Enter "Silverlight for Windows Embedded" into the search box and click the search button. This will bring you to the SWE options in the catalog. Open that and select the SWE checkbox. This brings in the SWE component for later use.
We are going to bring the xamlperf sample into the image to give us some instant gratification. As this sample is not in the catalog we need to add the sysgen flag manually.
- In VS select the solution explorer tab (Or Ctrl+Alt+L), right click on the project name (in my case the Blog1 name) and select properties.
- Configuration properties -> Environment
- New…
- Variable name = SYSGEN_SAMPLEXAMLPERF
- Value = 1
- Apply
- OK
To verify everything is set as expected you can do:
- Build -> Open Release Directory in Build Window.
- Set Sysgen [Enter]
- Look at the output and verify that sysgen_xaml_runtime=1 & sysgen_samplexamlperf=1 are set.
Now do a build. Build -> Build Solution (or F7) and wait a while. Depending on your machine this could take a while.
At the end of the build you will get output like:
BLDDEMO: BUILDMSG: Directory of C:\WINCE700\OSDesigns\Blog1\Blog1\RelDir\VirtualPC_x86_Release
BLDDEMO: BUILDMSG: 07/09/2010 11:52 AM 40,528,451 NK.bin
BLDDEMO: BUILDMSG: 1 File(s) 40,528,451 bytes
BLDDEMO: BUILDMSG: 0 Dir(s) 293,800,824,832 bytes free
BLDDEMO: BUILDMSG: cebase build complete.
BLDDEMO: BUILDMSG: BldDemo ended at 11:52:39.73 on Fri 07/09/2010 (exit code 0)
BuildLogs: BUILDMSG: Exiting: BldDemo1.bat (result code 0).
BuildLogs: BUILDMSG: C:\WINCE700\build.log
BuildLogs: BUILDMSG: C:\WINCE700\build.out
BuildLogs: BUILDMSG: C:\WINCE700\build.wrn
Blog1 - 0 error(s), 723 warning(s)
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
I am using virtual PC (Win Xp mode on Windows 7) so I need to create a virtual machine to be my target device.
- Start -> Windows Virtual PC
- Create virtual machine
- Name (I used VPC) [Next]
- Memory and networking [Next]
- Add a virtual hard disk
- Use an existing virtual hard disk (navigate to where in you installed the CTP)
- C:\wince700\platform\virtualpc\vm\hd0_sample.vhd (this comes with the CTP)
- [Create]
To use this from Platform Builder you need to make a connection in VS
- Start the virtual machine
- In VS, Target -> Connectivity Options…
- Add Device
- Name (I used VPC) [Add]
- Kernel Download -> [Settings] (this may bring up a firewall dialog, if so "Allow Access")
- This brings up a dialog which should detect the "Bootme's" from the virtual machine. Select the target device that shows up (mine was named "PC-0003FF10A48F" and [Apply]
- [Close]
- This takes you back to the VS main window. In the Device: Drop down on the toolbar select the connection you just made (VPC in my case).
We are now ready to download our first image.
- You will probably have to restart your VM as the bootme's have run out (only sends a fixed number before giving up).
- Then on the device toolbar press connect (the play symbol next to the dropdown).
- The Device Status window should appear and show the image downloading.
- Once that has finished the output window should show some debug spew about the boot process and then finally the VPC window should appear with your image loaded.
This has three samples (brought in by the SYSGEN_SAMPLEXAMLPERF sysgen).
Double Click Bounce, Bubbles or Carousel to see the samples in action. Clicking in the running app will close it.
We now have an image up and running which allows you to try out SWE applications.
Comments
Anonymous
August 03, 2010
Hi David, I followed your tutorial, but I had some problems during the download because this process was interrupted nine times out of ten, when it started to work. Has happened to you? Do you know the reason? I tried other times and it had always this behavior. thank you, MarcoAnonymous
September 07, 2010
Hey David, great Walkthrough, but I'm somehow stuck at the point where Visual Studio is suppossed to detect active devices. This list ist just blank and when I add the device name (PC-...) manually, it still doesn't connect. Might there something be wrong with my connectivity options or with the virtual machine's settings? Help would be appreciated. Thank you, DianaAnonymous
November 07, 2010
The comment has been removedAnonymous
December 13, 2010
Hi , if the boot failed I suggest you to delete all connections and follow the tutorial again,it should work. Don´t add the device manually it won´t work.Anonymous
February 03, 2011
Hi David! I wrote a kernel driver for CE 6 that just hooks CreateFile and I want to try it on WP7 but I don't know where to begin. It seems very silverlight centric. Should it even work? I am not even sure what the WP7 kernel is supposed to be =) It's so confusing. Can you please point me in the right direction for help? Thanks so much! Cynthia