Lazarus

Programming => Operating Systems => Windows CE => Topic started by: ertank on August 28, 2015, 10:37:59 pm

Title: Compiled app doesn't run on device itself
Post by: ertank on August 28, 2015, 10:37:59 pm
Hi,

I'm on Lazarus 1.4.2 and fpc 2.6.4. I start a fresh application and do nothing but directly compile it for wince. (Target OS "WinCE", Target CPU Family "arm", Target processor is "default", and LCL widgetset "wince") That compiled application doesn't run on device itself.

When I try to run it I get no error messages. However, application form is not displayed either. I only see name of the project in the task bar below. That's all. No form is displayed. Clicking application on the taskbar does nothing.

If I try a simple console application (code is below), I get runtime error 103 at $0001128C, $0001128C, $00017F40

Console application is compiled only with -O1 parameter.

Code: [Select]
program project1;

begin
  Write('Hello');
end.

Device I am testing is running on Windows CE 6.00, Samsung Processor, Cortex A-8-S5PV2 which seems to be claimed as ARMv7-A

Any help is appreciated.
Title: Re: Compiled app doesn't run on device itself
Post by: Bart on August 28, 2015, 11:32:18 pm
Does WinCE have a console you can write to at all?
If yes, then inLazarus go to Project options -> Compiler options -> Config and target and uncheck the Win32 GUI application checkbox.

Bart
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 28, 2015, 11:39:08 pm
Hi Bart,

Device have a "Command Prompt" if that's what you are asking.

The second application, which crashes, is a console application. Win32 GUI is not checked for it. Yet, I'm getting above mentioned error.
Title: Re: Compiled app doesn't run on device itself
Post by: Bart on August 28, 2015, 11:41:49 pm
The RTE suggests that the file (probably stdout) isn't open.

Bart
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 28, 2015, 11:50:57 pm
Ok, seems I am getting somewhere.

Now, I changed code as follows and it run OK.

Code: [Select]
program project1;

var
  f: TEXT;

begin
  AssignFile(f, '\test.txt');
  Rewrite(f);
  WriteLn(f, 'Hello WinCE');
  Flush(f);
  Close(f);
end.

Now, I am back to Win32 GUI application doesn't run problem.
Title: Re: Compiled app doesn't run on device itself
Post by: Bart on August 28, 2015, 11:57:01 pm
Does a simple TForm only project run?
B.t.w. AFAIK you need not set widgetset explicitely when building for WinCE.

Bart
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 29, 2015, 12:08:26 am
I have the device connected to my computer. I am making constant tests.

Problem is simple, empty form is not displayed.

I have set TargetOS as "wince", CPU family as "arm", processor is "default", LCL widgetset is manually set as "wince"

Still nothing displayed. Only Project name displayed at the bottom. You can understand it at attached picture I hope.
Title: Re: Compiled app doesn't run on device itself
Post by: Bart on August 29, 2015, 12:10:49 am
Does it make any difference if you remove the widgetset (in addidtions and overrides)?
Can you run the program on a device emulator (like WM 6.5 professional)?

Bart
Title: Re: Compiled app doesn't run on device itself
Post by: Bart on August 29, 2015, 12:12:31 am
Only Project name displayed at the bottom. You can understand it at attached picture I hope.

What happens if youc lick on that?

Bart
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 29, 2015, 12:19:10 am
I didn't understand what you mean by "(in additions and overrides)" below. However, attached pictures shows current situation.

I don't know how I can setup a device emulator. I have visual studio 2008 installed. It has one emulator. However, I don't know how to get my exe run by it.

When I click on that bottom thing, nothing happens. It doesn't come up, it doesn't have focus on it. Nothing. I have to kill it using task manager in the OS.
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 29, 2015, 12:30:22 am
Allright, I managed to run my test project in emulator. It is "USA Windows Mobile Pocket PC 5.0 R2 Emulator" It seems that Application is running OK on that device.

I added a TButton and a TEdit. They both run ok. However, real device I have is not running it.
Title: Re: Compiled app doesn't run on device itself
Post by: Bart on August 29, 2015, 12:40:53 am
Sorry, I'm out of suggestions.
Your project settings seem OK to me.

