i386-wince
From Free Pascal wiki
Revision as of 16:24, 26 February 2012 by Marcovaldo (talk | contribs) (→Setup Lazarus/FPC for compiling i386-wince)
This page has been created to collect all information regarding i386-wince target. Although most of today's PDAs, Phones, Tablets use ARM CPUs - dealing with i386 version of CE might make sense as
- There exists a certain amount of industrial controllers running under i386-wince. Some of them originally where XPe but have been migrated to CE. Some of them have been created by the Alliance SIEMENS/Microsoft.
- As Intel tries to regain market share in the embedded area (also Mobile/Tablet), it might be that more mobile/tablet will use X86 platforms (Atom etc then) again.
Prerequisites
- A Windows-CE Emulator (i386 Version!)
For example Windows CE 5.0 Device Emulator(V 8.2.160.0).Install this to a folder. Create a Shortcut to executable(to be able to call it with command line parameters). Edit command line of link to something like
"{path to exe}Emulator_500.exe" /ceimage NK.cem /ethernet virtualswitch
This will startup the emulator using the NK.cem image and creates a bridged ethernet connection(set IP in emulator to fit your network if you have no DHCP server running). Also this emulator allows a shared folder between Host-PC and emulator(This can be your Lazarus project's working folder) - FPC Source code (I used fpcbuild-2.6.0.zip)
- Lazarus (I used a snapshot of 20120225 [ftp://ftp.hu.freepascal.org/pub/lazarus/snapshots/Lazarus-0.9.31-35595-fpc-2.6.1-20120226-win32.exe Lazarus-0.9.31-35589-fpc2.6.1-20120215-win32.exe). The daily shapshot I used has been removed, but that one in the link should work too.
Setup Lazarus/FPC for compiling i386-wince
- Install Lazarus from above Link (just as for compiling Win32 apps)
We use PATH=C:\Prog\lazarus\931\ in the example
- Unzip the fpc sources to a convenient folder
We use C:\Prog\fpc\2.6.0src\ in this example
- Create a batch file (mkCE.bat) with the following content:
PATH=C:\Prog\lazarus\931\fpc\2.6.0\bin\i386-win32;C:\Prog\fpc\2.6.0src\fpcsrc\compiler
make clean all OS_TARGET=wince CPU_TARGET=i386 PP=ppc386.exe
Save this batchfile to C:\PROG\FPC\2.6.0src\fpcsrc. Start this batchfile by doubleclick. (It should run from the command line too, but in my setup, from the commandline there was an error message thrown (*** no libgdb.a found, supply NOGDB=1 to disable debugger support....) - but run from the Windows GUI this run just fine. The popping up console window will show compile progress for some time until it closes again. Then you will find a new file 'build-stamp.i386-wince' in the fpsrc folder. (In this case you can be happy that all worked OK)
- Now there are lots of compiled subfolders in the fpc tree, that need to be copied over into (other positons) of the Lazarus folders.
- packages\{packagename}\units\i386-wince goes to
{lazfolder}\fpc\2.6.0\units\i386-wince\{packagename} where no units subfolder has been created during build, omit this folder
- rtl\units\i386-wince goes to {lazfolder}\fpc\2.6.0\units\i386-wince\rtl
Test Applications
<to be extended>
Useful 3rd Party Tools, Libraries, Links
<to be extended>