Here at Pocket NC we locked on an old version of machinekit running the 3.8 
kernel when we launched our machine a couple years ago. It runs on the 
Beaglebone Black. I only recently came onboard and have been trying to get 
up to speed with the configuration while wrangling different pieces of 
software together to get a web interface going on the machine. It all works 
on the old version of machinekit. I am working on upgrading to a newer 
version of machinekit and am running into problems. 

When I try the latest 3.8 image built for the BBB I run into problems with 
the Xenomai kernel: https://github.com/machinekit/machinekit/issues/1332

Ideally, we could make the jump to the latest 4.14 kernel image, but I'm 
unsure what changes need to be made. Kernel 4.14 uses U-boot for loading 
overlays, so I've added our device tree overlay to /boot/uEnv.txt to load 
it at boot. In the old setup, there is a setup.bridge.sh file that loads 
the overlays and does some checks for analog pins and pru control files. 
I've commented all of that out, but I'm not sure what should replace them 
or if I even need to (I've attached the current state of the file). Right 
now when I try to start machinekit I get "rtapi_app_main(hal_pru_generic): 
-1 Operation not permitted". I'm not sure where to go from here. I've 
attached the files that I think are pertinent (which are the only changes 
that I've made to the whole configuration, which is here: 
https://github.com/PocketNC/pocketnc). Any help you can offer is 
appreciated!

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.
Dec 14 17:57:49 pocketnc msgd:0: startup pid=3683 flavor=rt-preempt rtlevel=1 
usrlevel=1 halsize=524288 shm=Posix cc=gcc 4.9.2  version=v0.1~-detached~50f3952
Dec 14 17:57:49 pocketnc msgd:0: ØMQ=4.0.5 czmq=4.0.2 protobuf=2.6.1 
atomics=gcc intrinsics    libwebsockets=<no version symbol>
Dec 14 17:57:49 pocketnc msgd:0: configured: sha=50f3952
Dec 14 17:57:50 pocketnc msgd:0: built:      Dec 11 2017 13:51:54 sha=50f3952
Dec 14 17:57:50 pocketnc msgd:0: register_stuff: actual hostname as announced 
by avahi='pocketnc.local'
Dec 14 17:57:50 pocketnc msgd:0: zeroconf: registering: 'Log service on 
pocketnc.local pid 3683'
Dec 14 17:57:51 pocketnc msgd:0: zeroconf: registered 'Log service on 
pocketnc.local pid 3683' _machinekit._tcp 0 TXT 
"uuid=a42c8c6b-4025-4f83-ba28-dad21114744a" 
"instance=4c8bc8b0-e0f8-11e7-aca6-88c2558db852" "service=log" 
"dsn=ipc:///tmp/0.log.a42c8c6b-4025-4f83-ba28-dad21114744a"
Dec 14 17:57:53 pocketnc rtapi:0: rtapi_app_main(hal_pru_generic): -1 Operation 
not permitted
Dec 14 17:58:02 pocketnc rtapi:0: unload: 'trivkins' not loaded
Dec 14 17:58:02 pocketnc rtapi:0: unload: 'tp' not loaded
Dec 14 17:58:02 pocketnc rtapi:0: unload: 'motmod' not loaded
Dec 14 17:58:02 pocketnc rtapi:0: unload: 'hal_bb_gpio' not loaded
Dec 14 17:58:02 pocketnc msgd:0: rtapi_app exit detected - scheduled shutdown
Dec 14 17:58:04 pocketnc msgd:0: msgd shutting down
Dec 14 17:58:04 pocketnc msgd:0: zeroconf: unregistering 'Log service on 
pocketnc.local pid 3683'
Dec 14 17:58:04 pocketnc msgd:0: log buffer hwm: 0% (0 msgs, 0 bytes out of 
524288)
Dec 14 17:58:04 pocketnc msgd:0: normal shutdown - global segment detached

Attachment: PocketNC.hal
Description: Binary data

Attachment: PocketNC.ini
Description: Binary data

#!/bin/bash

dtbo_err () {
	echo "Error loading device tree overlay file: $DTBO" >&2
	exit 1
}

pin_err () {
	echo "Error exporting pin:$PIN" >&2
	exit 1
}

dir_err () {
	echo "Error setting direction:$DIR on pin:$PIN" >&2
	exit 1
}

#SLOTS=/sys/devices/bone_capemgr.*/slots

# Make sure required device tree overlay(s) are loaded
#for DTBO in PocketNCdriver cape-bone-iio ; do
#
#	if grep -q $DTBO $SLOTS ; then
#		echo $DTBO overlay found
#	else
#		echo Loading $DTBO overlay
#		sudo -A su -c "echo $DTBO > $SLOTS" || dtbo_err
#		sleep 1
#	fi
#done;

#if [ ! -r /sys/devices/ocp.*/helper.*/AIN0 ] ; then
#	echo Analog input files not found in /sys/devices/ocp.*/helper.* >&2
#	exit 1;
#fi

#if [ ! -r /sys/class/uio/uio0 ] ; then
#	echo PRU control files not found in /sys/class/uio/uio0 >&2
#	exit 1;
#fi

# Export GPIO pins:
# One pin needs to be exported to enable the low-level clocks for the GPIO
# modules (there is probably a better way to do this)
# 
# Any GPIO pins driven by the PRU need to have their direction set properly
# here.  The PRU does not do any setup of the GPIO, it just yanks on the
# pins and assumes you have the output enables configured already
# 
# Direct PRU inputs and outputs do not need to be configured here, the pin
# mux setup (which is handled by the device tree overlay) should be all
# the setup needed.
# 
# Any GPIO pins driven by the hal_bb_gpio driver do not need to be
# configured here.  The hal_bb_gpio module handles setting the output
# enable bits properly.  These pins _can_ however be set here without
# causing problems.  You may wish to do this for documentation or to make
# sure the pin starts with a known value as soon as possible.

while read PIN DIR JUNK ; do
        case "$PIN" in
        ""|\#*)	
		continue ;;
        *)
		[ -r /sys/class/gpio/gpio$PIN ] && continue
                sudo -A su -c "echo $PIN > /sys/class/gpio/export" || pin_err
		sudo -A su -c "echo $DIR > /sys/class/gpio/gpio$PIN/direction" || dir_err
                ;;
        esac

done <<- EOF
	66	out	# P8.7		gpio2.2		Enable_n (ECO location)
#	67	out	# P8.8		gpio2.3		X_Min
#	69	out	# P8.9		gpio2.5		X_Max
#	68	out	# P8.10		gpio2.4		Y_Min
	45	out	# P8.11		gpio1.13	X_Dir
	44	out	# P8.12		gpio1.12	X_Step
	23	out	# P8.13		gpio0.23	PWM0
#	26	out	# P8.14		gpio0.26	Y_Max
	47	out	# P8.15		gpio1.15	Y_Dir
	46	out	# P8.16		gpio1.14	Y_Step
#	27	out	# P8.17		gpio0.27	Z_Min
#	65	out	# P8.18		gpio2.1		Z_Max
	22	out	# P8.19		gpio0.22	PWM1
#	61	out	# p8.26		gpio1.29	Status
	50	out	# p9.14		gpio1.18	PWM2
	48	out	# p9.15		gpio1.16	Z_Step
#	5	out	# p9.17		gpio0.5		B_Dir
#	4	out	# p9.18		gpio0.4		B_Step
#	3	out	# p9.21		gpio0.3		A_Dir
#	2	out	# p9.22		gpio0.2		A_Step
	112	out	# p9.30		gpio3.16		B_Dir
	111	out	# p9.29		gpio3.15		B_Step
	113	out	# p9.21		gpio0.3		A_Dir
	115	out	# p9.22		gpio0.2		A_Step
	49	out	# P9.23		gpio1.17	Z_Dir
#	15	out	# P9.24		gpio0.15	Spindle
#	14	out	# P9.26		gpio0.14	Mtr_Ena
EOF

Reply via email to