Windows CE: Using RAPI to Run Applications (Part 2)


 The CERunApp application can be downloaded from: 
 
 The CERunApp source code can be downloaded from: 
 
In Windows CE: Using RAPI to Run Applications (Part 1) I wrote about starting this project to create a copy of the Windows Mobile Developer Power Toys application RAPIStart. In this article I will continue by creating an slight twist on RAPIStart.
As I discussed in Part 1, I decided that simply reproducing RAPIStart wasn’t all that exciting, since the source code for a similar app is available in the Windows Mobile SDK. So in this article I will develop a GUI based application that not only starts an app on a Windows CE device from a connected workstation, but will also transfer the app to the device before running it. I will show the interesting code here, but the link at the top of this page leads you to the download of the code and the app itself.
Since this is a GUI based app, I developed it using C#.   This choice meant that I spent very little effort on the GUI and was able to focus on the RAPI pieces.
The user interface looks like this:
This simple dialog contains:
1.       A text box to enter the application to run on the Windows CE device
2.       A browse button that opens a System.Windows.Forms.OpenFileDialog to select a file
3.       A text box to enter command line options
4.       A button to request that the app be downloaded to and run on the Windows CE device
Simple enough, and it requires very little code to back it up if we ignore the RAPI bits. Basically there are two functions, one each for the buttons. That code is:
        private void FileBrowseButton_Click(object sender, EventArgs e)
        {
 
            if (DialogResult.OK == openFileDialog1.ShowDialog())
           {
                AppName.Text = openFileDialog1.FileName;
            }
        }
 
        private void RunApplicationButton_Click(object sender, EventArgs e)
        {
            CRapi RAPI = new CRapi();
 
            if(RAPI.CeCopyToDevice(AppName.Text, "\\" + openFileDialog1.SafeFileName))
                RAPI.CeRunApplication("\\" + openFileDialog1.SafeFileName, CommandLineOptions.Text);
            else
                System.Windows.Forms.MessageBox.Show("Unable to copy file to the Windows CE");
        }
The browse button handler, FileBrowseButton_Click(), simply calls on the OpenFileDialog class to show the dialog. If it succeeds, then fill in the text box with the file path and name.
The run applciation handler, RunApplicationButton_Click() uses a CRapi class that I will show next to copy the file to the Windows CE Device and then start the application.
The CRapi class is the meat of this application. It knows how to make a connection to the Windows CE device and then uses the connection to perform actions. To make a connection, I ported the code from the MSDN documentation for CeRapiInitEx(). The MSDN example includes a function named TryRapiConnect()which attempts to make a connection to the device. The ported code is:
    // Code from MSDN
    // Copied from C++ examle and converted to C#
    private uint TryRapiConnect(uint dwTimeOut)
    {
        uint hr = E_FAIL;
        bool fInitialized = false;
 
        RAPIINIT riCopy = new RAPIINIT();
        riCopy.cbsize = Marshal.SizeOf(riCopy);
        hr = CeRapiInitEx(ref riCopy);
 
        if (SUCCEEDED(hr))
        {
            uint dwRapiInit = 0;
            fInitialized = true;
 
            dwRapiInit = WaitForSingleObject(
                        riCopy.heRapiInit,
                        dwTimeOut);
            if (WAIT_OBJECT_0 == dwRapiInit)
            {
                // heRapiInit signaled:
                // set return error code to return value of RAPI Init function
                hr = riCopy.hrRapiInit;
            }
            else if (WAIT_TIMEOUT == dwRapiInit)
            {
                // timed out: device is probably not connected
                // or not responding
                hr = ERROR_TIMEOUT;
            }
            else
            {
                // WaitForSingleObject failed
                hr = (uint)Marshal.GetLastWin32Error();
            }
        }
 
        if (fInitialized && FAILED(hr))
        {
            CeRapiUninit();
        }
        if (!fInitialized || FAILED(hr))
            System.Windows.Forms.MessageBox.Show("Windows CE device does not appear to be connected");
 
        return hr;
    }
This function is a attempts to make a connection. It may not be able to because it either times out or an error occurs.
The code for copying the file uses the System.IO.BinaryReader class to read the application on the device and copies it to the device using CeCreateFile() and CeWriteFile().
    public bool CeCopyToDevice(string AppName, string FileName)
    {
        bool ReturnValue = false;
        uint RapiResult;
 
        if (!File.Exists(AppName))
            return false;
 
        RapiResult = TryRapiConnect(5000);
        if (SUCCEEDED(RapiResult))
        {
            BinaryReader DTFile =
                new BinaryReader(File.Open(AppName, FileMode.Open));
            System.IntPtr RemoteFile = CeCreateFile(FileName, GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);
            try
            {
                byte[] Buffer = new byte[1024];
                bool Done = false;
                int BytesWritten;
                int BytesRead;
                while (!Done)
                {
                    BytesRead = DTFile.Read(Buffer, 0, 1024);
                    if (BytesRead == 0)
                        Done = true;
                    else
                    {
                        CeWriteFile(RemoteFile, Buffer, BytesRead, out BytesWritten, 0);
                    }
                }
                ReturnValue = true;
            }
            finally
            {
                CeCloseHandle(RemoteFile);
                DTFile.Close();
            }
            CeRapiUninit();
        }
        return ReturnValue;
    }
You will notice that I chose to call TryRapiConnect()from this function rather than from the CRapi constructor. I can’t say that it is absolutely the right choice, but I did it because I didn’t want to hold the connection open any longer than necessary. ActiveSync connects can come and go, so my thinking here is the minimize the risk of lost connecting by just having it open when it is being used. This choice means that the code will need to open it again to start the application.
CeRunApplication()is used to start the application on the device. This function also calls TryRapiConnect()to make the connection, then uses CeCreateProcess() to start the application and pass in the command line parameters.
    public bool CeRunApplication(string AppName, string CommandLine)
    {
        bool ReturnValue = true;
        uint RapiResult;
 
        RapiResult = TryRapiConnect(5000);
        if (SUCCEEDED(RapiResult))
        {
            PROCESS_INFORMATION pi = new PROCESS_INFORMATION();
            if(CeCreateProcess(AppName, CommandLine, IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, ref pi))
            {
                CeCloseHandle(pi.hProcess);
                CeCloseHandle(pi.hThread);
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Failed to start application. Errorcode = " + CeGetLastError());
            }
            CeRapiUninit();
        }
        return ReturnValue;
    }
That’s it, well not completely because there are some supporting functions, data and structures. The rest of the code can be found in the code download at the top of this page.
This app does have some downsides. To use it to run an app on the device, the app must be on your workstation and must be downloaded first. As you can see in the picture of the dialog, I used it to run ipconfig within cmd.exe.   Cmd.exe had to be downloaded. The workaround for this is to use RAPIStart, or one of you enterprising developers may want to extend this to select an application that exists on the device instead of the workstation.

NOTE
There seems to be some question about how to run this application.  If you download the executable file, you will run it on your Windows XP/Vista/7 computer.  To do so, you will need the .NET Framework 2.0 or newer and have ActiveSync running and connected to your device.
If you download the source, you can of course change the .NET Framework version, but you will still run the app on your Windows XP/Vista/7 computer.
 
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Friday, October 30, 2009 3:24 PM | Feedback (2)

Windows CE: Using RAPI to Run Applications (Part 1)


