BeagleBone Blue segmentation error Python motors

I have a segmentation error on my BB Blue. I can run the python test code I wrote once and then it throws out segmentation errors.

#!/usr/bin/python3

import time
import rcpy
from rcpy.motor import motor1
from rcpy.motor import motor2
from rcpy.motor import motor3
from rcpy.motor import motor4

def main():
        duty = 0.5
        run_time = 3 # Run for 3 seconds
        stop_time = 1

        print("Run motor1")
        motor1.set(duty)
        time.sleep(run_time)
        print("Stop motor1")
        motor1.set(0)
        time.sleep(stop_time)

        print("Run motor2")
        motor2.set(duty)
        time.sleep(run_time)
        print("Stop motor2")
        motor2.set(0)
        time.sleep(stop_time)

        print("Run motor3")
        motor3.set(duty)
        time.sleep(run_time)
        print("Stop motor3")
        motor3.set(0)
        time.sleep(stop_time)

        print("Run motor4")
        motor4.set(duty)
        time.sleep(run_time)
        print("Stop motor4")
        motor4.set(0)
        time.sleep(stop_time)
        print("End of test")
        rcpy.exit()

if __name__ == "__main__":
    """ This is executed when run from the command line """
    main()

This is the spec for my machine

sudo /opt/scripts/tools/version.sh
[sudo] password for debian: 
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLTBLA21717EL002837]
model:[TI_AM335x_BeagleBone_Blue]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblue.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0.bb.org-overlays]
kernel:[4.19.94-ti-r42]
nodejs:[v10.24.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-wl18xx-firmware]:[1.20230414.0-0~buster+20230414]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[    8.044789] remoteproc remoteproc0: 4a334000.pru is available
[    8.050219] remoteproc remoteproc1: 4a338000.pru is available
[   35.369676] remoteproc remoteproc2: wkup_m3 is available
[   35.376407] remoteproc remoteproc2: powering up wkup_m3
[   35.376435] remoteproc remoteproc2: Booting fw image am335x-pm-firmware.elf, size 217168
[   35.376691] remoteproc remoteproc2: remote processor wkup_m3 is now up
dmesg | grep pru
[    8.044789] remoteproc remoteproc0: 4a334000.pru is available
[    8.044972] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[    8.050219] remoteproc remoteproc1: 4a338000.pru is available
[    8.050403] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[    0.909624] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    1.114201] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux
[    1.125600] pinctrl-single 44e10800.pinmux: pin-102 (ocp:P9_30_pinmux) status -22
[    1.133188] pinctrl-single 44e10800.pinmux: could not request pin 102 (PIN102) from group pinmux_P9_30_spi_pin  on device pinctrl-single
dmesg | grep gpio-of-helper
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

Any help greatly appreciated

1 Like

Solved it by using these instructions
https://beagleboard.org/librobotcontrol/flashing.html

sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLTBLA21717EL002837]
model:[TI_AM335x_BeagleBone_Blue]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblue.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
kernel:[4.19.94-ti-r42]
nodejs:[v10.15.2]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20200403.0-0rcnee0~buster+20200403]
pkg:[bb-wl18xx-firmware]:[1.20200322.0-0rcnee0~buster+20200322]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.4-git20190227.1-0rcnee0~buster+20190327]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[    9.190198] remoteproc remoteproc0: 4a334000.pru is available
[    9.201862] remoteproc remoteproc1: 4a338000.pru is available
[   45.942184] remoteproc remoteproc2: wkup_m3 is available
[   46.066740] remoteproc remoteproc2: powering up wkup_m3
[   46.066773] remoteproc remoteproc2: Booting fw image am335x-pm-firmware.elf, size 217168
[   46.067057] remoteproc remoteproc2: remote processor wkup_m3 is now up
dmesg | grep pru
[    9.190198] remoteproc remoteproc0: 4a334000.pru is available
[    9.190383] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[    9.201862] remoteproc remoteproc1: 4a338000.pru is available
[    9.202044] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[    0.885685] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    1.090204] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux
[    1.101612] pinctrl-single 44e10800.pinmux: pin-102 (ocp:P9_30_pinmux) status -22
[    1.109202] pinctrl-single 44e10800.pinmux: could not request pin 102 (PIN102) from group pinmux_P9_30_spi_pin  on device pinctrl-single
dmesg | grep gpio-of-helper
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

Odd that it won’t work on the other distro.

1 Like