Thursday, 14 June 2012

Choosing the right ARM based System on Module (SOM)

I am regularly in the situation where the choice of processor, module and thus vendor selection is still a customer question. This should not be a great surprise as there are so many variants for consideration. So I’ll try and help with my thought process and highlight the major considerations when making this selection. Read more... Let me know your thoughts

Friday, 20 April 2012

Removing Process & Thread IDs from WEC 7.0 Serial Debug Output

One nice feature in Windows Embedded Compact 7.0 is that, unlike earlier versions of Windows CE, the kernel prepends serial debug output with the process and thread identifiers:
PID:00400002 TID:00C4000A Device Power State = NdisDeviceStateD3.


In many cases this is useful and the output is now more like KITL debug output than before. 

With KITL debug output the Platform Builder Debug Message Options dialog gives you control of which information is prepended to the debug messages:


So, what happens if you want to remove the PID and TID from the serial debug trace to reduce the volume of information and/or increase speed?  There's no Platform Builder option to help.

The answer is to modify the OAL and set

g_pOemGlobal->pfnWriteDebugString = NULL;

Setting this pointer to NULL makes the kernel call g_pNKGlobal->pfnWriteDebugString directly instead of prepending the PID/TID information and calling OEMWriteDebugString().

You should be aware that this also bypasses thread synchronization but if you are happy to remove the PID/TID you are probably experienced enough to cope!

For more information refer to NKOutputDebugString and DoODS in WINCE700\PRIVATE\winceos\COREOS\nk\kernel\printf.c

Res2Res Errors During CE 6.0 Makeimg

Once again we are hitting problems during makeimg with

ERROR: Res2Res: WriteResFile: xxxxxxxxxxxxx

The problem can be “fixed” by either

1.       Disabling virus scanning of the temporary directory

2.       Emptying the temporary directory

My temp dir was full of rubbish so I used option 2.  The command line below is much quicker than using Explorer

del /q /f /s %temp%\*

This worked for me.  However, if the problem persists then try option 1.  It worked for a colleague.

Hope this helps!

Wednesday, 28 March 2012

Debugging CE7 apps using VS2005

If you want to build apps for a CE7 system using visual studio 2005 you can (normally you’d use 2008) if you have an SDK for the Windows Embedded Compact 7 (WinCE7) platform and you follow these steps!

I was getting the following error on linking:

corelibc.lib(armsecgs.obj) : fatal error LNK1103: debugging information corrupt; recompile module


To work around this:

- Install the hot fix for VS2005 from http://support.microsoft.com/kb/949009

- Fix any build issues in the project arising from defines not available in VS2005, i.e.:

From imm.h for instance:

DWORD WINAPI ImmGetGuideLineW(HIMC, DWORD dwIndex, _Out_bytecap_(dwBufLen) LPWSTR, DWORD dwBufLen);

To

DWORD WINAPI ImmGetGuideLineW(HIMC, DWORD dwIndex, LPWSTR, DWORD dwBufLen);

Basically removing all “_Out_bytecap_(dwBufLen)” from anything that doesn’t build…

- In the top of one of my files I needed to set

#define __INLINEISEQUALGUID__

As there seem to be two defines for the same named GUID equality function and it causes a link issue.

As the meerkat would say…Simples!

Tuesday, 10 May 2011

Windwos Embedded Compact 7

Direct Insight was recently involved in running a Windows Embedded Compact 7 event at the UK Microsoft Campus. From which an article has been written including information and quotes from me and colleagues.

You can find the article here at http://www.mtemag.com/ArticleItem.aspx?Cont_Title=Real-Time+Operating+Systems%3a+Take+seven

Please have a read and let me know what you think.

>> Nigel

Friday, 11 February 2011

Visual Studio 2005 deploy error after downloading a managed code application to a Windows CE6 R3 device

Thanks to William White for this:-

After deploying a managed code application to a windows CE6 R3 device you get a deployment error something like:

Deploying ‘C:\will\VBProjects\CEApp\bin\Debug\HelloWorld.exe’
Deploying ‘C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\windowsce\diagnostics\System_SR_enu.cab’
Post-deploy error 0×00000001 returned after calling ‘\Windows\wceload.exe /noui \Windows\System_SR_enu.cab’.
========== Build: 1

Visual Studio 2005 will attempt to download the .NET CF 2.0 cab file (System_SR_enu.cab) and automatically install if the device does not already contain the run time (however the OS dependencies for the .NET CF 2.0 must be included in the WinCE6 image). It appears that the version of .NET CF 2.0 included with Visual Studio 2005 SP1 is not compatible with the R3 release of Windows CE6. To fix the problem, shutdown all instances of Visual Studio 2005 and simply download and install .NET CF2.0 SP2:

http://www.microsoft.com/downloads/en/details.aspx?familyid=AEA55F2F-07B5-4A8C-8A44-B4E1B196D5C0&displaylang=en

Try again and everything should be fine.

A successful deployment should then look something like:

DeviceApplication1 -> C:\Documents and Settings\XPMUser\My Documents\Visual Studio 2005\Projects\DeviceApplication1\DeviceApplication1\bin\Debug\DeviceApplication1.exe
—— Deploy started: Project: DeviceApplication1, Configuration: Debug Any CPU ——
Deploying ‘C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\windowsce\wce500\armv4i\NETCFV2.wce5.armv4i.cab’
Deploying ‘C:\Documents and Settings\XPMUser\My Documents\Visual Studio 2005\Projects\DeviceApplication1\DeviceApplication1\bin\Debug\DeviceApplication1.exe’
Deploying ‘C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\windowsce\diagnostics\System_SR_enu.cab’
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

Monday, 10 January 2011

Keeping your Smartphone alive for background processing

Want to keep your windows mobile smart phone alive, even if the user is trying to force it off?

This can be achieved by using the unattended mode, the power manager on Windows Mobile has an unattended state that will effectively look like the phone is off but the CPU will be running in the background with the LCD off. This is used for playing music, downloading emails etc. To invoice this

PowerPolicyNotify(PPN_UNATTENDEDMODE, 1);

To release this do

PowerPolicyNotify(PPN_UNATTENDEDMODE, 0);

Whist in this state you may need to poke the device to stay on by calling the above function again. If you want to wake up the device then use another power API:

// Force backlight and power on
SetSystemPowerState(NULL, POWER_STATE_ON, POWER_FORCE);

This will force the system to wake up fully if you want to display information to the user after your background processing.