A few months ago I downloaded the Windows Mobile Developer Power Toys (Download details: Windows Mobile Developer Power Toys) because I had a need for CERDISP, the Windows CE Remote Display tool. At that time, I looked around at the other tools that were installed and played with RAPIStart.exe. RAPIStart.exe is a command line tool that lets you start applications on your device from your workstation using ActiveSync. A handy little tool, so I made a note to try to reproduce it and write a little about RAPI.
I finally got to that point on my list and started writing my version of RAPIStart. Did a little research and started writing a command line tool using C. My research told me that to start an app on the device from a workstation I would need to call CeCreateProcess(). To call CeCreateProcess() we first need to call CeRapiInit() or CeRapiInitEx() to establish a connection to the device.
My research also told me that CeRapiInit() has a tendency to hang if the connection isn’t established, but CeRapiInitEx() is a little friendlier to use because it times out. MSDN even has some sample code for establishing the connection, so I used it. The example function is TryRapiConnect() and since it is available on MSDN, I won’t reproduce it here.
So I created a Visual Studio command line application project and pasted TryRapiConnect() into the file and called it from _tmain(). Being impatient, I tried to compile knowing that I hadn’t done anything to ensure that it compiles like including rapi.h. or set it to link with rapi.h. So it failed. Now the adventure begins. Where do I get rapi.h and rapi.lib.   A little searching on my hard disk and I found rapi.h in the Platform Builder files, but no rapi.lib. I thought that it must be available someplace other than the Windows Mobile SDK, but I didn’t find it anyplace else, so I downloaded the SDK and installed it.   Then set the includes and lib paths correctly and it builds.
The next step is to create a little test to start a hardcoded application, in this case my registry editor from Windows CE: Simple Little Registry Editor. Here is the code:
int _tmain(int argc, _TCHAR* argv[])
{
                HRESULT hr;
                PROCESS_INFORMATION pi;   
 
                hr = TryRapiConnect(5000);
                if( SUCCEEDED(hr) )
                {
                                if (!CeCreateProcess(_T("regedit.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, NULL, &pi))
                                {
                                                _tprintf( TEXT("Failed to start application (%d)\n"), CeGetLastError());
                                }
                                else
                                {
                                                CeCloseHandle( pi.hProcess);
                                                CeCloseHandle( pi.hThread);
                                }
                                CeRapiUninit();
                }
                return 0;
}
Simple enough and it starts my registry editor when it runs. The next step is to handle the command line arguments for the application name and parameters.
But wait a minute, why am I wasting time developing a command line tool? Did I mention that the source code for a similar tool is available in the Windows Mobile SDK? Why start an app that is already on the device, RAPIStart does that already?
Why write a blog about this? Well it answers a few questions on how to get started, and it shows some C code for using RAPI.
Next step, write a C# GUI app – See Part 2 at Windows CE: Using RAPI to Run Applications (Part 2)
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Thursday, October 29, 2009 2:48 PM | Feedback (0)

Windows CE Chat Transcript (October 27, 2009)


 For those of you who missed the chat today, here is the raw transcript.   By raw, I mean that I copied and pasted the discussion without any edits. This is divided into two parts, the top part is the answers from the Microsoft Experts and the bottom part is the discuss (questions) from the audience.
Answers from Microsoft:
KarelD_MSFT (Expert)[2009-10-27 11:58]: Karel Danihelka - Developer in Partner Response Team.
davbo_msft (Moderator)[2009-10-27 11:59]: Our chat today covers the topic of Windows Embedded CE & Windows Mobile!

1. This chat will last for one hour. During this hour, our Experts will respond to as many questions as they can. Please understand that there may be some questions we cannot respond to due to lack of information or because the information is not yet public.

2. We encourage you to submit questions for our Experts. To do so, type your questions in the send box, select the “ask the Experts” box and click SEND. Questions sent directly to the Guest Chat room will not be answered by the Experts, but we encourage other community members to assist.

3. We ask that you stay on topic for the duration of the chat. This helps the Guests and Experts follow the conversation more easily. We invite you to ask off topic questions after this chat is over, but not during.

4. Please abide by the Chat Code of Conduct.
Chat code of conduct: <http://msdn.microsoft.com/chats/chatroom.aspx?ctl=hlp#Conduct><BR< a>>
davbo_msft (Moderator)[2009-10-27 11:59]: We are pleased to welcome our Experts for today’s chat. I will have them introduce themselves now.
davbo_msft (Moderator)[2009-10-27 11:59]: We are pleased to welcome our Experts for today’s chat. I will have them introduce themselves now.
Sing Wee[MS] (Expert)[2009-10-27 12:0]: Hi, I'm Sing Wee, part of the CoreOS/BSP Test Team.
rajran[MS] (Expert)[2009-10-27 12:1]: Hi , I am Rajeev Rangappa, PM in CoreOS team.
RajeevDubey[MS] (Expert)[2009-10-27 12:3]: Hi, I am Rajeev Dubey, Bluetooth Program Manager.
MariNe_MSFT (Expert)[2009-10-27 12:3]: My name is Mariana Nenova - SDET in the Shell team.
MikeThom [MS] (Expert)[2009-10-27 12:3]: Hi I am Mike Thomson, Group Manager from Windows Embedded CE
Sue Loh [MS] (Moderator)[2009-10-27 12:3]: Hi, I'm Sue Loh, a developer on the Windows Mobile tools team (with past experience on the kernel and file system). I hope we can answer some of your questions today!
FBLANQ_MSFT (Expert)[2009-10-27 12:3]: Hi, I'm Francisco Blanquicet, part of the CoreOS/BSP team.
mskim_MS (Expert)[2009-10-27 12:4]:
Q: Regarding Silverlight Runtime in R3 and Expression Blend 2 - Expression Blend 2 appears to be unable to cope with the CacheMode="BitmapCache" tag that's needed for off-screen rendering in the silverlight runtime. Am I doing something wrong?
A: Andrew, CacheMode is from Silverlight3, we added this feature into Cashemere for a better performance but Expression Blend2 doesn't know about this SL3 property.
GLanger_MS (Expert)[2009-10-27 12:5]: Hi, I'm Glen Langer, lead PM for Core and BSPs.
kurtken_msft (Expert)[2009-10-27 12:6]:
Q: Can you point me to any documentation on the "threaded" SMS-message view in tmail.exe; I am having trouble adding my custom context-menu extension to it
A: Are your referring to the Windows Mobile SMS application? This chat is for Windows CE.
MS_Dinglu (Expert)[2009-10-27 12:7]: Hi, I am Dingding Lu, I am in CoreOS/BSP test team
mskim_MS (Expert)[2009-10-27 12:7]:
Q: So if I use Blend 3 will this help or just cause more problems?
A: You can't use Expression 3 with Cashmere, please use Blend2. You will need to add CacheMode only for the device XAML not in Blend2 XAML.
kurtken_msft (Expert)[2009-10-27 12:8]:
Q: Regarding mdd/pdd flash driver. There is some blocks that the MDD allocates for managing the data. Is it save to backup and recover those blocks? Where can we get info about them?
A: Can you give more information on what it is you are trying to do? The MDD's management of blocks is opaque because if it ever changes the only updates will be internal. is there a reason you need to access the internal structures?
Sue Loh [MS] (Moderator)[2009-10-27 12:8]:
Q: Hi! We are developing an app for a new handset running WM6.5 and are having problems when starting up first time. We are built into image and start up at boot since we have set correct reg keys in HKLM\Init. But one test case fails, namely to get reg notif
A: Can you explain a bit better what you mean by your test case fails to get reg notif? Who is supposed to change the registry key, when? Who is waiting on it, when?
kurtken_msft (Expert)[2009-10-27 12:9]:
Q: Hi! We are developing an app for a new handset running WM6.5 and are having problems when starting up first time. We are built into image and start up at boot since we have set correct reg keys in HKLM\Init. But one test case fails, namely to get reg notif
A: Hi Simon. This chat is for windows CE, and does not cover windows Mobile. The best thing for you to do is contact your WM representative that licenses WM to you to get support.
MikeThom [MS] (Expert)[2009-10-27 12:9]:
Q: Does Wince6.0 R3 include iPOD support?
A: No. There is no integrated support in Windows Embedded CE. There is an automative kit that does supply support for head-units.
KarelD_MSFT (Expert)[2009-10-27 11:58]: Karel Danihelka - Developer in Partner Response Team.
davbo_msft (Moderator)[2009-10-27 11:59]: Our chat today covers the topic of Windows Embedded CE & Windows Mobile!

1. This chat will last for one hour. During this hour, our Experts will respond to as many questions as they can. Please understand that there may be some questions we cannot respond to due to lack of information or because the information is not yet public.

2. We encourage you to submit questions for our Experts. To do so, type your questions in the send box, select the “ask the Experts” box and click SEND. Questions sent directly to the Guest Chat room will not be answered by the Experts, but we encourage other community members to assist.

3. We ask that you stay on topic for the duration of the chat. This helps the Guests and Experts follow the conversation more easily. We invite you to ask off topic questions after this chat is over, but not during.

4. Please abide by the Chat Code of Conduct.
Chat code of conduct: <http://msdn.microsoft.com/chats/chatroom.aspx?ctl=hlp#Conduct><BR< a>>
davbo_msft (Moderator)[2009-10-27 11:59]: We are pleased to welcome our Experts for today’s chat. I will have them introduce themselves now.
davbo_msft (Moderator)[2009-10-27 11:59]: We are pleased to welcome our Experts for today’s chat. I will have them introduce themselves now.
Sing Wee[MS] (Expert)[2009-10-27 12:0]: Hi, I'm Sing Wee, part of the CoreOS/BSP Test Team.
rajran[MS] (Expert)[2009-10-27 12:1]: Hi , I am Rajeev Rangappa, PM in CoreOS team.
RajeevDubey[MS] (Expert)[2009-10-27 12:3]: Hi, I am Rajeev Dubey, Bluetooth Program Manager.
MariNe_MSFT (Expert)[2009-10-27 12:3]: My name is Mariana Nenova - SDET in the Shell team.
MikeThom [MS] (Expert)[2009-10-27 12:3]: Hi I am Mike Thomson, Group Manager from Windows Embedded CE
Sue Loh [MS] (Moderator)[2009-10-27 12:3]: Hi, I'm Sue Loh, a developer on the Windows Mobile tools team (with past experience on the kernel and file system). I hope we can answer some of your questions today!
FBLANQ_MSFT (Expert)[2009-10-27 12:3]: Hi, I'm Francisco Blanquicet, part of the CoreOS/BSP team.
mskim_MS (Expert)[2009-10-27 12:4]:
Q: Regarding Silverlight Runtime in R3 and Expression Blend 2 - Expression Blend 2 appears to be unable to cope with the CacheMode="BitmapCache" tag that's needed for off-screen rendering in the silverlight runtime. Am I doing something wrong?
A: Andrew, CacheMode is from Silverlight3, we added this feature into Cashemere for a better performance but Expression Blend2 doesn't know about this SL3 property.
GLanger_MS (Expert)[2009-10-27 12:5]: Hi, I'm Glen Langer, lead PM for Core and BSPs.
kurtken_msft (Expert)[2009-10-27 12:6]:
Q: Can you point me to any documentation on the "threaded" SMS-message view in tmail.exe; I am having trouble adding my custom context-menu extension to it
A: Are your referring to the Windows Mobile SMS application? This chat is for Windows CE.
MS_Dinglu (Expert)[2009-10-27 12:7]: Hi, I am Dingding Lu, I am in CoreOS/BSP test team
mskim_MS (Expert)[2009-10-27 12:7]:
Q: So if I use Blend 3 will this help or just cause more problems?
A: You can't use Expression 3 with Cashmere, please use Blend2. You will need to add CacheMode only for the device XAML not in Blend2 XAML.
kurtken_msft (Expert)[2009-10-27 12:8]:
Q: Regarding mdd/pdd flash driver. There is some blocks that the MDD allocates for managing the data. Is it save to backup and recover those blocks? Where can we get info about them?
A: Can you give more information on what it is you are trying to do? The MDD's management of blocks is opaque because if it ever changes the only updates will be internal. is there a reason you need to access the internal structures?
Sue Loh [MS] (Moderator)[2009-10-27 12:8]:
Q: Hi! We are developing an app for a new handset running WM6.5 and are having problems when starting up first time. We are built into image and start up at boot since we have set correct reg keys in HKLM\Init. But one test case fails, namely to get reg notif
A: Can you explain a bit better what you mean by your test case fails to get reg notif? Who is supposed to change the registry key, when? Who is waiting on it, when?
kurtken_msft (Expert)[2009-10-27 12:9]:
Q: Hi! We are developing an app for a new handset running WM6.5 and are having problems when starting up first time. We are built into image and start up at boot since we have set correct reg keys in HKLM\Init. But one test case fails, namely to get reg notif
A: Hi Simon. This chat is for windows CE, and does not cover windows Mobile. The best thing for you to do is contact your WM representative that licenses WM to you to get support.
MikeThom [MS] (Expert)[2009-10-27 12:9]:
Q: Does Wince6.0 R3 include iPOD support?
A: No. There is no integrated support in Windows Embedded CE. There is an automative kit that does supply support for head-units.
KarelD_MSFT (Expert)[2009-10-27 12:9]:
Q: Regarding mdd/pdd flash driver. There is some blocks that the MDD allocates for managing the data. Is it save to backup and recover those blocks? Where can we get info about them?
A: It depends what do you want to achieve, but in most cases answer will be no. I would recommend to backup flash volume on logical level, not physical one. So file can be restored on different flash (with different bad blocks etc).
kurtken_msft (Expert)[2009-10-27 12:9]:
Q: Does Wince6.0 R3 include iPOD support?
A: When you say "support" do you mean being able to connect an IPod to a Windows CE 6.0 device that has USB host support?
kurtken_msft (Expert)[2009-10-27 12:9]:
Q: Yes, I am referring to Windows Mobile SMS application. I thought this chat includes Windows Mobile topics. Sorry, if that is not the case.
A: No. please contact your support channels for windows mobile through your WM licensing representative.
mskim_MS (Expert)[2009-10-27 12:10]: Tom, please use the "Ask Expert" command so we can answer your question.
Sue Loh [MS] (Moderator)[2009-10-27 12:11]: Q: We listen for changes to HKLM\System\State\Phone , "Missed Call Count" however at this first start up we never get such notifications. Rebooting will make it work as expected. Any ideas why it does not work the first time?
A: You're saying the entire first boot, you never get notifications. Right? Not that you miss the very first notification of the very first boot, and everything else works after that. Assuming I got it right -- well you need a registry key in order to wait. Are you sure the key exists at first?
Sue Loh [MS] (Moderator)[2009-10-27 12:11]:
Q: We listen for changes to HKLM\System\State\Phone "Missed Call Count", however at this first start up we never get such notifs. Rebooting will make it work as expected.
A: You're saying the entire first boot, you never get notifications. Right? Not that you miss the very first notification of the very first boot, and everything else works after that. Assuming I got it right -- well you need a registry key in order to wait. Are you sure the key exists at first?
KarelD_MSFT (Expert)[2009-10-27 12:13]:
Q: Does Wince6.0 R3 include iPOD support?
A: iPod expose itself as normal block device and as such it is supported. If you are looking for stream interface there is support in Microsoft Windows CE for Automotive, but you can add support yourself if you are able to get agreement from Apple and authentication chip.
davbo_msft (Moderator)[2009-10-27 12:13]:
Q: Actually, the title of this was presented as "Windows Embedded CE AND Windows Mobile", so that is not the case then?
 
A: I will have someone from the QFE team look into this.
Sue Loh [MS] (Moderator): Sorry hoongyuin, we're only experts in Windows CE, not desktop Windows.
Q: [16] Morning, I have a question regarding the Sept QFE '09 which causes ActiveSync issues I posted but got no answer? I am seeing more people posting on similar issue and on CE6.0 as well do you have any more info on this issue?
A: I will have someone from the QFE team look into this.
Q: [18] Hello, I have a CSR bluetooth module to manage under WinCE and I would like to use the HCI_CustomCode to send some proprietary commands. Please could you tell me how to fill pcall for HCI_CustomCode (I did not found in msdn documentation)
A: Hi Butterfly, Please email me your request and I will get back to you after reviewing it with our dev team. Please provide an example of what you are trying to accomplish so we can address your concern properly.
Q: [19] I´m already referring to the logical blocks. I want to know how to I get back to a "last well known" state backup of the filesystem (I´m using TExFAT). I am having filesystem corruptions due to hard power loss cycles.
A: Correct procedure in such situation is dismount all file systems from block device, erase, create partitions and write sectors from backup.
Q: [20] XAML Runtime Open GL Render Plugin: As shipped this supports OPENGL ES 2.0. My hardware has ES 1.1 support. Does the render plugin *NEED* any ES 2.0 features or should it be possible to convert the plugin for ES 1.1?
A: Andrew, this XAML renderer plug-in uses OpenGL ES 2.0 features. Since the plug-in is provided as public code, you can take a look at it.
Q: [22] Thank you RajeevDubey but at which address, can I email ?
A: rajeevdu@microsoft.com
Q: [20] XAML Runtime Open GL Render Plugin: As shipped this supports OPENGL ES 2.0. My hardware has ES 1.1 support. Does the render plugin *NEED* any ES 2.0 features or should it be possible to convert the plugin for ES 1.1?
A: One of the ES 2.0 feature EXR uses is the Shader.
Q: [24] Nothing in reg tree missing except actual value name="Missed call count" as defined in snapi.h. HKCU\System\State\Phone key is present
A: Hmm, if your code is successfully opening the key and holding a notification handle on it, and that notification handle isn't getting notified when the value is created, then that sounds like a bug. The only thing you could do about it is get in touch with our support. If it really is a bug then the support cost is supposed to be free, I believe (but you might want to double check). I would double check that your code is successfully opening these handles, just in case HKLM\System\State\Phone is getting created AFTER your code runs.
Q: [25] Thank you, I email you my request about HCI_CustomCode.
A: I have not received your mail yet. Will confirm once I get it.
Q: [26] I saw a question last month about if FMD_WriteSector() fails on NAND, and I was unclear about one point. After compation, does the FAL mark the block as bad, or try to erase it and reuse it? Same behavior for Flash MDD?
A: when a writesector fails, no attempt to write to the block will occur after that. As far as I know, this includes an erase attempt. The block may be read from, but will not be written to. if compaction moves the sectors out of the block that is now 'bad', then that block will not be used again even for reads.
Q: [32, 34] Is there a suitable version of conmanclient2 for ce 6 with two VS2005 running at the same time (One with PB and another one in app dev mode)? I get many edm.exe messages in PB when doing with the version from standard sdk 5 of conmanclient2?
(I´m debugging an application that tests the driver)
A: Is your application native or managed?
Q: [21] Using Windows Media Player Settings.setMode, what is the proper way to call it without it returning a E_INVALIDARG? When I call it with BSTR mode = L"shuffle" (mode, FALSE) or (mode, TRUE), they both return an error and indicates 0x80070057 => E_INVALIDAR
A: WMP OCX 7.0 http://msdn.microsoft.com/en-us/library/bb821536.aspx. I don't see setMode exposed on the interface. For Shuffle you'd need to implement that outside of the OCX.
Q: [35] EXR OGLES2.0: What processor did you use to test the XAML OGL Render plugin? It would be good for us to test the EXR with Open GL without having to recode for OGL ES 1.1.
A: We have tested the OGL plug-in with TI OMAP 3530 and nVidea Tegra APX 2600 but also knows that it works with many other platforms.
Q: [23] G. I am calling it via aninstance of IWMPSettings->setMode(mode, bValue);
A: OCX 7 IWMPSettings Interface http://msdn.microsoft.com/en-us/library/bb821471.aspx - setMode not a supported method.
Q: [9] We listen for changes to HKLM\System\State\Phone "Missed Call Count", however at this first start up we never get such notifs. Rebooting will make it work as expected.
A: Yeah, I'd expect HKLM\System\State and its sub-keys to be created sometime during the first boot. Unfortunately there's no way to auto-attach an application debugger during device boot. I would probably try writing a simple log, like you say. You could also revise your code to fall back to waiting on HKLM\System if the "State" and "Phone" keys don't exist. Or to try creating the keys instead of just opening them.
Q: [30] So there is a possibility that those reg keys are in fact not created yet? Is there any good way to attach/debug such situations? (other than file logging)
A: [re-posting to correct message on the conversation] Yeah, I'd expect HKLM\System\State and its sub-keys to be created sometime during the first boot. Unfortunately there's no way to auto-attach an application debugger during device boot. I would probably try writing a simple log, like you say. You could also revise your code to fall back to waiting on HKLM\System if the "State" and "Phone" keys don't exist. Or to try creating the keys instead of just opening them.
Q: [37] EXR: Are there advantages using the OGL renderer rather that the DirectDraw renderer? Or do they give equivalent functionality and performance?
A: It all depends on the platform implementation however there's no advantage on any technology for this plug-in.
Q: [38] native
A: Hi Marcelovk, I'm not an expert in this area, but I have a tutorial from a previous public presentation that showed this should indeed work. Could you private message me your email address, and I'll email the tutorial to you.
Q: [40] Did you receive my e-mail?
A: Yes, just got it.
Q: [44] In Wince 6.0 is there a speech recognition engine?
A: Microsoft Auto includes a speech engine - http://www.microsoft.com/auto
Q: [44] In Wince 6.0 is there a speech recognition engine?
A: SAPI 5.2 is included in CE 6. You can find more information from here http://download.microsoft.com/download/a/0/9/a09e587c-4ff9-4a58-a854-56fe50b862b2/release%20notes.htm
Q: [31, 33] On our device we have 2GB NAND flash and we have four partitions (Binary with ULDR, NK, OS, Storage). The Storage partition (USERSTORE, initially empty) should allocate the the whole NAND flash after the OS partition
What are the right configuration entries in memory.cfg.xml to get a Storage partition of 2GB (minus other partitions)?
A: I would try something like:

<ULDR ID="ULDR" STORAGE_ID="FLASH"/>
<RAMIMAGE ID="NK" STORAGE_ID="FLASH" COMPRESS="0" FIXUP_ADDRESS="0x80000000" ROMFLAGS="2" FSRAMPERCENT="0x00000000" FREE_SPACE_BUFFER="0x40000" />
<IMGFS ID="OS" STORAGE_ID="FLASH" FREE_SPACE_BUFFER="0x3200000" />
<USERSTORE STORAGE_ID="FLASH" ID="Storage" PART_TYPE="0x02" />

I have also sent feedback to our documentation team that there needs to be more guidance here.
Q: [44] In Wince 6.0 is there a speech recognition engine?
A: Found another MSDN link on the SAPI 5.0 http://msdn.microsoft.com/en-us/library/aa914072.aspx
Q: [50] hi i have just bought a new laptop with vista however im trying to setup a wireless network ive enterd my wep key etc. . but when i click connect a grey box pops up asking me to enter my credintals ( user name, password and logon domain) can you help me ?
A: Sorry, this particular chat is for Windows CE only.
davbo_msft (Moderator)[12:57]: Hello everyone, we are just about out of time.

Thank you for joining us for our Windows Embedded CE 6.0 chat today!

<http://www.Microsoft.com/Embedded>;

A special thank you to the product group members for coming out.

The transcript of today’s chat will be posted online as soon as possible, to <http://msdn.microsoft.com/en-us/chats>;. We’ll see you again for another chat next month. Please check <http://msdn.microsoft.com/en-us/chats>; for the list of upcoming chats.

If you still have unanswered questions, let me suggest that you post them on one of our newsgroups on
<http://msdn.microsoft.com/en-us/windowsembedded/ce/default.aspx>

-Windows
Embedded CE 6.0 R3 Now Available! <http://msdn.microsoft.com/windowsembedded/ce/dd630616.aspx>;
davbo_msft (Moderator)[12:58]: Any unanswered questions I will work to get answers and post with the transcript.
Q: [38] native
A: (From private message conversation, in case others are interested): Since this is native, is there any reason you need to use two instances of VS2005? Why not include the application as a subproject of the OS design?
mskim_MS (Expert)[13:01]: Andrew, please send email to mskim@microsoft.com for your VFP question on EXR, I will let you know.
Q: [53] NOOO!, the transcript takes years to be available!!
A: I've worked w/ the Chat posting team and they should get posted faster now.
Q: [41] Looking at the SDBus I saw that you never put in HighSpeed Mode the SD card?Is it supported by the stack the high speed mode for the SD card compliant with the spec ver 1.10 and higher?
A: According to some documents I've seen, CE6.0 RTM should support SD v1.1, CE6.0 R2 should support SD v2.0 (ADMA). On the MMC-side, we're supporting 3.x.
Q: [26] I saw a question last month about if FMD_WriteSector() fails on NAND, and I was unclear about one point. After compation, does the FAL mark the block as bad, or try to erase it and reuse it? Same behavior for Flash MDD?
A: If we are talking about flash abstraction library which shipped with Windows CE 6.0 R2 (flashcommon.lib and other) you don't need to. The Flash MDD will do it.
Q: [28] How can I disable the memory pooling for a specific driver in Windows CE 6.0?
A: By "pooling" I presume you mean paging of the driver code. You have a couple of ways to do it: set the "M" flag on the driver in your .bib file, if the driver is in ROM. Make sure NOT to set bit 2 (DEVFLAGS_LOADLIBRARY) of the "flags" registry value, under the driver registry settings. Or call LoadDriver on it instead of LoadLibrary, if you're loading it programmatically. This blog post is on the OPPOSITE topic, but still has tips you can follow if you do the opposite of what it's saying. http://blogs.msdn.com/ce_base/archive/2008/02/28/making-sections-of-windows-ce-device-driver-code-non-pageable.aspx
Q: [43] In Wince 6.0 is there a way to disable the memory pooling for the Storage Card?If yes how is it possible?
A: By "pooling" I presume you mean paging of the driver code. You have a couple of ways to do it: set the "M" flag on the driver in your .bib file, if the driver is in ROM. Make sure NOT to set bit 2 (DEVFLAGS_LOADLIBRARY) of the "flags" registry value, under the driver registry settings. Or call LoadDriver on it instead of LoadLibrary, if you're loading it programmatically. This blog post is on the OPPOSITE topic, but still has tips you can follow if you do the opposite of what it's saying. http://blogs.msdn.com/ce_base/archive/2008/02/28/making-sections-of-windows-ce-device-driver-code-non-pageable.aspx
Q: [46] EXR: Our ARM 11 platform has VFP which we have enabled through the OEM Floating Point CRT support (SYSGEN_OEM_FPCRT). Will this mean that the embedded XAML runtime will utilise the hardware floating point coprocessor? Or is it entirely integer based?
A: It will make use of the VFP enabled CRT.
Q: [56] Yes SD 1.1 and 2.0 are supported but not in high speed mode. Look at the SDBus implementation and let me know..
A: I just found the answer. Unfortunately, it appears we don't support High Speed in CE6.0 and its variants.
 
The Questions:
 
davbo_msft (Moderator)[2009-10-27 11:25]: Our chat today covers the topic of Windows Embedded CE & Windows Mobile!

1. This chat will last for one hour. During this hour, our Experts will respond to as many questions as they can. Please understand that there may be some questions we cannot respond to due to lack of information or because the information is not yet public.

2. We encourage you to submit questions for our Experts. To do so, type your questions in the send box, select the “ask the Experts” box and click SEND. Questions sent directly to the Guest Chat room will not be answered by the Experts, but we encourage other community members to assist.

3. We ask that you stay on topic for the duration of the chat. This helps the Guests and Experts follow the conversation more easily. We invite you to ask off topic questions after this chat is over, but not during.

4. Please abide by the Chat Code of Conduct.
Chat code of conduct: <http://msdn.microsoft.com/chats/chatroom.aspx?ctl=hlp#Conduct>;
frusturated (Guest)[2009-10-27 11:28]: hi
frusturated (Guest)[2009-10-27 11:28]: anyone arounmd?
Azhar (Guest)[2009-10-27 11:30]: Can anyone help me regarding windows vista basic issue
frusturated (Guest)[2009-10-27 11:31]: need help on network crap for windows 7
davbo_msft (Moderator)[2009-10-27 11:37]: This chat starts at 9am Pacific and covers Windows CE Embedded. For Windows 7 & Vista help refer to http://msdn.microsoft.com/en-us/windows/default.aspx
davbo_msft (Moderator)[2009-10-27 11:38]: http://www.microsoft.com/embedded
Ionut Lazar (Guest)[2009-10-27 11:48]: Hello!
Jakerlton (Guest)[2009-10-27 11:51]: Greetings.
davbo_msft (Moderator)[2009-10-27 11:53]: We are pleased to welcome our Experts for today’s chat. I will have them introduce themselves now.

Chat will begin in a couple of minutes.

<http://www.Microsoft.com/Embedded>;
davbo_msft (Moderator)[2009-10-27 11:54]: Dave Boyce - Multimedia Group for Windows CE & Chat Moderator.
Andrew at Plextek (Guest)[2009-10-27 12:0]:
Q: Regarding Silverlight Runtime in R3 and Expression Blend 2 - Expression Blend 2 appears to be unable to cope with the CacheMode="BitmapCache" tag that's needed for off-screen rendering in the silverlight runtime. Am I doing something wrong?
Andrew at Plextek (Guest)[2009-10-27 12:5]:
Q: So if I use Blend 3 will this help or just cause more problems?
evan (Guest)[2009-10-27 12:5]:
Q: Can you point me to any documentation on the "threaded" SMS-message view in tmail.exe; I am having trouble adding my custom context-menu extension to it
Marcelovk (Guest)[2009-10-27 12:5]: Regarding MDD/PDD flash driver
Simon (Guest)[2009-10-27 12:6]:
Q: Hi! We are developing an app for a new handset running WM6.5 and are having problems when starting up first time. We are built into image and start up at boot since we have set correct reg keys in HKLM\Init. But one test case fails, namely to get reg notif
Marcelovk (Guest)[2009-10-27 12:6]:
Q: Regarding mdd/pdd flash driver. There is some blocks that the MDD allocates for managing the data. Is it save to backup and recover those blocks? Where can we get info about them?
Nick72 (Guest)[2009-10-27 12:8]:
Q: Does Wince6.0 R3 include iPOD support?
Simon (Guest)[2009-10-27 12:8]: We listen for changes to HKLM\System\State\Phone , "Missed Call Count" however at this first start up we never get such notifications. Rebooting will make it work as expected. Any ideas why it does not work the first time?
evan (Guest)[2009-10-27 12:8]:
Q: Yes, I am referring to Windows Mobile SMS application. I thought this chat includes Windows Mobile topics. Sorry, if that is not the case.
Tom (Guest)[2009-10-27 12:9]: Do you have a reference BSP that supports the XAML features in Cashmere so we do some performance testing?
Len (Guest)[2009-10-27 12:10]:
Q: Actually, the title of this was presented as "Windows Embedded CE AND Windows Mobile", so that is not the case then?
Simon (Guest)[2009-10-27 12:10]:
Q: We listen for changes to HKLM\System\State\Phone "Missed Call Count", however at this first start up we never get such notifs. Rebooting will make it work as expected.
Andrew at Plextek (Guest)[2009-10-27 12:11]: Will Bluetooth A2DP profile make it into R3 through a QFE? If not in R3 will ir be in CE7
Tom (Guest)[2009-10-27 12:11]:
Q: Do you have a reference BSP that supports the XAML features in Cashmere so we do some performance testing?
Marcelovk (Guest)[2009-10-27 12:11]:
Q: [PDD/MDD continuation] What I´m trying to achieve is to have a recover situation, if my NOR gets corrupted.
Andrew at Plextek (Guest)[2009-10-27 12:11]:
Q: Will Bluetooth A2DP profile make it into R3 through a QFE? If not in R3 will it be in CE7?
Simon (Guest)[2009-10-27 12:13]:
Q: No notifs until reboot. We use RegistryNotifyCallback, the reg key is not present but according to doc a notif will arrive whenever created. After boot it still does not exist but a notif when it is created is sent as expected
Nick72 (Guest)[2009-10-27 12:14]:
Q: Yes, I'd like to connect an iPOD to a Wince 6.0 device with USB host isochronous support. Normally I need the Audio class and the iPOD library on top of it. Are audio class and iPOD library included in Wince 6.0 R3?
Len (Guest)[2009-10-27 12:15]:
Q: Ok, thanks for the clarification...perhaps the title should be changed!
Jordan M (Guest)[2009-10-27 12:16]:
Q: Morning, I have a question regarding the Sept QFE '09 which causes ActiveSync issues I posted but got no answer? I am seeing more people posting on similar issue and on CE6.0 as well do you have any more info on this issue?
hoongyuin (Guest)[2009-10-27 12:17]: hello
hoongyuin (Guest)[2009-10-27 12:18]: can i ask why windows update keep offering me the same things to update?
Jordan M (Guest)[2009-10-27 12:18]:
butterfly (Guest)[2009-10-27 12:18]:
Q: Hello, I have a CSR bluetooth module to manage under WinCE and I would like to use the HCI_CustomCode to send some proprietary commands. Please could you tell me how to fill pcall for HCI_CustomCode (I did not found in msdn documentation)
hoongyuin (Guest)[2009-10-27 12:18]: can somebody help me?
hoongyuin (Guest)[2009-10-27 12:19]: the code was KB954430
Sue Loh [MS] (Moderator)[2009-10-27 12:20]: Sorry hoongyuin, we're only experts in Windows CE, not desktop Windows.
Marcelovk (Guest)[2009-10-27 12:20]:
Q: I´m already referring to the logical blocks. I want to know how to I get back to a "last well known" state backup of the filesystem (I´m using TExFAT). I am having filesystem corruptions due to hard power loss cycles.
hoongyuin (Guest)[2009-10-27 12:20]: windows CE mean wat?
hoongyuin (Guest)[2009-10-27 12:20]: i not using desktop ,,
hoongyuin (Guest)[2009-10-27 12:21]: my laptop keeps appearing this code of update KB954430
hoongyuin (Guest)[2009-10-27 12:21]: how can i fix it?
Sue Loh [MS] (Moderator)[2009-10-27 12:21]: Windows for embedded devices (not laptops)
hoongyuin (Guest)[2009-10-27 12:21]: sorry
hoongyuin (Guest)[2009-10-27 12:21]: thx
Sue Loh [MS] (Moderator)[2009-10-27 12:21]: Yeah, good luck!
Andrew at Plextek (Guest)[2009-10-27 12:22]:
Q: XAML Runtime Open GL Render Plugin: As shipped this supports OPENGL ES 2.0. My hardware has ES 1.1 support. Does the render plugin *NEED* any ES 2.0 features or should it be possible to convert the plugin for ES 1.1?
welzi (Guest)[2009-10-27 12:22]: Here's a WM (6.5) question: On our device we have 2GB NAND flash and we have four partitions (Binary with ULDR, NK, OS, Storage). The Storage partition (USERSTORE, initially empty) should allocate the the whole NAND flash after the OS partition.
welzi (Guest)[2009-10-27 12:22]: What are the right configuration entries in memory.cfg.xml to get a Storage partition of 2GB (minus other partitions)?
Jakerlton (Guest)[2009-10-27 12:23]:
Q: Using Windows Media Player Settings.setMode, what is the proper way to call it without it returning a E_INVALIDARG? When I call it with BSTR mode = L"shuffle" (mode, FALSE) or (mode, TRUE), they both return an error and indicates 0x80070057 => E_INVALIDAR
butterfly[12:26] asked the experts: Thank you RajeevDubey but at which address, can I email ?
Jakerlton[12:26] asked the experts: G. I am calling it via aninstance of IWMPSettings->setMode(mode, bValue);
Sue Loh [MS] (Moderator)[12:26]: Welzi, don't forget to click "ask the experts" when you post... Is this not part of the WM6.5 OEM docs?
Simon[12:27] asked the experts: Nothing in reg tree missing except actual value name="Missed call count" as defined in snapi.h. HKCU\System\State\Phone key is present
Sohoodlee[12:28]: Hey guys whos good with using Powerpoint ???
davbo_msft (Moderator)[12:28]: Sohoodlee - this is a Windows CE Embedded Tech Chat http:///www.microsoft.com/embedded.
welzi[12:29]: Sorry, Sue, I forgot. I already browsed the documentation but didn't find an explanation. Should I ask again?
Sohoodlee[12:30]: Hey guys my computer turned off and iw as working on a Powerpoint and my computer saved it but now it like locked or something i can only see the slideshow i cant change stuff on it does anyone have an answer???
butterfly[12:30] asked the experts: Thank you, I email you my request about HCI_CustomCode.
GarySwalling[12:30] asked the experts: I saw a question last month about if FMD_WriteSector() fails on NAND, and I was unclear about one point. After compation, does the FAL mark the block as bad, or try to erase it and reuse it? Same behavior for Flash MDD?
Marcelovk[12:31] asked the experts: How can we detect programatically if the filesystem is bogus? In Windows CE 5.0 + TFAT I got many "FATFS!FindNext: bogus directory!"
AlexG[12:32] asked the experts: How can I disable the memory pooling for a specific driver in Windows CE 6.0?
Sue Loh [MS] (Moderator)[12:35]: welzi: Yeah, if you don't click that, we don't really see your messages without looking around in a different place.
davbo_msft (Moderator)[12:35]: Sohoodlee - this is a Windows CE Embedded Chat session not Windows Office. http://msdn.microsoft.com/en-us/office/default.aspx
alexquisi[12:35] asked the experts: Why there are not a BOOTPART equivalent in CE 6.0 for creating partition in the bootloader? How can I overcome this considering that the ExFAT structures for the boot are aren't documented?
Simon[12:36] asked the experts: So there is a possibility that those reg keys are in fact not created yet? Is there any good way to attach/debug such situations? (other than file logging)
welzi[12:36] asked the experts: On our device we have 2GB NAND flash and we have four partitions (Binary with ULDR, NK, OS, Storage). The Storage partition (USERSTORE, initially empty) should allocate the the whole NAND flash after the OS partition
Marcelovk[12:36] asked the experts: Is there a suitable version of conmanclient2 for ce 6 with two VS2005 running at the same time (One with PB and another one in app dev mode)? I get many edm.exe messages in PB when doing with the version from standard sdk 5 of conmanclient2?
welzi[12:36] asked the experts: What are the right configuration entries in memory.cfg.xml to get a Storage partition of 2GB (minus other partitions)?
Marcelovk[12:37] asked the experts: (I´m debugging an application that tests the driver)
Andrew at Plextek[12:37]: EXR OGLES2.0: What processor did you use to test the XAML OGL Render plugin? It would be good for us to test the EXR with Open GL without having to recode for OGL ES 1.1.
Andrew at Plextek[12:38] asked the experts: EXR OGLES2.0: What processor did you use to test the XAML OGL Render plugin? It would be good for us to test the EXR with Open GL without having to recode for OGL ES 1.1.
AleT[12:39] asked the experts: Using WinCE 6.0 is there a support on the MS SD Stack for the SD XC Card?
Andrew at Plextek[12:40] asked the experts: EXR: Are there advantages using the OGL renderer rather that the DirectDraw renderer? Or do they give equivalent functionality and performance?
Marcelovk[12:41] asked the experts: native
GarySwalling[12:42] asked the experts: I assumed that when my flash PDD reports faliure to the MDD (i.e. sector write), the MDD would set the block to bad status, but after seeing Travis write "We'll only mark the block unusable to the FAL if EraseBlock fails.", should the PDD set block bad?
butterfly[12:43] asked the experts: Did you receive my e-mail?
AleT[12:44] asked the experts: Looking at the SDBus I saw that you never put in HighSpeed Mode the SD card?Is it supported by the stack the high speed mode for the SD card compliant with the spec ver 1.10 and higher?
welzi[12:45] asked the experts: Is there a newer version of Image Explorer? The version from JetStream (V6.0.0.1006) throws exceptions when I open a WM6.5 flash.dio. By the way, the CE6.0 platform builder plugin can handle the flash.dio.
AleT[12:46] asked the experts: In Wince 6.0 is there a way to disable the memory pooling for the Storage Card?If yes how is it possible?
AleT[12:48] asked the experts: In Wince 6.0 is there a speech recognition engine?
AlexG[12:48]:
Sue Loh [MS] (Moderator)[12:48]: welzi I'm trying to look up your answer
Sue Loh [MS] (Moderator)[12:48]: (the memory.cfg.xml answer)
alexquisi[12:48] asked the experts: Again, without the option of creating ExFAT partition in the bootloader with BOOTPART, how can achieve that?
Andrew at Plextek[12:49] asked the experts: EXR: Our ARM 11 platform has VFP which we have enabled through the OEM Floating Point CRT support (SYSGEN_OEM_FPCRT). Will this mean that the embedded XAML runtime will utilise the hardware floating point coprocessor? Or is it entirely integer based?
Simon[12:51] asked the experts: In the same situation we also try to attach to pim.vol and its database clog.db. And no notifs from there either. Could it be that these are also not created when first accessing them?
tlig[12:52]: hi
AlexG[12:53]:
wolfelectronic[12:53] asked the experts: Hi experts, is there any way to get the debug information of arm-assembler files into the pdb file so i can step through the sources in the debugger? Currently I only see exported symbols of the assembler files in my debugger. I am using the lauterbach T32
wolfelectronic[12:54] asked the experts: P.S. for c files and cpp files it works
rach[12:55] asked the experts: hi i have just bought a new laptop with vista however im trying to setup a wireless network ive enterd my wep key etc. . but when i click connect a grey box pops up asking me to enter my credintals ( user name, password and logon domain) can you help me ?
wolfelectronic[12:57] asked the experts: 2nd question: if I have a look on the build.log when using armasm i see commandline arguments like -pd "Interworking SETL {TRUE}" , but I didn't find them in the documentation. Is there a docu available for these arguments?
alexquisi[12:58] asked the experts: uhmm, memory.cfg.xml seems to be WinMo specific...
AleT[12:58]: SAPI support is clear but it's required to have also the engine, is it present only with the MS Auto version or also with WinCE 6.0?
AlexG[12:58]: I'm still waiting for an answer....
AleT[12:58]: I don't received an answer for many question!!
GarySwalling[12:59]: thanks davbo_msft!
Jakerlton[12:59]: Yes, thanks Davebo.
welzi[12:59]: Hi Sue, my memory.cfg.xml does look like yours. The entry
welzi[12:59]: <NAND SECTORSIZE="0x800" BLOCKSIZE="0x20000" LENGTH="0x5000000" ID="FLASH" BINOFFSET="0x80000" >
Simon[13:00]: Thank you Sue for your help
Andrew at Plextek[13:00]: Thanks for the help. Look forward to answer on VFP support for EXR. Thanks
alexquisi[13:00] asked the experts: NOOO!, the transcript takes years to be available!!
Sue Loh [MS] (Moderator)[13:00]: AlexG: we are looking up your answer, please be patient.
welzi[13:01] asked the experts: Hi Sue, my memory.cfg.xml does look like yours. The entry <NAND SECTORSIZE="0x800" BLOCKSIZE="0x20000" LENGTH="0x5000000" ID="FLASH" BINOFFSET="0x80000" > determines the flash size. But I can't set to 2GB ( A: the bootloader cannot handle, B: it does not
welzi[13:01]: really make sense to write 1.8GB of "nothing"
welzi[13:01] asked the experts: really make sense to write 1.8GB of "nothing"
AlexG[13:01]: thx sue
Sue Loh [MS] (Moderator)[13:02]: It was my fault the transcripts were so slow. David is being more prompt than I was.
AleT[13:04] asked the experts: Yes SD 1.1 and 2.0 are supported but not in high speed mode. Look at the SDBus implementation and let me know..
Sue Loh [MS] (Moderator)[13:06]: Sorry welzi, I have to go. I suggest you contact support for help.
Sue Loh [MS] (Moderator)[13:06]: By everyone, good luck!

 

Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Tuesday, October 27, 2009 1:02 PM | Feedback (0)

Windows CE Chat Tuesday,October 27, 2009


 Another great opportunity to ask Microsoft engineers your technical questions is coming up on Tuesday, October 27th.  These chats are your opportunity to get advice and answers from the engineers at Microsoft.   You may want to review the transcript from previous months to get an idea about the topics that are discussed.
Title:    Windows CE Live Chat!
When:  Tuesday, October 27, 2008 9:00 - 10:00 A.M. Pacific Time (16:00 - 17:00 GMT)
 
Description: Do you have tough technical questions regarding Windows CE or Windows Mobile for which you're seeking answers? Do you want to tap into the deep knowledge of the talented Microsoft Embedded Devices Group members? If so, please join us for a live Windows CE chat and bring on the questions! Windows CE is the operating system that is powering the next generation of 32-bit, small-footprint and mobile devices. This chat will cover the tools and technologies used to develop devices using the Windows CE operating system.
To join this chat, please log on via the main MSDN chat page at: http://msdn.microsoft.com/chats/
Join the chat room on the day of the chat: www.microsoft.com/communities/chats/chatrooms/msdn.aspx
 
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Thursday, October 22, 2009 4:32 AM | Feedback (0)

Platform Builder: CE 6.0 R3 and Updates (QFES)


This post is to make you aware that the Windows Embedded CE 6.0 R3 are incomplete and inconsistent with reality. If you follow the instructions as they are written in the installation instructions, you will corrupt your installation.
Incomplete
The installation instructions state that you should “Install all Windows Embedded CE 6.0 monthly updates available at the Windows CE Developer Center.” Unfortunately, this says install all which could be interpreted as meaning “all”. In fact, it was probably written last month in anticipation of people installing R3 sometime in the future. What it should say is “Install all Windows Embedded CE 6.0 monthly updates dated September 2009 or later.”
Inconsistent with Reality
The installation instructions go on to give instructions on using the CE Update Check to verify that all updates are correctly installed. Unfortunately, these instructions were not well tested.  The reality is that the CE Update Check utility will show that none of the required updates have been applied. This is a bug in the installation and should be ignored.
 
Microsoft has updated the download page with the following note:
NOTE:

Windows Embedded CE 6.0 R3 installs all updates released up through August 31st, 2009.
Do not install updates currently available for Windows Embedded CE 6.0.
There are currently no updates released for Windows Embedded CE 6.0 R3.

CEUpdateCheck tool will not work for Windows Embedded CE 6.0 R3 until first update rollup is released for this environment.
CEUpdateCheck will continue working for Windows Embedded CE 6.0 R2 environment and all currently available updates until further notice.
But, that is not the only way to acquire the R3 release. MSDN subscribers have access to the DVD ISO image which does not include the note. I suspect that Microsoft will also have DVDs available to hand out at special events and trade shows.
 
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Thursday, October 15, 2009 1:27 PM | Feedback (2)

Windows CE


What is Windows CE? Microsoft says that Windows CE is “Componentized, real-time operating system for a wide range of small footprint devices” on their WEB site.   That is a very precise description, but what does it really mean?
Windows CE is designed for embedded systems. An embedded system is typically a device that doesn’t necessarily look like a computer, but provides some special functionality. Examples of embedded computers are GPS systems, voting machines, Automated Teller Machines, Point Of Sale devices, inventory tracking systems and many other systems that we use every day.
To satisfy the disparate needs of embedded systems, Windows CE is a componentized, real-time operating systems that supports various CPU families, is board agnostic, supports small footprint devices and can manager low power consumption.
I like to tell this story to my customers to help explain how Windows CE is different from Windows Vista or XP. When Dell decides to make a new laptop computer, Michael Dell call Bill Gates and Bill tell Michael that all he has to do is design the hardware so that Windows Vista will run on it. When I decide to create a new embedded computer all I have to do is design my board any way that I want, then write the bootloader to start it up and all of the drivers to control the hardware – then Windows CE will run on it. This is because Windows CE isn’t an operating system that is sold with an install CD, but instead is sold only to OEMs who are responsible for porting the OS to the board.

Let’s look at what “Componentized, real-time operating system for a wide range of small footprint devices” means.

Componentized
Windows CE running on a device is a subset of the possible features that can be included in the operating system. The features are referred to as components. The possible components includes features like applications (Internet Explorer and File Viewers), Application Programming Interfaces (.NET Compact Framework, COM, DCOM, SOAP and MFC) OS supported features (Audio, Graphics, Fonts) and device drivers.
The OEM or device vendor may choose to include or exclude components to control the memory footprint and cost. The bigger the memory footprint, the more ROM and RAM required which increases cost and some components require a higher license fee for Windows CE.
This componentization means that two Windows CE devices are not necessarily equal.
Real-Time
Real-time operating systems can respond to a hardware signal, or interrupt, in a fixed amount of time, or interrupt latency. Windows CE is an operating system that can handle interrupts in fixed amount of time.
CPU
Windows CE can run on several different CPU families, including x86, ARM, MIPS and SH4. That is different from big Windows (XP, Vista, 7) which only run on X86 CPUs.
Board Agnostic
Windows CE can run on computer boards with many different designs or architectures as long as the board has one of the supported CPU families. This is again different from big Windows which only runs on a “WinTel” computer board that meets certain specifications.
The OEM is required to provide all of the software that controls the hardware. This allows the OEM considerable flexibility in the board design.
Small Footprint
Because of the componentization of the Windows CE operating system, the OEM can control the amount of memory (RAM and ROM) that the OS consumes. That control also leads to considerable flexibility in the board design.
Low Power
Windows CE can be configured and designed by the OEM to support very low power consumption. 
Windows CE can include a power manager. The power manager can be used to control when certain hardware is powered up and powered down.
The OEM can provide software in the form of device drivers and a hardware abstraction layer for the kernel to control power. The OEM can also design the board in a way to keep power consumption to a minimum.
 
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Wednesday, October 14, 2009 12:47 PM | Feedback (3)

Platform Builder: Setting the Default Thread Quantum


The default thread quantum, the amount of time that the schedule allows a thread to run before scheduling a different thread to run, has been set to 100 milliseconds since Windows CE 3.0. Prior to Windows CE 3.0 the quantum was shorter (if memory serves me right it was 25 ms.) The change to 100 ms was made to improve real time performance. The longer quantum allows most real time threads to run as long as they need to service hardware, but stops them if they get greedy to allow other threads to run. The down side of the 100 ms quantum is that threads that need to run for a long time block other threads, so in some systems a shorter or longer thread quantum can improve performance of the system.
Maybe you have heard or read that the default thread quantum is 100 ms, but with a disclaimer that the OEM can change it. Let’s take a quick look at how to mdoify the default thread priority.
In all versions of Windows CE, the default thread quantum is set within the kernel and can be modified by the the OEM in the OAL or HAL. The traditional place for the OEM to modify the default thread quantum is in OEMInit().  It could theoretically be set other places like from OEMIoControl(), but that would mean that threads started prior to changing the default would have a different thread quantum.
Windows CE 3.0 through 5.0
The Windows CE 3.0 through 5.0 kernel is built as a monolithic exe and the default thread quantum is set with single global variable.  The default thread quantum is set in dwDefaultThreadQuantum which  can be modified by the OEM.  To do so you must define dwDefaultThreadQuantum as extern and then set its value:
extern DWORD dwDefaultThreadQuantum;
 
 
void OEMInit()
{
                dwDefaultThreadQuantum = 50;
}
Windows CE 6.0
The Windows CE 6.0 kernel is built as dll and the OAL is built as an exe. The default thread quantum is set with a member of a global structure.  The global structure is g_pOemGlobal and the member is dwDefaultThreadQuantum. The g_pOemGlobal structure is defined in oemglobal.h, which is included by oal.h so mdofiying the default thread quantum is done by:
void OEMInit()
{
                g_pOemGlobal->dwDefaultThreadQuantum = 50;
}
 
 
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Tuesday, October 13, 2009 1:04 PM | Feedback (2)

Platform Builder: Building Code in the 3rdParty Folder


Download the catalog files:
 
During the Windows CE Chat a couple of weeks ago someone asked about customizing the Explorer shell. Feeling generous that day, and because it was nearing the end of the chat, I told him to contact me directly through this blog (I could feel a blog post coming on.) 
Much to my disappointment he was adamant about putting the entire Pulbic\Shell folder in the 3rdParty folder and building the code there.  It was disappointing because I don’t have any idea how to do it. But then, I realized that this was a chance to learn something new, a challenge, and of course a topic for a blog post. Game on.
So the challenge is:
1.       Clone an entire Public subfolder
2.       Build code in the 3rdParty folder
3.       Make it work for both CE 5.0 and 6.0
So I started down the path of solving this problem. I started thinking that this was going to be a real challenge, possibly one that I wouldn’t be able to solve. But like any engineering task start with what you know and move along finding solutions to what you don’t know as needed. So, I started by copying the Public\Shell folder to something that I know well, my BSP.   This allowed me to study how it builds and make changes to take control of how it builds. What I found with this step was that the INCLUDES were set up assuming that it was in the Public folder, or at least not in the Platform folder. Other than the INCLUDES, the only changes that had to make were to the RELEASETYPE, but it turns out that simply deleting the RELEASETYPE setting from the sources files solves that. I went ahead with building the Explorer.exe by running “sysgen_capture –p SHELL explorer” as I have discussed before in posts like Platform Builder: Cloning an MDD Lib.
So now, I know what to do to build the Shell folder, time to move it to the 3rdParty folder. For this, I started out at the beginning again by copying it from Public. This time it is at the root of a build tree so the INCLUDES is okay, all I needed to do was changes the sources.cmn to set RELEASETYPE=PLATFORM and delete RELEASETYPE from the sources files.   I made a conscience decision to use PLATFORM as the RELEASETYPE because I wanted the libs and targets to be put someplace else in case I want to build the 3rdParty shell with multiple projects and because I want the targets to be picked up by buildrel which doesn’t look in the 3rdParty folder. Now run sysgen_capture to create the build folder(s) for any targets that we need to build.
Step 1 is complete; I have cloned the entire Public\Shell folder to 3rdParty. Next step is to build it, and as I pointed out this is new ground for me. My guess is that I need a catalog file that introduces this new folder to Platform Builder.   
Before I start on the catalog, let me jump to the end. I was successful at building this under both CE 5.0 and CE 6.0. The only difference was the catalog file because, well, catalog files are different in the two versions. Everything else was identical.
Back to creating a catalog file which was the key to solving how to get the folder to build. I started with CE 5.0, which actually might have made solving it easier. In CE 5.0, I didn’t have many choices; create a Group was the only starting point, then only add a feature which sets a variable, and finally several options, but “Project Link…” stood out. The Project Link sets a path to a PBPXML file which defines a project. I didn’t know anything about PBPXML files, but I never let that stand in my way. I did some searching and found that I had a PBPXML file from having cloned CALIBRUI in the past. Looking at CALIBRUI.PBPXML I found that it was rather simple and that most of it didn’t apply to what I was doing, so I edited it and came up with:
<?xml version="1.0"?>
<PBProject DisplayName="customshell" xmlns="urn:PBProject-schema" />
I put this in the 3rdParty\Shell folder as CustomShell.PBPXML and pointed the catalog Project Link to it.
The rest is downhill from here. Refresh the catalog, then add the new Custom Shell component to the project and sysgen. Project done.
The only difference for CE 6.0 is that the Project Link is called Subproject Link. But I used the same PBPXML file.
The down side of this new 3rdParty folder is that it build fine from the Platform Builder GUI, but it does not build when running cebuild from the command line. So if you are building from the command line, you will need to build your 3rdParty folder separately.
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Monday, October 12, 2009 2:00 PM | Feedback (0)

Platform Builder: CE 6.0 R3 Download Once Install Many


Just to keep you informed about what others are doing, Michel Verhagen at GuruCE has created a utility to download the R3 update once and install many times. Michel has done this before for other installations and saved many of a lot of time. You will notice that the download from Microsoft only downloads a setup file. That setup then downloads several other files, but doesn’t keep them around to use again. That is a problem because it takes time to do the downloads, but also from a configuration management perspective it is just bad.
Thanks Michel.
 
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Monday, October 12, 2009 12:25 PM | Feedback (0)

Windows CE: Watchdog Timers


Watchdog timers have been coming up in discussions lately, so I thought it might be good to start a discussion about the use and misuse of watchdog timers in a preemptive multitasking operating system, like Windows CE. I am going to share my thoughts, but look forward to you, my reader, sharing your thoughts on the subject. I am going to focus this discussion on hardware watchdogs, totally ignoring the software watchdog that is included in Windows CE and discussed by Luca Calligaris in an article titled Beware of the watchdog!
What is a watchdog timer? A watchdog timer is a hardware timer that is set to timeout after a set amount of time. When the watchdog times out, it causes a hardware reset. It is software’s job to “pet” the dog before it times out. Petting the dog is the act of resetting the time so that the watchdog doesn’t timeout. The goal is to have the hardware watch for code that takes too long, because code that takes too long has failed in some way. Watchdog timers should primarily be used to detect catastrophic software failures. Note that these catastrophic software failures could be the result of catastrophic hardware failures that prevent software from working correct, or working at all.
The code to manage the watchdog should be broken into two parts; the code that touches the hardware should be in a driver or the kernel and the code that starts the watchdog and pets it should be in separate thread(s). Note that earlier version of Windows CE didn’t enforce that separation.
So there are two important variables in a watchdog; the timeout period and the interval between petting the dog. Wait a minute, maybe there are more variables involved, variables that aren’t quite so obvious. The other important variables are thread quantum and thread priority. Remember that Windows CE is a preemptive multitasking operating system, and you didn’t write all of the code that is running on the device. This means that code that you don’t control is also running and may run at a higher priority and/or run until its quantum expires.
Let’s think about how the watchdog works some by drawing some pictures. To start with, here is what happens if we start the watchdog with a 50 millisecond timeout and never pet the dog:
Nothing pets the watchdog, so the board resets. Now if we pet the dog at about 25 milliseconds:
Now we are on to something, we are petting the dog so the board doesn’t reset. The default thread quantum for a Windows CE system is 100 milliseconds (which can be changed by the OEM or on a per thread basis) so look what happens if a thread that we don’t control jumps in and runs for 30 milliseconds just before we are ready to pet the dog:
Of course this could be even worse couldn’t it? There could be several threads that need to run when we need to pet the dog and one or more of them could need to run to quantum. I am assuming that all of these threads are of equal or greater priority to the thread(s) that pet the dog. That is that any thread(s) of an equal or greater priority can and will prevent the thread that pets the dog from running.
And of course there is the case where the watchdog detects a catastrophic failure:
Most of the discussion that I have had about watchdog timers involves a decision on the timeout, and the timeout value was usually selected with reckless disregard for the reality of the OS. I strongly believe that any timeout value that is measured in tens or even hundreds of milliseconds is too short to effectively monitor for catastrophic failure to the exclusion of resetting when the system is running normally. There may be some exceptions to this, like a minimal OS which only includes drivers that are completely controlled and understood by the OEM and the kernel.
What should we do? We could raise the thread priority of the code that pets the dog increase the timeout period. Raising the priority of the code that pets the dog has a nasty side effect in that we could easily pet the dog through a catastrophic software failure. I am in favor of setting the timeout period in seconds, rather than milliseconds for a multithreaded OS, but how many seconds is enough? That is the tricky question and will depend on what your system does. If you are going to use a hardware watchdog, you had better be prepared to figure it out though.
I have seen a lot of creative algorithms based on working around setting a longer timeout period, most of which could be handled completely in software. They are usually centered around watching for threads that register to be watched. It then only pets the dog if all of the threads have checked in within a set time period. Really these could be handled by switching the logic just a little bit to cause a reset if one or more threads haven’t checked in.   These algorithms have a lot of merit in a preemptive multitask OS because they only monitor specific threads. But they still have the problem of setting a suitable timeout period.
Kind of makes me want to reminisce about the good old days of single threaded embedded systems, watchdogs were easy; set a timeout and instrument the code to pet the dog as needed. But then I quickly get over it when I think about how much more we can do with the systems today.
Again, I look forward to you comments on watchdog timers.
Copyright © 2009 – Bruce Eitman
All Rights Reserved

author: Bruce Eitman | posted @ Tuesday, September 29, 2009 8:03 PM | Feedback (2)