Showing posts with label KITL. Show all posts
Showing posts with label KITL. Show all posts

Monday, March 2, 2009

KITL ? What's that ?

Always wanted to know what KITL stands for ! In this case you should have a look at this really interesting video from Kurt Kennett from Microsoft.



Windows Embedded CE: understanding KITL


- Nicolas

Tuesday, October 14, 2008

Flash back to Windows CE .Net 4.2

Last few weeks I have been involved into a customer project running Windows CE 4.2…. Woooaa a big jump in the past. I don't know if you were already involved in Windows CE at this time, but a big gap is visible between this version of Windows CE and the latest one… Thanks to Microsoft for all those improvements… Connectivity options was Configure Remote Connection… so i took me 10 minutes to find the right menu, as every thing change… But one thing that I found really surprising is the time spent to do a sysgen under Windows CE 4.2 with the most up-to-date development Platform. It took me only 10 minutes, while it was around 40 minutes on the best computer available at the release of Windows CE 4.2… oups I should say Windows CE .Net 4.2, the time when the .Net revolution starts :-).

The KITL over serial implementation give me a big headache, as at the time of Windows CE 4.2 the frames sent and received by the target where created and checked by the OAL itself before forwarding them to the upper layer of KITL… meaning that you had to know exactly the format of the frames sent and received by Platform Builder, otherwise the default KITL over serial implementation of Platform Builder was not able to communicate with the target. You can imagine that finding this information is not so easy as the MSDN documentation at this time was not so complete as it is now. But thanks to free sample BSPs, and to my favorite web search engine , I found my grale : "The definition of the KITL frames".

So as an archive for the Windows CE community here is the KITL header definition for Windows CE 4.2 : Header - Data - Trailer

typedef struct _SERIAL_PACKET_HEADER
{
UCHAR headerSignature[HEADER_SIGNATURE_BYTES];
UCHAR pktType;
UCHAR Reserved;
USHORT payloadSize;
UCHAR crcData;
UCHAR crcHdr;
} SERIAL_PACKET_HEADER;

With :
  • headerSignature : the signature of the header : { 'k', 'I', 'T', 'L' }
  • pktType : use by KITL to identify the service associated to the frame
  • payloadSize : packet data size, not including this header
  • crcData : packet data check sum (simple, 8-bit crc)
  • crcHdr : header data checksum (simple, 8-bit crc)

The simple 8 bits check sum algorithm :
UCHAR ComputeChecksum(PUCHAR pBuf, USHORT len)
{
USHORT s = 0;
UCHAR csum = 0;

for(s = 0; s < len; s++)
csum += *(pBuf + s);

return csum;
}


- Nicolas

Tuesday, November 20, 2007

Static IP address for KITL (VMINI)

When you want to connect to your Windows CE device using KITL over Ethernet and having the network support enable, you have to select the following components and settings in your OSDesign :
  • TCP/IP
  • Wired Local Area Network (802.3, 802.5)
  • KITL support in you OSDesign settings
At this time the VIMINI driver is mounted on your system to provide access to the network API and support even if your physical network interface is already handled by KITL. This Virtual network interface (Virtual Mini Adapter) requires an IP address like another network interface.
If your network have a DHCP server enable, this interface will get an IP Address automatically. If it's not the case, you will have a default IP address (169.254.50.67) associated to this network interface and unfortunately this interface cannot be used as is. You must provide a valid IP address to this VMINI network driver through the registry.
; Enable static IP address for VMINI1
[HKEY_LOCAL_MACHINE\Comm\VMINI1\Parms\Tcpip]
"EnableDHCP"=dword:0 ; Disable the DHCP/ enable static IP
"IPAddress"="192.168.1.3"
"SubnetMask"="255.255.255.0"
Note : VMINI1 is the correct key path to point to the registry settings used by this driver.
Those settings must be added to your project.reg as those settings are specific to your current OSDesign and not linked to the BSP.
Using the same technique you can set a Static IP address to other network interfaces available on your device.

In the case of the usage of the Emulator BSP, the network interface used in this case is not VMINI1 but the NE20001 driver provided by Microsoft, emulating the access to your real network interface. In this particular case the registry settings will be :
; Enable static IP address
[HKEY_LOCAL_MACHINE\Comm\NE20001\Parms\Tcpip]
"EnableDHCP"=dword:0 ; Disable the DHCP/ enable static IP
"IPAddress"="192.168.1.3"
"SubnetMask"="255.255.255.0"

- Nicolas

Tuesday, August 14, 2007

Debugging technics for Windows CE (Part 1)

Everybody want to reduce the time used to debug developments, so I will share with you my tips to spend less time in debugging for your drivers, applications ...
First things that we can avoid is to download the Windows CE image to the device every time we made a modification of the driver or the application. So the idea is to exclude the driver or the application from the nk.bin. So in that case how my driver or application can be loaded ?
If KITL is enable in your Windows CE image you have by default an NFS (Network Filesystem) mounted in the RAM filesystem under Release folder. This NFS is the content of you _FLATRELEASEDIR on you desktop computer. By using this NFS you can access the content of your _FLATRELEASEDIR directly from Windows CE. When accessing a file for loading, the OS is using this NFS partition to find missing files in the current RAM filesystem. In our case the file is not available in the RAM filesystem but in the NFS partition, so the OS will copy it from this network path to the RAM filesystem.
In other words, if your binary file is not in the NK.bin but available on your harddrive in the _FLATRELEASEDIR, the system will be able to load it.

You can imagine now how to avoid the download of the Windows CE image every time you modify your source code.

-Nicolas

Thursday, June 7, 2007

Troubleshoot TFTPD32

I'm actually using a very cool software called tftpd32 as DHCP server on my desktop computer, to assign IP address to my embedded board, when I am working out of the office. This software developed by Ph. Jounin (link) is a tftpd client/server, dhcp server and sntp server.

I was using version 3.02 since last week I moved to version 3.22. That new version integrate optimization, and better management of the network resource, but also new functionalities. And if you use it out of the box without looking to the default selected options, you will have troubles with your Windows CE device and Platform Builder. Especially when you will use KITL.
By default that new version enable an automatic ping request before assigning an IP address to make sure that IP is not currently used. The problem is when KITL starts VMINI interface, it asks by default for an IP address using a DHCP request again. As the board already ask for an IP address during the boot process of the bootloader, an IP address is already assign to the MAC address of the board. So TFTPD32 send a ping request to the board IP address with the board MAC address (see TCP/IP protocol specification).
As the network interface of the board is not completely initialized (remember KITL is currently in the initialization process), but receives a ping request and it locks the KITL VMINI initialization.
So to avoid that misunderstood between the device and TFTPD32 you have to disable that functionality.



- Nicolas