run Linuxcnc on xenomai with EVL(the realtime core)

More
19 Apr 2024 21:11 #298669 by rodw
I''ve forgotton where, but there is code that decides whether to build for rtapi or realtime.
There is a conditional that decides which type of thread to create for the servo thread. I think rtapi is decided by an environment variable.
My take was this needed to be changed to acommodate EVL and this code would need reviewing.
github.com/LinuxCNC/linuxcnc/tree/master/src/rtapi  

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

More
20 Apr 2024 19:10 #298747 by andypugh
It should be possible to run the linuxcnc-uspace debian package with Xenomai if you install the xenomai-uspace helper package.

Unfortunately I have not figured out how to build that package on demand, but it did get built until 2.8.4 on Jessie, Precise and Wheezy. You can find it here, for example:
www.linuxcnc.org/dists/wheezy/2.8-rtpreempt/binary-amd64/

Supoport for building these helper packages was probably removed in this commit: github.com/LinuxCNC/linuxcnc/commit/6f28...5d5904ffec3998a833ef
Which I would quite like to reverse, but that is not a trivial task this much further down the line.

It is still possible to build from source for RTAI (I do it all the time) and it might still work with Xenomai. Have you tried

./configure --with-realtime=path-to-xenomai

?

It might work, there is ertainly mention of Xenomai in the configure script:
github.com/LinuxCNC/linuxcnc/blob/db906d...rc/configure.ac#L143

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

More
21 Apr 2024 06:37 #298761 by cgy
Thank you all for the suggestions. Unfortunately, using Xenomai 4's EVL with LinuxCNC didn't work for me; I've tried everything.
Following my instructor's advice, I switched to using Xenomai 3 for the build. (this is a topic I'm exploring)During the build process, Xenomai was successfully detected.
 
However, when running it, the real-time core of Xenomai still wasn't utilized.
 
I found some posts on the forum from a few years ago with the same issue,

forum.linuxcnc.org/9-installing-linuxcnc...ith-xenomai3?start=0

but I couldn't find a solution. Do any of you have new suggestions?
Attachments:

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

More
21 Apr 2024 10:29 #298770 by andypugh
I would like to understand this myself.

Is there any evidence of the uspace_xenomai.cc file being compiled?

Maybe you could try installing the uspace 2.8.4 deb + matching uspace-xenomai deb on your Xenomai3 system and see what happens?

This is where the rtapi wrapper app prints "POSIX non-realtime" or "POSIX realtime" and it is still looking for Xenomai: github.com/LinuxCNC/linuxcnc/blob/master...ce_rtapi_app.cc#L797

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

More
27 May 2024 20:03 #301611 by engineer
I refer here to main branch of linuxcnc 2.10 (master or devel) and it works with Xenomai 3. 

You done everything correct but apart building LinuxCNC to Xenomai the LinuxCNC at runtime checks if it has Xenomai kernel.

In order to fix the issue you must edit file: "linuxcnc/src/rtapi/uspace_common.h", around 386 line of code you find:

#ifdef USPACE_XENOMAI
static int detect_xenomai() {
    struct utsname u;
    uname(&u);
    return strcasestr (u.release, "-xenomai") != 0;
}
#else
static int detect_xenomai() {
    return 0;
}

As you see to check what kernel you got it uses very well known "uname" function. The problem is that at the moment Kernel build with Xenomai (new versions) and checked with "uname" does not include word "-xenomai" anymore but from what I know it has "IRQPIPE". That is what I got. Change what requires to be changed, recompile linuxcnc run again and... happy days.

It took me a while to figure that one out when I was compiling mine so I save you headache.
Probably that change should be commited to git 
 

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

Time to create page: 0.103 seconds
Powered by Kunena Forum