Platform Builder General

A collection of general posts about Platform Builder
Platform Builder: Write, Debug, Fix, Debug…
The question came up again about how to quickly test an application or driver using Platform Builder and KITL. This article will show how this test cycle can be done quickly without building a new OS and downloading it. Of course Platform Builder is a tool for developing an operating system, so if you use its default behavior it will build an operating system. So that means that a small change to source code means building the operating system and deploying it to your device. But we will look at ......

Posted On Tuesday, August 17, 2010 8:28 PM | Comments (2)

Platform Builder: Disable the USB Driver Dialog
For a long time, Windows CE developers and users have wanted to disable the USB Driver Dialog that is displayed when an unknown USB device is plugged into the host controller. Of course the question is always why would you want to do such a thing? The simple answer is that there are USB devices that are needed, like printers, which expose multiple functions to the bus, like scanners and faxes, which no Windows CE driver exists to support. So the printer quietly loads a driver, but then the other ......

Posted On Thursday, June 3, 2010 9:27 PM | Comments (4)

Platform Builder: Removing the Version Information from the Desktop
The question of how to remove the version information from the desktop has been around for a long time. It came up again today. The question is about the string displayed on the desktop that looks like one of these, depending on the OS verison: Windows Embedded CE v6.00 (Build xxxx on xxxx) Microsoft Windows CE v5.00 (Build xxxx on xxxx) Microsoft Windows CE .NET v4.20 (Build xxxx on xxxx) I have looked into this in the past, but never really had a definitive answer. I have an answer now. The short ......

Posted On Thursday, March 4, 2010 2:34 PM | Comments (1)

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 ......

Posted On Thursday, October 15, 2009 1:27 PM | Comments (4)

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 ......

Posted On Monday, October 12, 2009 12:25 PM | Comments (0)

Platform Builder: Diff’ing NK.bin Files
In Platform Builder: Debugging the Boot Hive, I talked about opening nk.bin files in Visual Studio with Platform Builder and how this was a good tool for reviewing the registry settings. But, you can also use this technique and diff two nk.bin files. Once you open on nk.bin file, there will be a small icon just below the filename tab. This is shown below in the red circle: When you click on this icon, you will be prompted to open a second nk.bin. Opening the second nk.bin will display the deltas ......

Posted On Monday, August 17, 2009 8:57 PM | Comments (0)

Platform Builder: Building Code in the 3rdParty Folder
Download the catalog files: Download Custom Shell 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 ......

Posted On Monday, October 12, 2009 2:00 PM | Comments (6)

Platform Builder: Reverse Engineering an IOCTL Value
A customer contacted me about a debug message that he had. The message was something like: Driver ERROR INVALID IOCTL CODE 0x010303FF He wanted to know what this IOCTL meant and why the driver was called with that value. The following is how I went about answering the question. 1. I opened up my favorite search tool. I have mentioned this before, but it is worth mentioning again, if you are working with Platform Builder it is very important that you have a really good search tool. The search tool ......

Posted On Tuesday, August 11, 2009 11:30 AM | Comments (0)

Platform Builder: error C2065: 'dpCurSettings' : undeclared identifier
So you build your BSP and it fails with an error like: C2065: 'dpCurSettings' : undeclared identifier Or C2065: 'ZONE_INIT' : undeclared identifier The easy answer is that you haven’t declared the variables, but the last time you built the BSP it built okay, so how could it be that all of a sudden there are undeclared variables? The most likely reason is that you are building a debug build and you had previously been building a retail or release build. The difference is explained in Platform Builder: ......

Posted On Tuesday, June 9, 2009 6:58 PM | Comments (2)

Platform Builder: What SYSGEN Variables Are Set?
Sometimes it is useful to know which SYSGEN variables are set for a project. Here are some methods to see a list of the variables: Windows CE 6.0: · Look in your PBXML file using a text editor. This is handy, but give you a long messy list that looks like: <Feature Name="Item" FeatureVariable="SYSGEN_IE_... Anchored="True" /> <Feature Name="Item" FeatureVariable="SYSGEN_IE_... Anchored="True" /> <Feature Name="Item" FeatureVariable="SYSGEN_MLANG" Anchored="True" /> <Feature ......

Posted On Friday, May 22, 2009 4:52 PM | Comments (2)

