Thursday, November 5, 2009

Industrial Automation with Windows Embedded

With a single platform, one development environment, and real-time everywhere, Windows Embedded offers a reliable, flexible, connected, and cost-efficient foundation for industrial automation Learn during this presentation how the various Windows® Embedded operating systems can be used by OEMs to create industrial embedded devices. We will help you identify the key challenges for an Industrial Automation project and learn about available solutions, from the market trends, total cost of ownership and technical standpoints.

Online Webinars :
  • French : November 17th 2009 10:00AM - 11:00AM (register)
  • English : February 19th 2010 9:00AM - 11:00AM GMT (register)

Roadshow :
  • Columbus, OH : October 21, 2009 8:00AM – 1:00PM (register)
  • Boston, MA : October 27, 2009 8:00AM – 1:00PM (register)
  • Mountain View, CA : November 12, 2009 8:00AM – 1:00PM (register)
  • Houston, TX : November 18, 2009 8:00AM – 1:00PM (register)
  • Paris, France : December 16, 2009 9:00AM - 3:00PM (register)

- Nicolas

Tuesday, November 3, 2009

Microsoft AppFab 2009 contest

Microsoft Market Place is now open, and Microsoft wants to help developers to publish their applications in this store.
The French Microsoft entity organized a contest for developers, ending by November 31th 2009. Lots of prizes to win so check out the details at https://www.appfab09.fr/

- Nicolas

Monday, November 2, 2009

USB Function profile switcher

The USB Function driver under Windows CE and Windows Mobile, allows user to change on the fly the loaded profile. It can be used as a Serial or a Mass storage device. The Serial profile (or NDIS on some Windows Mobile devices) is used to do data synchronization through ActiveSync. The Mass storage on its side allows the user to see the device internal storage as a standard USB storage device, from the host device.
To switch between the two modes, some Windows Mobile device manufacturer provides application, usually located in the Settings/Connections panel. But for Windows CE user it have to be implemented.

By calling a specific IoControl of the USB Function driver, you can tell it to load a different profile. The available profiles are listed in the registry in [HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers] and the current active profile is specified in the DefaultClientDriver value in this registry node.


void SwitchUSBFunctionProfile(BOOL bEnableActiveSync)
{
HANDLE hUSBFn;
UFN_CLIENT_INFO info;
DWORD dwBytes;

// Open the USB function driver
hUSBFn = CreateFile(USB_FUN_DEV, DEVACCESS_BUSNAMESPACE,
0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);

if(bEnableActiveSync)
{
// Enable USB Function profile for activesync
swprintf(info.szName, _T("Serial_Class"));
DeviceIoControl(hUSBFn, IOCTL_UFN_CHANGE_CURRENT_CLIENT,
info.szName, sizeof(info.szName), NULL, 0, &dwBytes, NULL))
}
else
{
// Enable USB Function for mass-storage
swprintf(info.szName, _T("Mass_Storage_Class"));
DeviceIoControl(hUSBFn, IOCTL_UFN_CHANGE_CURRENT_CLIENT,
info.szName, sizeof(info.szName), NULL, 0, &dwBytes, NULL);
}
}

The defines values are located in %_WINCEROOT%\PUBLIC\COMMON\OAK\INC\usbfnioctl.h
- Nicolas

Monday, October 26, 2009

Get an USB Flash key booting DOS

While using Windows Embedded CE or Windows Embedded Standard, you need to boot your device under DOS, in order to format, create partition on the storage, or to use loadcepc to launch your runtime image. Nowadays, floppy disk readers are vintage hardware that you probably don't have anymore, and more over Floppy disk are covered of dust and you are afraid to use them. In this case you have to boot your device using a USB Flash disk, thanks to the fact that most of the actual BIOS do support them.

Tools
- HP USB Disk Storage Format Tool (http://hp-usb-disk-storage-format-tool.software.informer.com/)
- Winimage (http://www.winimage.com/download.htm)
- DOS floppy disk image (get from Windows Embedded CE 6 CEPC BSP)
%_WINCEROOT%\PLATFORM\CEPC\SRC\BOOTLOADER\DOS\BOOTDISK\DISKIMAGE\cepcboot.144

Extract the DOS image
For the first step we have to extract from the cepcboot.144 floppy disk image, the files for DOS. Using Winimage, open the image file, select all the files and go the Image->Extract. Enter c:\Temp\FloppyContent as a folder for the extracted files, and select "Extract with pathname" option.


Format the USB Flash disk
Plug the USB disk and wait for USB device availability notification.
Using the HP USB Disk tool, select the USB device in the list box, use FAT as File System, Select Create a DOS startup disk, choose "using DOS system files located at", and choose the folder used in winimage for the extraction.

Hit Start and voila your device is ready to boot dos. Then you can add the tools you need to prepare the device to boot...

Note
I have identified some USB devices that, are not compatible, cannot be used for booting x86 devices, but did not find the link between them.
This tutorial should also work with Compact Flash devices and SDCard (miniSD, microSD) devices.

Thanks to Eric for his help.
-Nicolas

Network Projector demonstration

Joe Broxson, from Adeneo Embedded, is demonstrating the network projector feature of Windows Embedded CE on OMAP3530 based Gumstix Overo device.
Check out the video at http://www.youtube.com/watch?v=y3c5TZVSFzY
- Nicolas

Tuesday, October 13, 2009

Trick my Windows Mobile device [Part 1]

Change the startup splash screen :

Get bored by the Windows Mobile splash screen display at you Windows Mobile device startup ... here is the solution to customize it. Just pick up you favorite picture, adjuste it to your Windows Mobile device screen resolution, and save it to a png file (mywelcomehead.png).

Then copy it to the Windows folder on your device and then adjust the following keys in the registry :
[HKLM\Software\Microsoft\Splash Screen]
"CarrierBitmap"="\windows\mywelcomehead.png"
"MSBitmap"="\windows\mywelcomehead.png"
And that's it, restart your device and the nice picture shows up :-)

More for HTC users :
For HTC, you can also change the startup animation, by provisioning on your device and in the registry an animated gif file, just set the following registry key.
Sample below for an animated gif named myanimation.gif and located in \Windows\
[HKLM\Software\HTC\HTCAnimation]
"StartupGif"="\Windows\myanimation.gif"
WARNING : As usual, use this information at your own risk.

- Nicolas

Post Mortem Debug of Windows Mobile with Visual Studio 2005

We saw on the previous post on Post Mortem debugging, the way to open KDMP files with WinDbg. But those system dump files can also be loaded using Visual Studio 2005 (and higher).

First step : Configure your device
Just follow the instructions in the previous post for the configuration of you Windows Mobile device (registry configuration to specify the location of the kdmp files).

Second step : Locate and copy the kdmp files
Locate the kdmp files on your device and copy it to your Development machine.

Third step : Open the kdmp file and run debugger
From VS2005, go to File -> open project/solution, and select the kdmp file.

Then go to Debug -> Start menu or hit F5 key, this will launch the debugger locally. The exception is then catch, and the assembly source code is shown.

At this time, the debugger is not able to make the link between the binary and the source code, as the symbols are not set. For this show the modules by going in Debug -> Windows -> Modules menu (screen must looks like the screen shot above). Select the module on which the exception occurs in our case it MemException.exe, right click on it and select the "Load Symbols" popup menu.
Provide the path to the pdb files and TAADAAA the source code is displayed.



Have a good debugging then...

- Nicolas