Bart
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 29, 2015, 12:47:31 am
Yes, that's where I am stuck at. Thanks for suggestions though.
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 29, 2015, 11:40:47 am
I would like to have additional help if someone can, please.
Title: Re: Compiled app doesn't run on device itself
Post by: vincococka on August 29, 2015, 04:15:31 pm
Hi,

regarding console wince application - try adding following to the beginning of the code, hope it helps
Code: [Select]
{$APPTYPE CONSOLE}
If you want we can organize some TeamViewer session to investigate whats going on.
In case you have some spare time send me PM.

V.

Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 29, 2015, 05:10:26 pm
Hi vincocoka,

There is no problem with console applications. They run OK. I intend to run regular, graphical "form" application. They are the ones causing problem.
Title: Re: Compiled app doesn't run on device itself
Post by: vincococka on August 29, 2015, 06:49:01 pm
Have you tried to build debug version and run it via gdb?
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on August 30, 2015, 01:19:18 am
I don't know how to do that. We might try this via TeamViewer. I'm on GMT+2 European timezone.
Title: Re: Compiled app doesn't run on device itself
Post by: avra on August 31, 2015, 11:40:35 am
Device I am testing is running on Windows CE 6.00, Samsung Processor, Cortex A-8-S5PV2 which seems to be claimed as ARMv7-A.
According to http://wiki.lazarus.freepascal.org/WinCE_port last WinCE supported is 5.2.1 (Windows Mobile 6.5). However, you might want to check these links:
http://forum.lazarus.freepascal.org/index.php/topic,23237.msg138709.html#msg138709
http://forum.lazarus.freepascal.org/index.php/topic,23277.msg165343.html#msg165343
http://wiki.freepascal.org/WinCE_Programming_Tips#Platform_specific_Tips
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on September 01, 2015, 08:25:08 am
Hi Avra,

I checked out these links. I suppose I will not be able to code for WinCE 6.0 with Lazarus, until it is supported (if ever) in the future.

Thanks for clarifying the problem.

Title: Re: Compiled app doesn't run on device itself
Post by: avra on September 01, 2015, 09:33:48 am
I checked out these links. I suppose I will not be able to code for WinCE 6.0 with Lazarus, until it is supported (if ever) in the future.
Only maintainer can answer that...
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on November 13, 2015, 07:55:12 pm
I have finally found my problem.

First of all, anybody can use "fpc -Parm -i" to see what CPUs are supported. I see that ARM7 is supported.

Additionally, there are several people helping bug solve process on WinCE 6.5 versions. So, I can say WinCE version supported is at least 6.5.

Regarding my problem, it turned out that I need to use below code in the OnLoad event of main form to be able to see my form.

Code: Pascal  [Select][+][-]
  1. Self.Top := 0;
  2. Self.Left := 0;
  3.  

If need to see Title bar set Top to 25 or 26.

For some reason below properties are not working on WinCE platform:
BorderStyle
WindowSize

BorderStyle seems to be bsDialog or bsSingle with no sizing available. Linked to this, WindowSize := wsMaximized is not working.

Just my findings related with my problem. Putting here to support people that hit same problem as me.

Regards,
Ertan
Title: Re: Compiled app doesn't run on device itself
Post by: LazaAbrunhosa on November 19, 2015, 05:46:42 pm
Hi

I'm with the same problem on the device.  Motorola MC2180  WinCE.
When I try to run it, I get no error messages. It does nothing.

Windows CE 6.0  and Lazarus 1.4.4   and   fpc 2.6.4 

I try everything but it d'nt work, did you solve this problem?

Best regards

Title: Re: Compiled app doesn't run on device itself
Post by: Laksen on November 19, 2015, 06:58:55 pm
Does it show up in the WinCE taskbar?
Did you set the forms left and top properties to zero?
Does a ShowMessage('test'); show a message dialog?
Title: Re: Compiled app doesn't run on device itself
Post by: LazaAbrunhosa on November 19, 2015, 07:16:36 pm
Hi

   1-No it d'nt appear on the taskbar.

   2-Yes I set the form1 letf and top to Zero

   3-No it d'nt show the  message dialog
       He does nothing

    I was program the pidion M-150  windows CE 5.0 and it works fine
    But this device  motorola MC2180 windows CE 6.0 d'nt work
   






