[fpc-pascal] USB Human Interface Devices

James Richters james at productionautomation.net
Wed Aug 7 11:07:45 CEST 2019


>I'm going to have a look at that. Actually, it seems there's no package for fpc windows 64 bits.

 

No there isn’t , which is odd because 64bit computers vastly outnumber 32bit computers… but I guess since 32bit code runs on both if you needed to pick one then 32 would be the one to pick… I do see that the reason some platforms aren't available is that more builders and testers are needed.. this is not the first time I've wanted the full FPC package for Win64,  I'd be happy to volunteer to build and test the x86_64-win64 versions.... if someone can teach me how to build it... I've managed to get previous versions of FPC win x86_64-win64 but I remember it wasn't easy for me to build and someone was kind enough to give me a copy that they built.

 

>The short answer would be to advise you to download and install lazarus ( https://www.lazarus-ide.org/  ) from https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.4/lazarus-2.0.4-fpc-3.0.4-win64.exe/download

 

I gave this a try and…. Success!!  I was able to compile it!  

 

>If you install it in C:\lazarus\, you'll end up with a 64 bits fpc in C:\lazarus\fpc\3.0.4\bin\x86_64-win64 . You can run it from command line as usual.

 

Yes the command line works, but the Lazarus copy of FPC 3.0.4 is incomplete, mainly it is missing FP.Exe…  The Text IDE, which I actually really like and prefer.  It is also missing a lot of other things.. I didn’t investigate fully but there are 81 files in the bin directory of FPC3.0.4 and only 68 in the Lazarus version.

Does anyone know how I can get the full FPC3.0.4 package compiled for X86_64-win64?  I can try to figure out how to build it again..  I seem to recall there was some issue with the text IDE and I just ended up going back to i386-Win32 when 3.0.4RC1 came out.

 

>You can also try to replace the libusb-1.0.dll with the one from libusb-1.0.22\MinGW32\dll from https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z .

 

I could not get i386-win32 to work no matter what I did.  It would be nice to be able to use 32bit windows, but for my purposes, 64bit would be fine, I’ll have to just figure out how to compile everything else 64bit… I can use the command line of course with what I have, but I really like to have an IDE to take me to the source code of any compiler errors.  I may try to compile the rest of my project with Lazarus again and see what the exact problems are… maybe I’m just missing something simple.  I think part of the problem is that I have the FPC text IDE already set up with all my options and I don’t know how to put what is needed into Lazarus… and the default settings won’t work.  I have a lot of {$mode TP} units mixed with other types of units but I don’t have everything defined in my source, it depends on the compiler settings being the way I have them in the text IDE

 

Here’s my output from using FPC3.0.4 x86_64-win64 included with Lazarus:

 

I:\Programming\Lazarus\fpc\3.0.4\bin\x86_64-win64\fpc.exe -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Filib\x86_64-win64\ -Fu.. -Fu. -FUlib\x86_64-win64\ -FE. -o.\test1library.exe .\test1library.pas

 

Hint: (11030) Start of reading config file I:\Programming\Lazarus\fpc\3.0.4\bin\x86_64-win64\fpc.cfg

Hint: (11031) End of reading config file I:\Programming\Lazarus\fpc\3.0.4\bin\x86_64-win64\fpc.cfg

Free Pascal Compiler version 3.0.4 [2019/08/04] for x86_64

Copyright (c) 1993-2017 by Florian Klaempfl and others

(1002) Target OS: Win64 for x64

(3104) Compiling .\test1library.pas

(9015) Linking .\test1library.exe

(1008) 96 lines compiled, 0.2 sec, 166944 bytes code, 6612 bytes data

(1022) 2 hint(s) issued

 

I:\Programming\pas-libusb_test_dll\src\examples>test1library

Using libusb(x) v1.0.22.11312

Found 21 devices:

  Bus   3 Device   0: ID 1B21:2142,  port:   0, Speed: Unknown

  Bus   1 Device   0: ID 1B21:2142,  port:   0, Speed: Unknown

  Bus   2 Device  14: ID 1B1C:0C10,  port:   3, port path from HCD: 0->3, Speed: 12 Mbit/s (USB FullSpeed)

  Bus   2 Device   8: ID 1B1C:0C12,  port:  10, port path from HCD: 0, Speed: 12 Mbit/s (USB FullSpeed)

  Bus   2 Device  10: ID 0E50:0002,  port:   2, port path from HCD: 0->0, Speed: 1.5 Mbit/s (USB LowSpeed)

  Bus   2 Device  39: ID 0424:274C,  port:   5, port path from HCD: 0->5->5, Speed: 480 Mbit/s (USB HighSpeed)

  Bus   2 Device  38: ID 047D:1020,  port:   3, port path from HCD: 0->1->1, Speed: 1.5 Mbit/s (USB LowSpeed)

  Bus   2 Device  12: ID 0C45:7403,  port:   2, port path from HCD: 0->2, Speed: 12 Mbit/s (USB FullSpeed)

  Bus   2 Device   6: ID 051D:0002,  port:   3, port path from HCD: 0, Speed: 12 Mbit/s (USB FullSpeed)

  Bus   2 Device  36: ID 04E8:61F5,  port:   1, port path from HCD: 0->128, Speed: unknown (4)

  Bus   2 Device  40: ID 1B1C:1B4F,  port:   4, port path from HCD: 0->19->19, Speed: 12 Mbit/s (USB FullSpeed)

  Bus   2 Device   5: ID 05E3:0608,  port:   7, port path from HCD: 0, Speed: 480 Mbit/s (USB HighSpeed)

  Bus   2 Device   7: ID 05E3:0608,  port:   8, port path from HCD: 0, Speed: 480 Mbit/s (USB HighSpeed)

  Bus   2 Device  13: ID 1B1C:1C08,  port:   2, port path from HCD: 0->0, Speed: 12 Mbit/s (USB FullSpeed)

  Bus   2 Device   1: ID 0BDA:0411,  port:  17, port path from HCD: 0, Speed: unknown (4)

  Bus   2 Device   4: ID 1A40:0101,  port:   5, port path from HCD: 0, Speed: 480 Mbit/s (USB HighSpeed)

  Bus   2 Device   0: ID 8086:A2AF,  port:   0, Speed: Unknown

  Bus   2 Device  37: ID 0424:2734,  port:   1, port path from HCD: 0->38, Speed: 480 Mbit/s (USB HighSpeed)

  Bus   2 Device  15: ID 05E3:0610,  port:   4, port path from HCD: 0->16, Speed: 480 Mbit/s (USB HighSpeed)

  Bus   2 Device  41: ID 0A5F:0006,  port:   2, port path from HCD: 0, Speed: 12 Mbit/s (USB FullSpeed)

  Bus   2 Device   2: ID 0BDA:5411,  port:   1, port path from HCD: 0, Speed: 480 Mbit/s (USB HighSpeed)

 

YAY!  I have no idea what this means yet.. but I can see these are the USB devices on my system!

 

I’m going to figure out how to compile the rest of my project with x86_64-win64 and switch to some IDE that works with that,  and then I can continue trying to figure this usb stuff out.

 

James

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190807/48b413e3/attachment.html>


More information about the fpc-pascal mailing list