beagleboard / am335x_pru_package

332 stars 181 forks source link

Beaglebone blue: kernel 4-19 can't load/find PRU drivers #69

Closed AJRepo closed 4 years ago

AJRepo commented 4 years ago

I can't seem to get the PRU modules loaded in a Beaglebone blue running recommended image "AM3358 Debian 10.3 2020-04-06 4GB SD IoT" from https://beagleboard.org/latest-images

I've followed instructions at https://poushtickcoder.wordpress.com/2018/03/12/quadcopter-fc-dobby-beaglebone-blue-pru-tutorial-by-a-dummy-configuration/ and https://catch22eu.github.io/website/beaglebone/beaglebone-pru-uio/ and have tried various combinations of


In /var/log/syslog I get the errors

beaglebone systemd-modules-load[491]: Failed to find module 'pru_rproc' beaglebone systemd-modules-load[491]: Failed to find module 'pruss_soc_bus'


rc_test_drivers gives

Kernel: 4.19.135-bone-rt-r55 BeagleBoard.org Debian Buster IoT Image 2020-04-06 Debian: 10.5

PASSED: gpio 0 PASSED: gpio 1 PASSED: gpio 2 PASSED: gpio 3 PASSED: pwm0 PASSED: pwm1 PASSED: pwm2 PASSED: eqep0 PASSED: eqep1 PASSED: eqep2 ERROR: pru-rproc driver not loaded PASSED: uart1 PASSED: uart2 PASSED: uart4 PASSED: uart5 PASSED: i2c1 PASSED: i2c2 PASSED: spi PASSED: LED ERROR: ADC iio driver not loaded

Currently running on a: MODEL_BB_BLUE Robot Control library Version: 1.0.5


sudo /opt/scripts/tools/version.sh 

gives

git:/opt/scripts/:[20c080bc91f243ef852a704758788a31083b0f9e] eeprom:[A335BNLTBLA21717EL001263] model:[TI_AM335x_BeagleBone_Blue] dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06] bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gc9b3922522]:[location: dd MBR] bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.09-00002-g0b54a51eee]:[location: dd MBR] UBOOT: Booted Device-Tree:[am335x-boneblue.dts] kernel:[4.19.135-bone-rt-r55] nodejs:[v10.21.0] device-tree-override:[dtb=am335x-boneblue.dtb] /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] uboot_overlay_options:[dtb_overlay=/lib/firmware/BB-I2C1-00A0.dtbo] pkg check: to individually upgrade run: [sudo apt install --only-upgrade ] pkg:[bb-cape-overlays]:[4.14.20200814.0-0~buster+20200814] pkg:[bb-customizations]:[1.20200826.0-0~buster+20200826] pkg:[bb-usb-gadgets]:[1.20200504.0-0~buster+20200504] pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813] 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 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet] dmesg | grep remote [ 1.038243] remoteproc remoteproc0: wkup_m3 is available [ 1.169429] remoteproc remoteproc0: powering up wkup_m3 [ 1.169447] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168 [ 1.171550] remoteproc remoteproc0: remote processor wkup_m3 is now up dmesg | grep pru dmesg | grep pinctrl-single [ 0.748065] pinctrl-single 44e10800.pinmux: 142 pins, size 568 [ 0.949847] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux [ 0.961134] pinctrl-single 44e10800.pinmux: pin-102 (ocp:P9_30_pinmux) status -22 [ 0.971344] 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



I'm not sure what else to test to try to get this working. 
RobertCNelson commented 4 years ago
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gc9b3922522]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.09-00002-g0b54a51eee]:[location: dd MBR]

u-boot on the eMMC is blocking it, nuke it..

Regards,

AJRepo commented 4 years ago

Thanks! I'm not sure what "nuke it" means but I replaced it by flashing with the current eMMC. ( https://debian.beagleboard.org/images/bone-eMMC-flasher-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz )

Still not able to load PRU drivers .

version.sh does show the same bootloader now on both the SD card and eMMC.

sudo /opt/scripts/tools/version.sh 
[sudo] password for debian: 
git:/opt/scripts/:[20c080bc91f243ef852a704758788a31083b0f9e]
eeprom:[A335BNLTBLA21717EL001263]
model:[TI_AM335x_BeagleBone_Blue]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gc9b3922522]:[location: dd MBR]
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]
UBOOT: Loaded Overlay:[BB-I2C1-00A0]
kernel:[4.19.135-bone-rt-r55]
nodejs:[v10.21.0]
device-tree-override:[dtb=am335x-boneblue.dtb]
/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]
uboot_overlay_options:[dtb_overlay=/lib/firmware/BB-I2C1-00A0.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20200814.0-0~buster+20200814]
pkg:[bb-customizations]:[1.20200826.0-0~buster+20200826]
pkg:[bb-usb-gadgets]:[1.20200504.0-0~buster+20200504]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813]
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/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[    1.040802] remoteproc remoteproc0: wkup_m3 is available
[    1.173769] remoteproc remoteproc0: powering up wkup_m3
[    1.173789] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[    1.175887] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[    0.747166] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    0.951809] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux
[    0.965776] pinctrl-single 44e10800.pinmux: pin-102 (ocp:P9_30_pinmux) status -22
[    0.973300] 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

