Posts: 20
Joined: Mon Aug 25, 2014 4:28 pm

Machinekit crashes in config selection

Sun Jan 21, 2018 4:17 pm

I have Raspberry B and trying to get Machinekit running, no success.

I have cross-compiled the kernel and patched it to get RT-PREEMPT properties into it.
MK is configured seemingly well (?). All the libraries that the configure command requires are in place, at least.
Compilation has gone successfully in RPi.
When MK is started it crashes after the configuration is selected in the "Configuration Selector" dialog.

With ANY configuration it crashes (simulated or any hw config).
In /machinekit/scripts/realtime, line 174 it tries to run Load() function and the crash happens.

rtapi_msgd start fails
rtapi_app start fails

Also, if I've started the MK as background process and when the config selector UI is open, and when I give from console some commands in the /machinekit/bin,
all they give "Illegal instruction" in the console...

Starting MK with debug options does not tell much more.

What is missing in my system? Does that below mentioned load error happen, because some drivers aren't loaded?

Yes, there is RPi3 B (ARMv7) available, but I'd like to understand this error.
The MK should be runnable also in ARMv6, at least nowhere mentioned the contrary.

Linux raspberrypi 4.4.49-rt62+ #8 PREEMPT RT Thu Mar 9 20:26:19 EET 2017 armv6l GNU/Linux

Starting Machinekit server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting Machinekit IO program: iov2 -support-start-change
Starting HAL User Interface program: halui
Killing task linuxcncsvr, PID=1494
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

crash after config selection:
pi@raspberrypi:/ $ machinekit
Machine configuration directory is '/machinekit/configs/sim'
Machine configuration file is 'axis-iocontrolv2-demo-ubuntu8.04.ini'
Starting Machinekit...
/machinekit/scripts/realtime: line 174: 1515 Illegal instruction ${rtapi_msgd} --instance=$MK_INSTANCE $NAME_CMD --rtmsglevel=$DEBUG --usrmsglevel=$DEBUG --halsize=$HAL_SIZE $MSGD_OPTS
rtapi_msgd startup failed - aborting
/machinekit/scripts/realtime: line 174: 1518 Illegal instruction ${rtapi_app} --instance=$MK_INSTANCE $RTAPI_APP_OPTS
rtapi_app startup failed - aborting
/machinekit/scripts/realtime: line 174: 1520 Illegal instruction halcmd ping
iov2 -support-start-change started
/machinekit/scripts/linuxcnc: line 726: 1521 Illegal instruction $HALCMD loadusr -Wn iocontrol $EMCIO -ini "$INIFILE"
halcmd loadusr iov2 -support-start-change started
/machinekit/scripts/linuxcnc: line 737: 1522 Illegal instruction $HALCMD loadusr -Wn halui $HALUI -ini "$INIFILE"
/machinekit/scripts/linuxcnc: line 753: 1527 Illegal instruction $HALCMD -i "$INIFILE" -f $CFGFILE
Shutting down and cleaning up Machinekit...
/machinekit/scripts/linuxcnc: line 530: 1551 Illegal instruction $HALCMD stop
/machinekit/scripts/linuxcnc: line 530: 1552 Illegal instruction $HALCMD unload all
Cleanup done

Posts: 66
Joined: Sun Jun 10, 2012 7:25 pm

Re: Machinekit crashes in config selection

Tue Jan 23, 2018 9:47 pm

I guess you are trying to get Machinekit running on the old RPIv1B. It does work OK but the Axis GUI is rather slow and notchy. The xenomai version runs much better than the RT version. The Mini gui interface is quicker, but can leak memory over a few hours
You don't need to compile it, there are bulit versions, but that would mean running it on Wheezy. Given that the RPI v1B is not much good for internet browsing, you may not need the security of a current OS?!
See ... Machinekit

Some background and history

The above are specifically for the PiCNC with stepgen off loaded to a Pic mcu chip.

This "Should" work on an RPIv1B on Jessie, but I have not tried it. I does work for the RPIv2B. I have 2 setups running on RPI2s ... -packages/
But you will need your own solution (other than picnc) to get your stepping out to stepper drivers.

Posts: 20
Joined: Mon Aug 25, 2014 4:28 pm

Re: Machinekit crashes in config selection

Wed Jan 24, 2018 2:40 pm

Thanks for reply.

I think the documentation of Machinekit could be better...
You said Xenomai works faster than rt-preempt. New info to me, thanks. I remember having read the contrary on some MK board?

The 'illegal instruction', when starting MK (that crashes the sw), happens because I obviously have ARMv7 version of some library in my RPi1 B (ARMv6). So the problem obviously is outside MK... When the Machinekit is started and it is starting the HAL layer, it uses some library that is not compatible with my ARMv6 RPi1.
This situation came clear these days!

RPi3 B ordered...
What have been said in some MK forum that RPi1 would work, well, no reason to hit my head against the wall any more as ARMv6 support is outdated stuff anyways!


Posts: 66
Joined: Sun Jun 10, 2012 7:25 pm

Re: Machinekit crashes in config selection

Wed Jan 24, 2018 11:32 pm

If you want an "out of the box" working solution from Machinekit then you will want to be using Jessie. If you go for Stretch, then you will be presented with a repo of thousands of RT kernel options. I have no idea which, if any, work?! Suggest you check out the Machinekit install guides before you start.
I believe the Beaglebone has the same problem with Machinekit on Stretch. Take a look at the Machinekit googlegroup for starters.
What solution (software & hardware) do you have in mind for getting the stepping signals out to the stepper drivers (or servo drivers?) I'm using the PiCNC solution, I know there are other methods out there. It would be good to know what others are using?

Return to “Automation, sensing and robotics”