prussdrv: prussdrv_open() crashes with BUS_ERROR on PocketBeagle

Hi,
I try to get a PRU working on a freshly installed Pocketbeagle;

Kernel is 4.9.88-ti-r111 #1 SMP PREEMPT Sun Apr 22 08:04:34 UTC 2018
(updated with the ./update_kernel.sh in /opt/scripts/tools/ after a
fresh git pull).

uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo is enabled in
/boot/uEnv.txt

The relevant modules seem to be loaded
$ lsmod | grep pruss
uio_pruss 4929 0
uio 11036 2 uio_pruss,uio_pdrv_genirq
pruss_intc 9092 1 pru_rproc
pruss 10889 1 pru_rproc

Now, using the https://github.com/beagleboard/am335x_pru_package
package to access the PRU.

Here the minimal test-program:

Hi,
I try to get a PRU working on a freshly installed Pocketbeagle;

Addendum: image is bone-debian-9.3-iot-armhf-2018-03-05-4gb.img

Please run:

sudo /opt/scripts/tools/version.sh

i think your overlays are out of date, for the uio, it was a recent fix..

Regards,

Hi,
I try to get a PRU working on a freshly installed Pocketbeagle;

Kernel is 4.9.88-ti-r111 #1 SMP PREEMPT Sun Apr 22 08:04:34 UTC 2018
(updated with the ./update_kernel.sh in /opt/scripts/tools/ after a
fresh git pull).

uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo is enabled in
/boot/uEnv.txt

The relevant modules seem to be loaded
$ lsmod | grep pruss
uio_pruss 4929 0
uio 11036 2 uio_pruss,uio_pdrv_genirq
pruss_intc 9092 1 pru_rproc
pruss 10889 1 pru_rproc

Please run:

sudo /opt/scripts/tools/version.sh

This is the output; probably whatever default are in the debian image:

git:/opt/scripts/:[607c2f08e25c061f61ec78d15be3fe9b9999a3b7]
eeprom:[A335PBGL00A21736GPB20653]
model:[TI_AM335x_PocketBeagle]
dogtag:[BeagleBoard.org Debian Image 2018-03-05]
bootloader:[microSD]:[/dev/mmcblk0]:[U-Boot
2018.01-00002-ge9ff418fb8]:[location: dd MBR]
kernel:[4.9.88-ti-r111]
nodejs:[v6.13.0]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20180305.0-0rcnee0~stretch+20180305]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee2~stretch+20180104]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video
plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm
eqep admin spi tisdk weston-launch xenomai]
pkg:[roboticscape]:[0.3.4-git20170602-0rcnee4~stretch+20171108]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4
rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.475447] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.483885] gpio-of-helper ocp:cape-universal: ready
END

Cheers,
  Henner.

Yeap, should be fixed in 3/22..

https://github.com/beagleboard/bb.org-overlays/commit/8d3b1c91708d0844ac39b1fa5232fcd0cff3d8bb

sudo apt update
sudo apt install --only-upgrade bb-cape-overlays
sudo reboot

Regards,

Hi,
I try to get a PRU working on a freshly installed Pocketbeagle;

Kernel is 4.9.88-ti-r111 #1 SMP PREEMPT Sun Apr 22 08:04:34 UTC 2018
(updated with the ./update_kernel.sh in /opt/scripts/tools/ after a
fresh git pull).

uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo is enabled in
/boot/uEnv.txt

The relevant modules seem to be loaded
$ lsmod | grep pruss
uio_pruss 4929 0
uio 11036 2 uio_pruss,uio_pdrv_genirq
pruss_intc 9092 1 pru_rproc
pruss 10889 1 pru_rproc

Please run:

sudo /opt/scripts/tools/version.sh

This is the output; probably whatever default are in the debian image:

git:/opt/scripts/:[607c2f08e25c061f61ec78d15be3fe9b9999a3b7]
eeprom:[A335PBGL00A21736GPB20653]
model:[TI_AM335x_PocketBeagle]
dogtag:[BeagleBoard.org Debian Image 2018-03-05]
bootloader:[microSD]:[/dev/mmcblk0]:[U-Boot
2018.01-00002-ge9ff418fb8]:[location: dd MBR]
kernel:[4.9.88-ti-r111]
nodejs:[v6.13.0]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20180305.0-0rcnee0~stretch+20180305]

Yeap, should be fixed in 3/22..

fix: AM335X-PRU-UIO-00A0.dts: add ti,hwmods = pruss · beagleboard/bb.org-overlays@8d3b1c9 · GitHub

sudo apt update
sudo apt install --only-upgrade bb-cape-overlays
sudo reboot

Thanks Robert, that fixed it!

It is always good to make sure to apt update/upgrade first; here I
tried how it would look like with the 'stock experience'

-h

Yeah, i think we figured out after 2018-03-05, no one really tests the
weekly builds. :wink:

It's only when we tag it as official, do all the bugs come out.

There was lots of little corner cases with 2018-03-05...

Regards,