I'm trying re-doing the things I did in the first comment, but so far, no luck.

RobertCNelson commented 4 years ago

These two are not compatible:

UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
kernel:[4.19.135-bone-rt-r55]

Run this and reboot:

sudo /opt/scripts/tools/update_kernel.sh --ti-rt-channel --lts-4_19
AJRepo commented 4 years ago

Yes! That worked! Fixed the ADC driver too and I didn't need to blacklist any drivers ( e.g. /etc/modprobe.d/pruss-blacklist.conf ) either.

debian@beaglebone:~$ rc_test_drivers 

Kernel: 4.19.94-ti-rt-r51
BeagleBoard.org Debian Buster IoT Image 2020-04-06
Debian: 10.5

PASSED: gpio 0
PASSED: gpio 1
PASSED: gpio 2
PASSED: gpio 3
PASSED: pwm0
PASSED: pwm1
PASSED: pwm2
PASSED: eqep0
PASSED: eqep1
PASSED: eqep2
PASSED: pru-rproc
PASSED: uart1
PASSED: uart2
PASSED: uart4
PASSED: uart5
PASSED: i2c1
PASSED: i2c2
PASSED: spi
PASSED: LED
PASSED: ADC iio

Currently running on a:
MODEL_BB_BLUE
Robot Control library Version:
1.0.5

Thank you!!!!

unl0ck commented 2 years ago

I have Still the issue that encoder 4 PRU just show 0/1 `debian@motorcontroller:~$ less /boot/uEnv.txt

U-Boot Overlays

Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays

Master Enable

enable_uboot_overlays=1

Overide capes with eeprom

uboot_overlay_addr0=/lib/firmware/.dtbo

uboot_overlay_addr1=/lib/firmware/.dtbo

uboot_overlay_addr2=/lib/firmware/.dtbo

uboot_overlay_addr3=/lib/firmware/.dtbo

Additional custom capes

uboot_overlay_addr4=/lib/firmware/.dtbo

uboot_overlay_addr5=/lib/firmware/.dtbo

uboot_overlay_addr6=/lib/firmware/.dtbo

uboot_overlay_addr7=/lib/firmware/.dtbo

Custom Cape

dtb_overlay=/lib/firmware/BB-I2C1-00A0.dtbo dtb_overlay=/lib/firmware/BB-UART4-00A0.dtbo dtb_overlay=/lib/firmware/BB-ADC-00A0.dtbo

Disable auto loading of virtual capes (emmc/video/wireless/adc)

disable_uboot_overlay_emmc=1

disable_uboot_overlay_video=1

disable_uboot_overlay_audio=1

disable_uboot_overlay_wireless=1

disable_uboot_overlay_adc=1

PRUSS OPTIONS

pru_rproc (4.14.x-ti kernel)

uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo

pru_rproc (4.19.x-ti kernel)

uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo

pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)

uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo

Cape Universal Enable

enable_uboot_cape_universal=1

Debug: disable uboot autoload of Cape

disable_uboot_overlay_addr0=1

disable_uboot_overlay_addr1=1

disable_uboot_overlay_addr2=1

disable_uboot_overlay_addr3=1

U-Boot fdt tweaks... (60000 = 384KB)

uboot_fdt_buffer=0x60000

U-Boot Overlays

cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

In the event of edid real failures, uncomment this next line:

cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e

enable Generic eMMC Flasher:

cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

`

I updated Bootloader kernel don't know what can I do nothing will work rc_driver_test show all passed `debian@motorcontroller:~$ rc_test_drivers

Kernel: 4.19.94-ti-r70 BeagleBoard.org Debian Buster IoT Image 2020-04-06 Debian: 10.11

PASSED: gpio 0 PASSED: gpio 1 PASSED: gpio 2 PASSED: gpio 3 PASSED: pwm0 PASSED: pwm1 PASSED: pwm2 PASSED: eqep0 PASSED: eqep1 PASSED: eqep2 PASSED: pru-rproc PASSED: uart1 PASSED: uart2 PASSED: uart4 PASSED: uart5 PASSED: i2c1 PASSED: i2c2 PASSED: spi PASSED: LED PASSED: ADC iio

