I was reading the tutorial/explanation
(http://bb-lcnc.blogspot.com/2013/07/adding-homelimit-switches.html) for BBB
hal setup and i tried to test it myself. I wrote a simple hal file to test the
gpio input and output. I used the p8.7 as input and p8.11 and p8.13 as output:
loadrt hal_bb_gpioinput_pins=103 output_pins=111,113
net gpiopulse siggen.1.clock => bb_gpio.p8.out-11 bb_gpio.p8.out-13
#net intoout bb_gpio.p8.in-3 => bb_gpio.p8.out-13
This works fine, i can see the leds blinking. There are also no errors about
the pin 103 usage - strange.
But if i change the input_pin103 to 107, i get an error:
Waiting for component 'hal_bb_gpio' to become
ready..................................................................
ledtets.hal:11: /home/linuxcnc/linuxcnc/bin/rtapi_app exited without becoming
ready
ledtets.hal:11: insmod failed, returned -1
If try to use the 103 again and "net intoout bb_gpio.p8.in-3 =>
bb_gpio.p8.out-13"
I get a different error: ledtets.hal:31: Pin 'bb_gpio.p8.in-3' does not exist
I have no idea what could be wrong. Can some please give me a hint for an
error. Any suggestion would be greatly appreciated.
I pasted my setup/config and console outputs below:
-----------------------------------------------------
$ sudo cat /sys/kernel/debug/gpio
GPIOs 0-31, gpio:
gpio-9 (sysfs ) out lo
gpio-13 (sysfs ) out lo
GPIOs 32-63, gpio:
gpio-36 (sysfs ) in hi
gpio-52 (eMMC_RSTn ) out lo
GPIOs 64-95, gpio:
GPIOs 96-127, gpio:
-----------------------------------------------------
$ sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups
registered pin groups:
group: pinmux_userled_pins
pin 21 (44e10854)
pin 22 (44e10858)
pin 23 (44e1085c)
pin 24 (44e10860)
group: pinmux_rstctl_pins
pin 20 (44e10850)
group: pinmux_i2c0_pins
pin 98 (44e10988)
pin 99 (44e1098c)
group: pinmux_i2c2_pins
pin 94 (44e10978)
pin 95 (44e1097c)
group: ledtest_pins
pin 36 (44e10890)
pin 13 (44e10834)
pin 9 (44e10824)
------------------BB-HAL-LEDTEST-00A0.dts-----------------------------------
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
/* identification */
part-number = "BB-LCNC-BEBOPR";
version = "00A0";
/* state the resources this cape uses */
exclusive-use =
/* the pin header uses */
"p8.7", /* gpio */
"p8.11", /* gpio */
"p8.13"; /* gpio */
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
ledtest_pins: ledtest_pins {
pinctrl-single,pins = <
0x90 0x3f /* p8.7 input,
pull-up, mode 7 */
0x34 0x0f /* p8.11 output, mode 7
*/
0x24 0x0f /* p8.13 output, mode 7
*/
>;
};
};
};
fragment@1 {
target = <&pruss>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&ledtest_pins>;
};
};
------------------setup.sh-----------------------------------
for DTBO in BB-HAL-LEDTEST ; 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
# This really only needs to be done to enable the low-level clocks for the GPIO
# modules. There is probably a better way to do this...
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
36 in # gpio
13 out # gpio
9 out # gpio
EOF
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users