Platform Builder: What is the _FLATRELEASEDIR?
_FLATRELEASEDIR is an environment variable that defines the folder used to create the OS image. The Platform Builder tools use the environment variable. · Buildrel copies files to the _FLATRELEASEDIR · Makeimg creates the OS image in the _FLATRELEASEDIR · CEShell mounts the _FLATRELEASEDIR as the \Release folder on the device when connected via KITL · If you set WINCEREL=1 the exe and dll files will automatically be copied to the _FLATRELEASEDIR when they are built · When you open a build window, ......

Posted On Monday, May 4, 2009 8:37 PM | Comments (0)

Platform Builder: Creating a New Project Design Template for Windows CE 6.0
The Design Template can be downloaded from: Download the Design Template The new Windows Embedded CE 6.0 New Design Wizard is configurable by adding new templates to a catalog file (PBCXML). You may already know that you can add new BSPs to the catalog and these will then be listed in the wizard. You can also add new design templates for selecting the starting OS components. Having a custom design template can be useful to standardize the systems that you develop. At Eurotech, we have a set of Commercial ......

Posted On Saturday, April 11, 2009 11:47 PM | Comments (0)

Platform Builder Available on MSDN Soon
Microsoft announced recently a version of MSDN subscription that will include the Windows Embedded tools. This means that Platform Builder for Windows CE development will be available. This new subscription option will be available July 1, 2009. See Microsoft Announces MSDN Embedded Subscription and Windows Embedded Developer Update for the full details. It doesn’t look like pricing is available yet, but I suspect that it will be less than the cost of multiple version of Platform Builder, but then ......

Posted On Tuesday, April 7, 2009 6:39 PM | Comments (0)

