BeagleBone Black setup.sh

More
27 Nov 2022 23:25 #257795 by ALANMTHOMASON
Hi There...

I am working on a new installation of linuxcnc on a BeagleBoneBlack.  With help from others, I can start linuxcnc, select the configuration, but it stalls at this point...

Waiting for /sys/class/uio/uio0 ...........................................................................................................................................

I installed linuxcnc like this:
sudo apt install linuxcnc-uspace

I have this kernel:
5.15.73-bone-rt-r31

I do have a /sys/class/uio directory, but it is empty.

So much has changed in the way that linuxcnc works (I was starting from a version that only showed 0.1) that I am suspicious that this setup.sh no longer applies.  I've tried naively not calling this setup.sh from the old hal file, but other problems appear.  Before I disappear down the rabbit hole, I'm hoping someone can point me to where I would find an example directory containing a working ini, hal and setup.sh (if this is still used).

Thanks so much! 
Alan

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

More
27 Nov 2022 23:31 #257797 by ALANMTHOMASON
I've been having trouble adding attachments in this forum...here is the contents of the setup.sh that I had in the old installation....

#!/bin/bash
# Copyright 2014
# Charles Steinkuehler <This email address is being protected from spambots. You need JavaScript enabled to view it.>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

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
}

PRU=/sys/class/uio/uio0
echo -n "Waiting for $PRU "

while [ ! -r $PRU ]
do
echo -n "."
sleep 1
done
echo OK

if [ ! -r $PRU ] ; then
echo PRU control files not found in $PRU >&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.

sudo $(which config-pin) -f - <<- EOF

P8.07 out # gpio2.2 Enable System
#P9.18 in # gpio2.4 XLIM
P8.11 out # gpio1.13 X_Dir
P8.12 out # gpio1.12 X_Step
P8.13 out # gpio0.23 PWM0/SPINDLE
#P9.20 in # gpio0.26 YLIM
P8.15 out # gpio1.15 Y_Dir
P8.16 out # gpio1.14 Y_Step
#P9.21 in # gpio2.1 ZLIM
P8.19 out # gpio0.22 PWM1
P9.14 out # gpio1.18 PWM2
P9.15 out # gpio1.16 Z_Step
P9.23 out # gpio1.17 Z_Dir
# P9.17 out # gpio0.5 SCS
# P9.18 in # gpio0.4 SDI
# P9.21 out # gpio0.3 SDO
# P9.22 out # gpio0.2 SCK
P9.13 out # gpio0.30 A_Dir
P9.11 out # gpio0.31 A_Step
P8.09 in # gpio2.5 STOPin
EOF

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

More
29 Nov 2022 01:54 #257933 by silver2row
uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo

For the PRU from uio, add that line in /boot/uEnv.txt and then reboot.

I know it may work or may make a system to fail to boot. I have not tested this personally w/ the RT system and UIO.

Seth

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

More
30 Nov 2022 13:27 #258117 by andypugh
Replied by andypugh on topic BeagleBone Black setup.sh
This looks like a machinekit-specific script to enable / control the PRU.

I don't know if there is support for the PRU in mainline LinuxCNC. Hopefully someone else does know.

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

More
02 Dec 2022 02:49 #258288 by ALANMTHOMASON
Thanks for the help....I'm hoping that someone is using a BBB with these later versions of LinuxCNC that would be willing to share their config files. The setup.sh file that I have for instance might even be outdated for my very old version of LInuxCNC!

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

Time to create page: 0.094 seconds
Powered by Kunena Forum