Monday, 30 April 2007
Using Multi/Dual Core Processors with Platform Builder
set BUILD_MULTIPROCESSOR=2
You’ll then see in taskmanager that your CPU usage goes up to 100% now instead of just past 50%!
Removable disk timeouts in CE
Ever wondered why it takes ages for the Windows CE filesystem to remove SDCards from the filesystem after physically removing the card?
Well its because there are two FATFS registry settings which affect this behaviour. Also these are the reason why after a resume an SDCard can take 12 seconds to become responsive again if a ReadFile operation was called when the driver was powering down for the suspend.
"PNPUnloadDelay"
Specifies the time delay in milliseconds between unmounting and detaching a device.
Used during suspend/resume cycles where a block driver might unload and reload on resume.
Default is 5000 microseconds.
"PnPWaitIoDelay"
Specifies the amount of time waited before re-trying an I/O operation on an unavailable device.
This subkey is not present in the default registry, but may be added by the OEM. If this value is not specified, it is assumed to be three times that of PNPUnloadDelay
See :
http://msdn2.microsoft.com/en-us/library/aa912238.aspx
The default is set in CE5.0 as 4 seconds to unmount the volume after device removal, this is the delay you see in explorer. And 3 x 4 seconds if any IO operation fails (i.e. if an app is reading/writing to an SDCard whilst the device is suspending/resuming)
Wednesday, 25 April 2007
Bluetooth (serial) SPP using Sockets...!
// create your BT socket
SOCKET s = socket (AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
// Create the connection information, this is the RFComm protocol for SPP
SOCKADDR_BTH sa;
memset (&sa, 0, sizeof(sa));
sa.addressFamily = AF_BTH;
sa.btAddr = device;
sa.port = BT_PORT_ANY;
sa.serviceClassId = RFCOMM_PROTOCOL_UUID;
// connect...
connect (s, (SOCKADDR *)&sa, sizeof(sa))
Once connected you can use send/recieve to send over the SPP connection:
send (connectedSocket, (char*)str, len,0)
recv( connectedSocket, str, len,0)
This way you don't have to map serial ports, this was tested on Windows XP but should also work on windows CE.
It was tested printing GPS information from a TOMTOM reciever.
CE6.0 and DumpMem()
Debug in CE6.0 and PB6.0
Sync Mode
Here the target device waits until the host displays the debug message. The advantage being that you see messages when they were sent but it does slow down the target device.
Async Mode
Here the target device runs as fast as possible. The debug message is queued on the host to allow the device to continue. Debug is only displayed on the host as time permits.
These debug modes are available via the host's registry.
HKCU\Software\Microsoft\Platform Builder\6.00\Debug
DWORD value "SynchronousDebugMessage"
0 == ASYNC
1 == SYNC
Tuesday, 24 April 2007
How to get IMEI, SIM number, Operator and country
- The Modem IMEI number
- The SIM number (not the phone number)
- The SIM operator
- The SIM operator ID and cell country
Monday, 23 April 2007
Taking control of the "Back" button on Windows Mobile
Thursday, 19 April 2007
How to get your phone number
Wednesday, 18 April 2007
EVC 4.0 Remote Tools
View the file properties of the directories:
C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\Bin
C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\Bin\WCE500
Click the "Advance" button
Click to check the "For fast searching, allow Indexing Service to index this folder" check box
Click "OK"
Vista and ActiveSync
One unfortunate oversight is that it will not currently Sync with the new Vista Windows Calendar or Email applications. Microsoft, however, are planning a new service release that will support this applications in the future.
Signing Windows Mobile Application Code using Miicrosoft Visual Studio 2005
- Navigate to C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 SDk\Tools
- Double-click on the SDKSamplePrivDeveloper.pfx file
- Press the "Next" button on the "Welcome to the Certificate Import Wizard" dialogue
- Press the "Next" button on the "File to Import" dialogue
- Press the "Next" button on the "Password" dialogue
- Press the "Next" button on the "Certificate Store" dialogue
- Press the "Finish" button on the "Completing the Certificate Import Wizard" dialogue
- Press "Ok" on "Completed" dialogue
- Repeat the process for the SDKSampleUnprovDeveoper.pfx file
Having installed the certificates you will now need to sign your CAB's, DLL's and EXE's against them. This is done as follows:
- Open your Microsoft Visual Studio project solution
- Select from the menu Project->Properties
- Expand the "Configuration Properties" tree in the left-hand pane
- Expand the "Authenticode Signing" in the "Configuration Properties" tree
- Select "General"
- In the right-hand pane change the "Authenticode Signature" selection to "Yes"
- Select the "Certificate" field and press the "browse" ellipse to the left
- Select the certificate you wish to sign against marked "TEST USE ONLY - Sample Privileged Root for Windows Mobile SDK" or "TEST USE ONLY - Sample UnPrivileged Root for Windows Mobile SDK" and hit OK
- Select "OK" to properties dialogue
On your next build Visual Studio will now automatically sign your executable.
Visual Studio 2005 and Windows CE6.0 Problems
Also SP1 is needed when running on Windows Vista.
Unlocking a Smartphone for development
- Navigate to HKLM\Security\Policies\Policies\
- Change the "00001001" value to a decimal 1
- Change the "00001005" value to a decimal 40
- Reboot the device
- First install the Windows Mobile Smartphone SDK. This is available here from Microsoft.
- Copy the file C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Tools\SDKCerts.cab onto the device.
- Launch the CAB file.
- Reboot the device.
- Navigate to HKLM\Security\Policies\Policies\
- Change the "00001001" value to a decimal 2
- Change the "00001005" value to a decimal 16
- Reboot the device
Cellcore on Windows CE6.0
CE6.0 comes with two examples modem drivers (RIL - Radio Interface Layers) for the TTPCom and Enfora Modems.
Most of the sources, headers and registry entries can be found under the CE6.0 tree here:
C:\WINCE600\PUBLIC\CELLCORE
Here you’ll also find the 710 Multiplexer, this component effectively splits the single serial port that the modem is available on into two virtual serial ports (default is COM9 and COM7).
To make phone calls Cellcore uses TAPI (Telephone Application Programming Interface) see some of the Smartphone/PocketPC SDK examples for some coding examples.
Making data calls can be done using RAS Dial up, but the RAS setup needs to specify the APN for the data connection. There are no examples under Windows Mobile as this is all handled in Connection Manager on WinMobile.
CE6.0 comes with a WWANDIS component which looks like it virtualises data connections to have a ‘Virtual Ethernet’ driver over GPRS, but there aren’t any docs I can find, anyone know how this works?
Mike Hall has a demo of Cellcore in action on an electronic picture frame… see Mikes Cellcore Demo
C4All The start of a new era
Rob Nock
- Spent 9 Years working with Mitsubishi PC Division (Apricot Computers) and has been with Intrinsyc since 1999.
- Both jobs have led to in depth experience with embedded systems.
- Worked on Windows CE from version 3.0 up to 6.0.
- Worked on Windows Mobile 5.0 and 6.0.
- Ported BSP's, written numerous drivers and applications.
Graeme Wintle
- Previous to Intrinsyc (also since 1999 - Rob started the same day!) working at Nokia Telecoms and GST Technology
- 15 Years of experience in the embedded space
- Experience ranging from OS Porting to Application design on Windows CE and Windows Mobile
- 17 hardware platforms under my porting belt so far...!