November 2008 Entries

Windows CE: Enumerating User Notifications
I put together the following OutputNotifications() function to show how to enumerate User Notifications. #include <Notify.h> void OutputNotifications() { HANDLE *hNotifications = NULL; DWORD NumNotifications; DWORD Count; DWORD BytesNeeded; CE_NOTIFICATION_INFO_HEADER *NIHeader; CE_NOTIFICATION_TRIGGER* Trigger; CE_USER_NOTIFICATION* UserNotification; void *pBuffer; // First call CeGetUserNotifications to find out how many notifications are available // by passing in zero as the second argument ......

Posted On Friday, November 28, 2008 10:20 PM | Comments (0)

Windows CE: Soft Reset
There are some reasons to reset a device. Some examples would be installing a new driver or changing the system path in the registry. These changes don’t take effect until the system boots up again. The standard method to reset a device is to call KernelIoControl with IOCTL_HAL_REBOOT. Example: KernelIoControl(IOCTL_HAL_R... NULL, 0, NULL, 0, NULL); Which, if implemented by the OEM, will cause the device to reset. It is up to the OEM to implement this and to implement it as either a soft reset, ......

Posted On Tuesday, November 25, 2008 5:26 PM | Comments (9)

Windows CE: Remove Suspend from the Start Menu
To remove Suspend from the Explorer shell Start Menu, change the following registry value: [HKEY_LOCAL_MACHINE\Explorer] "Suspend"=dword:1 To: [HKEY_LOCAL_MACHINE\Explorer] "Suspend"=dword:0 You may also want to look at Summary of Registry Posts Tags: REG Files Copyright © 2008 – Bruce Eitman All Rights Reserved ......

Posted On Tuesday, November 25, 2008 5:12 PM | Comments (2)

Windows CE: Waking the System using the RTC
In Windows CE: Suspending a Device I discussed putting the device in suspend. Now let’s look at setting the system to wake using the Real-Time Clock (RTC). There are several Notify Functions that we can use to wake the system at a given time. In this case, I will use CeRunAppAtTime() to request that the system run an application a few seconds after suspending the system. This is a handy way to test the suspend and resume functionality of a system. CeRunAppAtTime() takes two parameters; a string that ......

Posted On Tuesday, November 25, 2008 2:37 PM | Comments (4)

Windows CE: Suspending a Device
One way to conserve power consumption and save the battery is to put the device in Suspend when it is not being used. When a device is suspended it typically powers down peripheral chips on the board and puts the CPU in a low power state. Then when the device is needed it wakes up, powers up the peripheral chips and resumes executing code where it left off before suspending. One way to suspend a device is to call GwesPowerOffSystem(), which is considered by some to be the “old” way to suspend. But, ......

Posted On Tuesday, November 25, 2008 12:23 PM | Comments (5)

Windows CE: Using CEConfig.h
Every Windows CE device has a file named CEConfig.h in the \Windows folder. This file can be used to conditionally compile code against different projects or SDKs. It can also be used to determine the license level of a Windows CE OS. CEConfig.h is created when a Windows CE OS project is built, or more specifically sysgened, using Platform Builder. CEConfig.h contains macro definitions for the OS components included in the project. In other words, it can tell the C code about the features that will ......

Posted On Friday, November 21, 2008 6:31 PM | Comments (2)

Platform Builder 6.0: Project Creation Failed
I received an interesting question from an Engineer today. It read like this: "I have an issue that has cropped up with using Platform Builder 6.0. I installed a newer version of a CE BSP on my system and now Platform Builder will not open my old project nor create a new one. When creating a new project I get an error message on the status bar that only says “…project creation failed”. If I restore the old BSP I can create new projects so I think the problem is somehow related to the new BSP. " So ......

Posted On Wednesday, November 19, 2008 5:00 PM | Comments (3)

Windows CE: Enhanced BusEnum
Yuqun Cao, SDE, Windows CE JDP of Microsoft, released a whitepaper on enhancing BusEnum a few months ago. I finally had a chance to read it yesterday and was impressed by the additions that he made to BusEnum. The changes allow for drivers to be loaded asynchronously. This change can be used to speed up the perceived time to boot a Windows CE system to the desktop or a kiosk application. The BusEnum that comes with Platform Builder loads drivers one at a time. It loads the drivers using ActivateDeviceEx() ......

Posted On Wednesday, November 12, 2008 9:32 PM | Comments (11)

Platform Builder: Bluetooth Component Inconsistencies
Subtitle: Why adding Bluetooth Stack with USB doesn’t always add Bluetooth USB Argh, one of my junior engineers just gleefully exclaimed to me “Anyway, I WIN! :-)” Now that just burns, but I take comfort in the fact that she got lucky. We were both adding Bluetooth support to different workspaces that supported the same board. My project finished building before hers so I asked her to test my project. The USB Dongle that she was using didn’t work with my OS image; it popped up the little dialog asking ......

Posted On Thursday, November 6, 2008 5:10 PM | Comments (4)

Windows CE: The Case of the Missed Interrupt
I was recently working on an interrupt that was asserted, but the system didn’t respond by handling the interrupt. The interrupt that wasn’t being handled came from a CPLD into a GPIO pin. The CPLD asserts the interrupt in response to several external events. I thought that this would make a good example of what not to do in an ISR. If only one of the external events was triggering, then the interrupt seemed to work well. If more than one triggered, not necessarily at the same time, then eventually ......

Posted On Thursday, November 6, 2008 1:49 PM | Comments (2)

Books on My Shelf: The Snowball: Warren Buffett and the Business of Life
The Snowball: Warren Buffett and the Business of Lifeby Alice Schroeder is a very interesting view into how Warren Buffett’s mind works as he invests and grows his wealth. Adding a review of this book to my Windows CE blog may seem odd, but I thought that this book was such a good read that I wanted to share it with others. Once I started reading this book, I couldn’t put it down. That is a little unusual for a biography. The author does a nice job of not only telling the story of Mr. Buffett’s life, ......

Posted On Wednesday, November 5, 2008 11:25 PM | Comments (0)

Platform Builder: Releasing a BSP
If you take Microsoft’s approach to releasing a Board Support Package (BSP) it is a very simple process, click, click, click and release. But if you want to protect some or all of your intellectual property (IP), or that of a vendor, then you may have some more work to do. In this article, I will discuss some of the issues that will need to be addressed. First, what is a BSP? A BSP is a collection of board specific code that when built with a Platform Builder project will create a Windows CE OS for ......

Posted On Tuesday, November 4, 2008 6:06 PM | Comments (0)