Developing an hardware driver
23 Apr 2016 22:28 #73777
by Bocnc
Developing an hardware driver was created by Bocnc
Hi,
I have started developing an ethernet board to drive my servo mill. (Just because I am really interested in how it works)
I have mainly read a lot of source code form other projects and right now my self programmed driver is able to connect to the hal and transmit my planed pins and functions.
My main problem ist, that I do not know how to install the driver when adding ethernet specific dependencies.
When adding these I get error because most includes were not found (like features.h).
I compiled the code hustling halcompile --install.
Not working includes are many libraries I would like to use. ( eg. #include <sys/socket.h>).
I am quite sure that the problem is the install method but I do not know how to solve it.
Would be great if anyone could give me a hint.
I have started developing an ethernet board to drive my servo mill. (Just because I am really interested in how it works)
I have mainly read a lot of source code form other projects and right now my self programmed driver is able to connect to the hal and transmit my planed pins and functions.
My main problem ist, that I do not know how to install the driver when adding ethernet specific dependencies.
When adding these I get error because most includes were not found (like features.h).
I compiled the code hustling halcompile --install.
Not working includes are many libraries I would like to use. ( eg. #include <sys/socket.h>).
I am quite sure that the problem is the install method but I do not know how to solve it.
Would be great if anyone could give me a hint.
Please Log in or Create an account to join the conversation.
23 Apr 2016 22:58 #73778
by andypugh
Replied by andypugh on topic Developing an hardware driver
halcompile isn't especially easy to #include libraries in to. Part of the difficulty is that the files move around during the halcompile process so absolute paths break.
Are you halcompiling a C file or a .comp file?
Are you halcompiling a C file or a .comp file?
Please Log in or Create an account to join the conversation.
24 Apr 2016 06:22 #73786
by Bocnc
Replied by Bocnc on topic Developing an hardware driver
I wrote the driver as a C File.
Please Log in or Create an account to join the conversation.
24 Apr 2016 11:33 #73795
by andypugh
Replied by andypugh on topic Developing an hardware driver
You could try using absolute paths to the #includes.
Be aware that not all system libraries are thread-safe for use in realtime code.
You might want to limit yourself, as far as possible, to functions in the rtapi_* libraries.
github.com/LinuxCNC/linuxcnc/tree/master/src/rtapi
Be aware that not all system libraries are thread-safe for use in realtime code.
You might want to limit yourself, as far as possible, to functions in the rtapi_* libraries.
github.com/LinuxCNC/linuxcnc/tree/master/src/rtapi
The following user(s) said Thank You: Bocnc
Please Log in or Create an account to join the conversation.
Time to create page: 0.084 seconds