Currently running on a: MODEL_BB_BLUE Robot Control library Version: 1.0.5`

RobertCNelson commented 2 years ago

Custom Cape

dtb_overlay=/lib/firmware/BB-I2C1-00A0.dtbo dtb_overlay=/lib/firmware/BB-UART4-00A0.dtbo dtb_overlay=/lib/firmware/BB-ADC-00A0.dtbo

This is a single variable name, by doing this ^, it'll only load BB-ADC-00A0.dtbo, as it's the last one..

Please add the output of:

sudo /opt/scripts/tools/version.sh

Regards,

unl0ck commented 2 years ago

Yeah but that is not the reason why the encoder show only 0/1 right?

here is the version output

` debian@motorcontroller:~$ sudo /opt/scripts/tools/version.sh git:/opt/scripts/:[a335abcf87d2ef5fd96e7de83cdf3f0ff5a4da2b]

eeprom:[A335BNLTBLA21712EL002155] model:[TI_AM335x_BeagleBone_Blue] dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06] bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-00002-gc9b3922522 (Aug 24 2020 - 16:42:18 -0500)]:[location: dd MBR] bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-gc9b3922522]:[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] UBOOT: Loaded Overlay:[BB-ADC-00A0.kernel] kernel:[4.19.94-ti-r70] nodejs:[v10.24.0] device-tree-override:[dtb=am335x-boneblue.dtb] /boot/uEnv.txt Settings: uboot_overlay_options:[enable_uboot_overlays=1] uboot_overlay_options:[disable_uboot_overlay_video=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] uboot_overlay_options:[dtb_overlay=/lib/firmware/BB-I2C1-00A0.dtbo] uboot_overlay_options:[dtb_overlay=/lib/firmware/BB-UART4-00A0.dtbo] uboot_overlay_options:[dtb_overlay=/lib/firmware/BB-ADC-00A0.dtbo] pkg check: to individually upgrade run: [sudo apt install --only-upgrade ] pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821] pkg:[bb-customizations]:[1.20220119.0-0~buster+20220125] pkg:[bb-usb-gadgets]:[1.20220112.3-0~buster+20220112] pkg:[bb-wl18xx-firmware]:[1.20211222.2-0~buster+20211222] 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 beaglelogic] 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.162009] remoteproc remoteproc0: 4a334000.pru is available [ 8.163837] remoteproc remoteproc1: 4a338000.pru is available [ 40.144503] remoteproc remoteproc2: wkup_m3 is available [ 40.156274] remoteproc remoteproc2: powering up wkup_m3 [ 40.156308] remoteproc remoteproc2: Booting fw image am335x-pm-firmware.elf, size 217148 [ 40.156606] remoteproc remoteproc2: remote processor wkup_m3 is now up [ 127.050982] remoteproc remoteproc0: powering up 4a334000.pru [ 127.056661] remoteproc remoteproc0: Booting fw image am335x-pru0-rc-encoder-fw, size 36040 [ 127.056703] remoteproc remoteproc0: remote processor 4a334000.pru is now up [ 132.182958] remoteproc remoteproc0: stopped remote processor 4a334000.pru dmesg | grep pru [ 8.162009] remoteproc remoteproc0: 4a334000.pru is available [ 8.162195] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully [ 8.163837] remoteproc remoteproc1: 4a338000.pru is available [ 8.168340] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully [ 127.050982] remoteproc remoteproc0: powering up 4a334000.pru [ 127.056661] remoteproc remoteproc0: Booting fw image am335x-pru0-rc-encoder-fw, size 36040 [ 127.056703] remoteproc remoteproc0: remote processor 4a334000.pru is now up [ 132.182958] remoteproc remoteproc0: stopped remote processor 4a334000.pru dmesg | grep pinctrl-single [ 0.914228] pinctrl-single 44e10800.pinmux: 142 pins, size 568 [ 1.122873] pinctrl-single 44e10800.pinmux: pin PIN102 already requested by 48300180.eqep; cannot claim for ocp:P9_30_pinmux [ 1.134316] pinctrl-single 44e10800.pinmux: pin-102 (ocp:P9_30_pinmux) status -22 [ 1.141913] 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 `

unl0ck commented 2 years ago

Custom Cape

dtb_overlay=/lib/firmware/BB-I2C1-00A0.dtbo dtb_overlay=/lib/firmware/BB-UART4-00A0.dtbo dtb_overlay=/lib/firmware/BB-ADC-00A0.dtbo

This is a single variable name, by doing this ^, it'll only load BB-ADC-00A0.dtbo, as it's the last one..

Please add the output of:

sudo /opt/scripts/tools/version.sh

Regards,

I added the version.sh