Compiling HAL module?

More
27 Aug 2020 15:03 - 03 Sep 2020 00:29 #179693 by mhel
Compiling HAL module? was created by mhel
Hello,
'am not sure where to post this.
I've been searching for a good while now,
but can't seem to get a hit, or most likely I'm
not using the right keyword.

I'm attempting to port this github.com/Wireb/PICnc-5axis
to an stm32f4 (micro). I think I got the handle on the micro side,
I'm testing it with a tinkerboard-s (got it a year ago but drivers wasn't good back then).
I've tested spi communication with my tinkerboard and the micro and
it seems to be working as expected.

So I got LinuxCNC (lcnc) pre2.9 uspace running on my board
with Slackwarearm on it with minimal Xfce 5.4.54 kernel PREEMPT_RT
The sim works fine so I'm off to the next stage.
I'm not exactly sure how to build the module.
How does one compile a module?
My limited search hit lead me to halcompile.
I tried:
halcompile --compile the_module
and after correcting mistakes I managed to get
the_module.so and copied it to rtlib directory.
Now trying to run lcnc with example ini and hal
modified to fit the_module name in the C codes.
I get:
rtapi_app_main : Permission denied (-13)
and not really much information in the logfile.

I thought maybe I should be compiling with
halcompile --compile --userspace the_module
now I get these:
error: expected declaration specifiers or ‘...’ before string constant
   58 | MODULE_LICENSE("GPL");
highlighting the string constant "GPL",
same goes to the rest of code with MODULE_ in it.

So how to properly write/compile a module?
Any pointers, docs to read, encouragedment/discouragement
is welcome.

tinkering...

Edit:
...wrote too soon, back to square one.

Edit last:
Darn I'm so dumb (probably too harsh, maybe blind), there's a whole section above that has everything HAL on it :-)
Last edit: 03 Sep 2020 00:29 by mhel.

Please Log in or Create an account to join the conversation.

More
27 Aug 2020 17:43 #179708 by mhel
Replied by mhel on topic Compiling HAL module?
It turns out its a spi device permission problem.
It's not easy doing everything from scratch. ;-)

I'm proud to say that my halcmd test is communicating
with the stm32f4 board...unfortunately that's all there is to it for now.

...more tinkering.
The following user(s) said Thank You: Mike_Eitel, tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.160 seconds
Powered by Kunena Forum