Platform Builder: Setting the Default Color Scheme at Boot
Among the questions that I received today, was “How can the default color scheme be changed?” The default color scheme is the one used with the system boots. It turns out that changing the default color scheme in an OS image isn’t very easy to do. A quick look in the registry might suggest that it should be easy. It looks like just changing the following registry setting would be enough to do it: [HKEY_CURRENT_USER\ControlP... "Current"=mui_sz:"<Scheme name>" But when you test ......

Posted On Saturday, April 4, 2009 8:37 PM | Comments (0)

Platform Builder: DB_notify_events DB Files Explained
Disclaimer: I am not going to claim to know much about this, but I ran across some information in my files today and thought I would pass it along. I printed this information in 2001, so it is old, but I suspect still relevant. The point of this disclaimer is: Don’t send me emails or feedback asking me for more information about this. The following explains the fields in a DB_notify_events database entry in the .DB files used by Platform Builder. This information could be useful for setting up an ......

Posted On Friday, April 3, 2009 12:53 PM | Comments (1)

Platform Builder: Replacing Files in an NK.BIN with BinMod.exe
A friend and fellow MVP Jeff Arnett recently collaborated on a project to replace some DLL files in an existing NK.BIN file for testing. Jeff tried to use BinMod.exe, but it didn’t work. When trying to extract or replace a DLL the following message was output to the console: BinMod V1.0 built Apr 5 2006 11:32:47 Checking record #70 for potential TOC (ROMOFFSET = 0xFEC634B4) Checking record #195 for potential TOC (ROMOFFSET = 0x00000000) NOTICE! Record 195 looked like a TOC except DLL first = 0x4001C001, ......

Posted On Saturday, May 16, 2009 8:19 PM | Comments (16)

Platform Builder: Where to set Environment Variables
Quite often someone will ask where to set an environment variable for their Platform Builder project. That is really a difficult question to answer without knowing a lot about the project, the BSP and the environment variable. So I thought that I would look into the many ways that an environment variable can be set. My hope is that with an understanding of how to set environment variables that choosing the best way will be easier. The following are ways that I can think of to set environment variables, ......

Posted On Monday, March 16, 2009 10:36 PM | Comments (0)

Platform Builder: Catalog Id ":MS:pccard:mainstoneiii" duplicated
It is not unusual to receive the error “Catalog Id ":MS:pccard:mainstoneiii" duplicated” after cloning a Windows CE 6.0 BSP. Of course the value duplicated may be different depending on which BSP was cloned. NOTE: If you haven’t checked for errors, you should be sure to view the Error List. To do this, select View\Other Windows\Error List then select the Error button. The reason for the message is that the catalog file contains the same entries as the original BSP. It is important to update the catalog ......

Posted On Monday, March 16, 2009 9:02 PM | Comments (4)

Platform Builder: IMGRAM64
This evening someone posted a question about setting IMGRAM64 in the Platform Builder newsgroup. The environment variable IMGRAM64 has always intrigued me for several reasons, so I thought that I would examine some of those reasons. 1. IMGRAM64 is in the project settings Build Options. In Platform Builder 6.0 it is in Project\Properties and in previous versions of Platform Builder it is in Project\Settings. This has amazed me since the first time I saw it there because most BSPs do not support this ......

Posted On Monday, February 16, 2009 10:01 PM | Comments (4)

Platform Builder: How to Determine the Baud Rate of the Serial Debug Port
Every once in a while, someone finds my blog by searching for how to determine the baud rate of the serial debug port. So I thought that I would look into how to answer that for them. First, try 38400, 8 bit, no parity, 1 stop bit and no handshaking. This is a common setting for the serial debug port. Second, read the documentation for your board if you bought it in a system from an OEM. Last, look in the code. If you need to do this, then you must be the OEM and using a BSP from either Microsoft ......

Posted On Monday, January 12, 2009 11:08 PM | Comments (0)

Platform Builder: Formatting Output with DEBUGMSG and RETAILMSG
For those of you who have done a lot of output using printf the following will be familiar, but I think that there are a lot of programmers who have done most of their user interface code with a GUI. I have been getting questions about the format string in DEBUGMSG and RETAILMSG lately. I will not try to be the full documentation on format strings, but I thought that I would explain a few things about the format string that can be useful. You may have seen some of my examples using %s, %8s and %-*s ......

Posted On Monday, July 14, 2008 10:00 PM | Comments (2)

Platform Builder: Clone Public Code
I recently wrote an article about modifying the behavior of KernelIoControl when called by User Mode code. In that article, I stated that you need to clone the Public oemioctl code to your platform. Sounds so simple doesn’t it, and really it isn’t that difficult if you know what you are doing, but for the rest of you I thought that I would walk through the process of cloning code. Many of us use the term “clone code” but what does it really mean? Cloning code means to copy the code to another build ......

Posted On Wednesday, July 2, 2008 2:32 PM | Comments (29)

Platform Builder: Don’t use Build and Sysgen
Ever since the release of Platform Builder for Windows CE 5.0, there has been an item in the Build OS menu labeled “Build and Sysgen” which causes problems for developers. I believe that this item is very useful for Microsoft’s Software Engineers, but it causes problems for the rest of us. The problem is that Build and Sysgen, especially with the Clean Before Building set, will delete binary files that you don’t have the source to rebuild. Once you have run Build and Sysgen and discover that it created ......

Posted On Thursday, June 19, 2008 12:56 PM | Comments (1)

Platform Builder: Using Dat Files to Initialize the File System
If you haven’t noticed already, all of the files that you put in the Windows CE OS image end up in the \Windows folder. There is nothing that you can do about that, but you can creates other folders and copy files into those folders using DAT files. DAT files can be somewhat of a mystery because most BSPs don’t do anything with them and the default OSDesigns don’t include anything in the project.dat file. But, the DAT files in the Public folders do include plenty of examples and Platform Builder ......

Posted On Tuesday, June 17, 2008 10:29 PM | Comments (8)

Windows CE: How to buy Windows CE or Platform Builder
With so many Microsoft products it is very easy to purchase a license. But how do you by Windows CE? If you want to purchase Windows Vista, you would go to a store (either bricks or clicks) and buy the DVD installation and you are off and running. That just isn’t the way Windows CE works. Windows CE is not a typical off the shelf operating system; it is an operating system for embedded computers. So what is an embedded computer? An embedded computer is a special purpose computer that has custom software ......

Posted On Tuesday, June 10, 2008 9:28 PM | Comments (1)

Platform Builder: Managing the Registry
The Registry is an important part of Windows CE and allows you to manage many parts of the system's behavior. You have two registry files available to you to use for managing the registry in your system; platform.reg and project.reg. Platform.reg is used to make changes that apply to your BSP, if you are developing a BSP Project.reg is used to make changes that apply to your project You can use these files to add new registry keys and values, you can change existing values and you can delete keys ......

Posted On Wednesday, June 4, 2008 10:42 PM | Comments (9)

Windows CE 6.0: Exporting a BSP
Ever since Windows Embedded CE 6.0 with Platform Builder shipped, questions about how to export a BSP have arisen. This is because previous versions included an Export BSP wizard. Microsoft included the Export BSP Wizard because importing a BSP required the user to manually load the Catalog File (CEC) into the Platform Builder Catalog. So the wizard helped by eliminating the possibility of user error. The wizard would create an installation file (MSI) that would copy the BSP files to the disk and ......

Posted On Friday, May 30, 2008 1:59 PM | Comments (0)

Platform Builder: Using RES files to modify a Control Panel Applet
Important Update: As was pointed out in the comments, this doesn't always work. I had the opportunity to begin looking into that today when one of our engineers had the same problem, which is that the dialogs don't show up correctly and sometimes not at all. After trying several things, what we now think that we know is that editing the RES files in Visual Studio causes the problem, which means Platform Builder 6.0. Editing the RES files with Platform Builder 5.0 works well. I know that many of you ......

Posted On Wednesday, May 28, 2008 9:56 PM | Comments (7)

Platform Builder: Automatically Flushing the Registry on Changes
I have discussed flushing the registry from applications before in Windows CE: Persisting Registry Changes from an Application. It is possible to set up the file system to automatically flush the registry when using hive registry. The system will automatically flush the registry when the system suspends. Filesys can be configured to flush the registry when changes occur by setting some registry values. [HKEY_LOCAL_MACHINE\System\... “SpawnThread"=dword:1 "FlushPriority256"=dword:FF ......

Posted On Thursday, January 1, 2009 10:43 PM | Comments (4)

Platform Builder: Compiler Optimization and Volatile
Many of you already know about the use of the C/C++ keyword volatile, but I was having a discussion with a colleague this afternoon and the topic came up. The colleague is a bright up and coming engineer who finds himself writing software, but really wanting to design hardware. He was telling me about a test that he wrote to estimate the CPU speed of a board. Simple little application, get the current milliseconds using GetTickCount(), then run a busy loop. When the loop completes call GetTickCount() ......

Posted On Tuesday, December 30, 2008 10:40 PM | Comments (0)

Platform Builder:Building Multiple Folders
I came across an interesting question today – How can I use a sources file to build multiple sub-folders? Of course the obvious answer is don’t do that. Instead set up a tree something like this: MyDriver |- Dirs (file listing sub-folders) |- Folder1 (Create a static library) |- sources |- makefile |- file.c |- Folder2 (Create a static library) |- sources |- makefile |- file2.c |- BuildDLL (Link the libraries to create a DLL) |- sources |- makefile But the question is still valid, can you use a sources ......

Posted On Thursday, December 4, 2008 6:11 PM | Comments (0)

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 (10)

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)

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)

