Wednesday, 30 September 2009

Windows Embedded CE 6.0 R3: Using Silverlight for Windows Embedded

Hi all,

in my previous post I promised to talk a little bit more about how to use Microsoft Silverlight 2 and the C++ based application development framework, which is called “Silverlight for Windows Embedded” on your Windows Embedded CE 6.0 R3 device.

First of all, you need to add support for Silverlight for Windows Embedded to your OSDesign. To do this you have to include the SYSGEN_XAML_RUNTIME variable to your OSDesign and rebuild your system.


If you also add the Silverlight for Windows Embedded sample application called “XamlPerf” (SYSGEN_SAMPLEXAMLPERF which is not available as a catalog item but needs to be set nevertheless in order to build the XamlPerf sample application) or the new “Internet Explorer 6.0 XAML UI Sample Browser” (SYSGEN_IESAMPLE_EXR) catalog item to your OSDesign, you already have sample programs that you can run on your device and examine.


The source code for the XamlPerf sample application and the XAML UI sample browser is located under _PUBLICROOT\COMMON\OAK\DEMOS\XAMLPERF and _PUBLICROOT\IE\OAK\IESAMPLE_EXR respectively.

Note: I will talk about XamlPerf and the new IE in separate posts, so stay tuned!

Now you have successfully included support for Silverlight for Windows Embedded to your platform and you are now ready to develop your Silverlight for Windows Embedded application as a subproject in your OSDesign.

The next step would be to think about whether or not you want to define the visual scene using a source XAML file. If so, you can either create that file by using Microsoft Silverlight 2 XAML, Microsoft Expression Blend 2 (Evaluation Version: http://download.microsoft.com/download/2/7/9/2798d28c-72b3-4231-a996-d9a7f1d56166/Blend_Trial_en.exe), or by programming XAML directly.

You should also think about which type of application based on Silverlight for Windows Embedded you want to build. Therefore it is necessary to identify (and of course add to your OSDesign) any additional SYSGEN variables and header files needed to build that particular application.

Once you have successfully created and built your OSDesign as well as established a connection from PlatformBuilder to your target device, you are ready to implement your actual Silverlight for Windows Embedded Application!

Valter Minute wrote a good tutorial on his blog about how to design a basic UI in Expression Blend 2, load it inside an application and interact with it.

For further information, have a look at the Windows Embedded CE 6.0 R3 help: “Create a Silverlight for Windows Embedded Application”.

Have fun!

14 comments:

Shai said...

Currently, your post is almost the only source of information.
But, you should update it as the actual release is a bit different than the version you have. After installing the actual release I do not have SYSGEN_SAMPLEXAMLPERF variable in my catalog. Also, the name for the SYSGEN_XAML_RUNTIME in the catalog is different ("Silverlight for Windows Embedded").

Thanks,
Shai

Jochen Dieckfoß said...

Hi Shai,

thanks a lot for your update. I also do not have the SYSGEN_SAMPLEXAMLPERF variable in my catalog. However, it needs to be set in order to build the XamlPerf sample application. I solved this problem by simply setting it manually as an environment variable in the Project->Properties dialog from within PlatformBuilder. I thought it would have been fixed in the RTM version but apparently it is not.
As for the SYSGEN_XAML_RUNTIME, thanks for the info, I will update the post later.
-Jochen

Shai said...

Thanks for the info. I solved it in the same manner by setting it manually. At least the documentation says to set it manually, so at least it is consistent. Though, it would have been nicer to have it in the catalog.

Shai

Valter Minute said...

I linked your article in my own Silverlight for Embedded tutorial to document how to add Silverlight for Embedded support to your OS Image.
http://geekswithblogs.net/WindowsEmbeddedCookbook/archive/2009/10/01/silverlight-for-embedded-tutorial.aspx
Thank you for providing such useful information

Jochen Dieckfoß said...

Hi Valter,

thanks for your useful tutorial, I also linked it to my post!

-Jochen

Anonymous said...

just installed the R3...the online installation is smooth. enabled silverlight, new iesample, xamlperf sample, gesture and connmgr. rebuilt my os image and loaded on my pxa320 device. result? xmalperf: launched and nothing happened. new iesample: can run but seems buggy on my 320x240 LCD. gesture: not working. connmgr: where is it? MS office: where is it? can not see it from catalog.

repost from http://blogs.msdn.com/mikehall/archive/2009/09/30/windows-embedded-ce-6-0-r3-released-to-web.aspx?CommentPosted=true#commentmessage

Jochen Dieckfoß said...

Hi,

thanks for your comment. XamlPerf needs a XAML file to run you can find 3 of them on your device under \Windows\XamlPerf. So either use the corresponding links on the desktop or call:
XamlPerf \windows\xamlperf\[XAMLFile].xaml.

The connectionion manager is basically an API that you can use from within your application. See today’s post for details.

The MS Office and PDF viewers as well as the QQ messenger are separate installation files which you can download from the Microsoft webpage . After you installed them, they will be in your catalog.

The new IESAMPLE_EXR comes with support for touch gestures if you have them included in your OSDesign. See my post about touch gestures or about the IESAMPLE_EXR for details.

-Jochen

PHILLLIU said...

HI

I have a question about silverlight to Wince .

I had saw another blog about how to do it ,but I do not understand how to use it.
Do you have another way to show operational steps ? thanks .

Damian Barnett said...

Hi PHILLLIU,
which steps exactly don't you understand?
From our point of view there are three main topics here:
1) Enabling Windows CE to support Silverlight for Windows Embedded
2) Creating the UI with Expression Blend 2 SP1
3) Writing(as I call it) the glue code for the target.