Title: Re: Compiled app doesn't run on device itself
Post by: avra on November 19, 2015, 08:47:51 pm
Additionally, there are several people helping bug solve process on WinCE 6.5 versions. So, I can say WinCE version supported is at least 6.5.
You are confused a little. Windows Mobile 6.5 existed, but WinCE 6.5 never existed. There was WinCE 6.0 and after that WinCE 7.0 was next. Windows Mobile 6.5 was built on WinCE 5.2. Lazarus supports up to WinCE 5.2.1 (so not WinCE 6.0 and 7.0).

https://en.wikipedia.org/wiki/Windows_CE#History
https://en.wikipedia.org/wiki/Windows_Mobile#Windows_CE
http://stackoverflow.com/questions/474770/what-version-of-ce-is-window-mobile-6-5-built-on
http://forum.lazarus.freepascal.org/index.php/topic,29489.msg186580.html#msg186580
http://wiki.freepascal.org/WinCE_port
Title: Re: Compiled app doesn't run on device itself
Post by: ertank on November 19, 2015, 11:17:27 pm
I'm confused again. I have attached screen capture. Is this a WinCE 6.0 or Windows Mobile 6.0 device I am using in my case? And, how can I understand the kernel version if I can?

Just want to clarify my own situation here.
Title: Re: Compiled app doesn't run on device itself
Post by: LazaAbrunhosa on November 20, 2015, 01:24:57 pm
Hi

Your device have the same OS (Windows CE Version 6.0) of mine motorola MC2180 but your processor is samsung  and mine is processor Marvell PXA32X-P.

Is because the type of CPU  Lazarus applications do not work?

The program sqliteviewer for sqlite db not work too on my device.

I think is something on the WinCE that block the applications, or memory is too Low,
i don't know.

Could you send a simple app compiled on lazarus that work on your device to test?

Best Regars
Title: Re: Compiled app doesn't run on device itself
Post by: avra on November 20, 2015, 03:52:18 pm
Is this a WinCE 6.0 or Windows Mobile 6.0 device I am using in my case?

The answer is on your screenshot. "Microsoft Windows CE Version 6.00" is WinCE 6.0, which is not officially supported by Lazarus.
Title: Re: Compiled app doesn't run on device itself
Post by: LazaAbrunhosa on November 23, 2015, 11:55:21 am

Hi

Lazarus compile application for the windows embedded handheld 6.5, it works or not?
I want to develop an application to a  device ( Dolphin 60s Scanphone) with windows embedded handheld 6.5.

Can anybody help

Thanks
Title: Re: Compiled app doesn't run on device itself
Post by: avra on November 23, 2015, 01:28:36 pm
Lazarus compile application for the windows embedded handheld 6.5, it works or not?
I want to develop an application to a  device ( Dolphin 60s Scanphone) with windows embedded handheld 6.5.

This is the last time I do your homework.

According to http://www.microsoft.com/windowsembedded/en-us/windows-embedded-handheld-6-5.aspx "Windows Mobile 6.5" and "Windows Embedded Handheld 6.5" are compatible. On http://wiki.lazarus.freepascal.org/WinCE_port you can find that "The following platforms are supported: ...Windows Mobile 6.5 - WinCE version: 5.2.1", so Lazarus seams to be compatible with your Dolphin 60s Scanphone.

You should seach forum for info on setting your Lazarus for cross compiling for Windows CE / Windows Mobile. If you use CodeTyphon instead then there is a nice tutorial here: http://www.pilotlogic.com/sitejoom/index.php/wiki?id=221.
Title: Re: Compiled app doesn't run on device itself
Post by: LazaAbrunhosa on November 23, 2015, 01:52:17 pm

thanks avra and i ́m sorry, I didn't want to disturb

Best Regards


Title: Re: Compiled app doesn't run on device itself
Post by: avra on November 23, 2015, 03:29:18 pm
thanks avra and i ́m sorry, I didn't want to disturb
You are welcome. There are no hard feelings at all when someone is polite as you are. A newbie is just expected to value other people's time and do as much as he can on his own before asking for help. I have not seen any effort shown in last post - only questions that could be easily googled out. For example, if you have just searched the web for "windows embedded handheld 6.5" you would find the Microsoft (or some other) page with all the compatibility info you needed that I have quoted for you. If you show some research effort then no one could be disturbed even for a question like "Do I understand correctly this web page that <put here any compatibility question you like>".
TinyPortal © 2005-2018