Platform Builder: Debugging the Boot Hive
One of my engineers was working on a new system today and was having a problem setting up a NAND flash disk. The problem was that while he had made a change to the registry to set up the start address and size of the disk, the changes just were not visible in when the OS ran. We both have a lot of experience developing and building Windows CE systems, so we checked the obvious things: 1. He saved Platform.reg where he made the changes 2. He copied Platform.reg to the _FLATRELEASEDIR 3. When makeimg ......

Posted On Monday, October 13, 2008 10:00 PM | Comments (3)

Platform Builder: Getting the Emulator to Resume
Maybe someone knows a better way to get the device emulator to suspend and resume, but since that wasn't my end goal this is a story of what I did to get the emulator to resume. I am sitting in a hotel room with nothing much to do so I thought it would be a good time to add power management capabilities to my Windows CE: A Stream Interface Driver Shell. I brought a device with me, and I have everything I need to use it, except a cable to connect to the serial debug port which I need. So since I already ......

Posted On Monday, August 11, 2008 10:54 PM | Comments (0)

Platform Builder: Windows CE 6.0 Development Certification
Some of you have noticed that I have passed the Windows Embedded CE 6.0 Development exam and therefor am a Microsoft Certified Technology Specialist. As a result, I have received requests for information about the exam. I cannot tell you any more details about the exam than Microsoft publicly publishes about the exam. Why can't I tell you anything more? For two reasons; as a condition of taking he exam you will be required to sign an NDA, and well I can't tell you the other reason because that is ......

Posted On Thursday, July 31, 2008 12:14 AM | Comments (2)

Platform Builder: RETAILMSG vs. DEBUGMSG
What is the difference between RETAILMSG and DEBUGMSG? This question comes up once in a while, so I thought it might be interesting to discuss it. The first thing that we should think about is what are these? The first clue, assuming that we don’t read the documentation, is that they are both in all capital letters. This is usually a clue that they are macros. If they are macros, they cannot be hidden away in a binary, they must be in a header file that we can look at to figure out what they do. ......

Posted On Wednesday, July 23, 2008 10:33 PM | Comments (4)