If you're having problems with 2) or 3) then have a look at Valters post here

If it's soemthing else you're having problems with, let us know, and we will se if we can post something around the issue.

Cheers!
Damian

PHILLLIU said...

HI Damian Barnett

Thanks your answer~
I can load silverlightSample to Wince 6.0 R3.
I lost a main.cpp for my case,so
I want to learn how to write a main.cpp for my case ,first.
Because,I do not understand it's rule.
Has it a fixed format ?

Thank you

clemente said...

Hello Jochen,
thanks a lot for your post! The Silverlight development framework is very exciting!
I'm be able to compile it in my BSP but I have a problem!

I modify the "config.bib" file adding the AUTOSIZE=YES key inside the CONFIG section, because at the end of the compilation there was an error like: the ROM size overlaps the RAM area.

After a succefull compilation, I receive this error downloding the NK.bin file to my board [1] :
...
Download Address=0x80200000 Length=0x20cc43c
BIN image type unknow
!OEMVERIFYMEMORY: Invalid image

Where am I wrong? Is my bootloader the problem? I'm in stuck!

TIA
Clemente.

[1] http://www.watterott.com/Mini2440-with-35-Color-LCD-Touch-Panel_1

Jochen Dieckfoß said...

Hi clemente,

thanks for your comment, I am glad you liked my post.

I think your problem is in your Config.bib file. AUTOSIZE (which should be set to ON or OFF) does not resolve any overlapping regions; it simply dedicates unused parts of your image (RAMIMAGE) to your RAM section see here.

However, it seems like you have dedicated not enough memory to your RAMIMAGE in the MEMORY section of your Config.bib. Simply increase the size of that region (e.g NK 80000000 02000000 RAMIMAGE) but be aware to change the start address of the adjacent region as well to avoid overlapping and possible overwriting. If your RAMIMAGE resides at the top of your memory, changing its size also involves changing its start address and of course the size of the adjacent regions as well.

Hope that helps
-Jochen

clemente said...

Hello Jochen,
thanks for your time!
I modify the config.bib file in this manner:

--- cut start
;
; [1] Original
;
;MEMORY
; NK 80200000 01e00000 RAMIMAGE
; RAM 82000000 01e00000 RAM
; FLASH 92000000 00100000 RESERVED

;
; [2] My config
;
MEMORY
NK 80200000 02400000 RAMIMAGE
RAM 82600000 01A00000 RAM
; FLASH 92000000 00100000 RESERVED
--- cut end

The compile process ends with success, but again in the download process I receive the same error:

Download Address=0x80200000 Lenght=0x20e2b74
BIN image type unknown
!OEMVERIFYMEMORY: Invalid image

I think the problem is the "supervivi" bootloader!

About the AUTOSIZE command, I think I'm in the right case, as you describe, because the output of the compilation was:

--- cut
Pass 2...

RAM AutoSize: RAM Start=822d0000 RAM Size=01b30000
Found pTOC at 0000156c
--- cut
Writing C:\WINCE600\OSDesigns\Mini2440\Mini2440\RelDir\Mini2440_ARMV4I_Release\NK.bin
Table of contents 822c9ba0 0000289c ( 10396)
Writing ROM signature and TOC pointer at 80200040
Kernel data copy section 81955dc4 00000020 ( 32)
ROM Header 822c9b4c 00000054 ( 84)
First DLL Address: 4001c001
Last DLL Address: 4190c0a1
Physical Start Address: 80200000
Physical End Address: 822cc43c
Start RAM: 822d0000
Start of free RAM: 822de000
End of RAM: 83e00000
Number of Modules: 219
Number of Copy Sections: 2
Copy Section Offset: 81955dc4
Kernel Flags: 00000002
FileSys 4K Chunks/Mbyte: 48 <2Mbyte 48 2-4Mbyte 0 4-6Mbyte 0 >6Mbyte
CPU Type: 01c2h
Miscellaneous Flags: 0002h
Extensions Pointer: 80201570
Total ROM size: 020cc43c ( 34391100)
Starting ip: 80201000
Raw files size: 00dad77e
Compressed files size: 0080ff2e
Compacting bin file...
Writing rom file...
--- cut end

Again Jochen thanks for your time.

Clemente.

Jochen Dieckfoß said...

Hi Clemente,

I think you are right, it seems like it is a problem with your “supervivi” bootloader. It seems like the image and the bootloader have to match. If possible, try downloading the matching bootloader to your board.

Thanks for the info on AUTOSIZE.

Good luck
-Jochen