How to use PRU with Debian 9.2 and kernel 4.9.54-ti-r68 ?

Hello,

I need to use the PRU unit on my Beaglebone Black Wireless with Debian 9.2 and kernel 4.9.54-ti-r68, and I have a few doubts about how to use it.

Looking for 'pru’ named files on my file-system I have

/run/udev/data/+drivers:platform:pruss-soc-bus
/run/udev/data/+module:pruss_soc_bus
/run/udev/data/+platform:4a326000.pruss-soc-bus
/run/udev/data/+mbox:mbox_pru1
/run/udev/data/+mbox:mbox_pru0
/lib/firmware/uio_pruss_enable-00A0.dtbo
/lib/modules/4.9.54-ti-r68/kernel/drivers/remoteproc/pru_rproc.ko
/lib/modules/4.9.54-ti-r68/kernel/drivers/remoteproc/pruss.ko
/lib/modules/4.9.54-ti-r68/kernel/drivers/remoteproc/pruss_intc.ko
/lib/modules/4.9.54-ti-r68/kernel/drivers/remoteproc/pruss_soc_bus.ko
/lib/modules/4.9.54-ti-r68/kernel/drivers/rpmsg/rpmsg_pru.ko
/var/lib/dpkg/info/libaprutil1-dbd-sqlite3:armhf.md5sums
/var/lib/dpkg/info/libaprutil1:armhf.shlibs
/var/lib/dpkg/info/libaprutil1:armhf.md5sums
/var/lib/dpkg/info/libaprutil1:armhf.list
/var/lib/dpkg/info/libaprutil1-ldap:armhf.list
/var/lib/dpkg/info/libaprutil1:armhf.symbols
/var/lib/dpkg/info/libaprutil1:armhf.triggers
/var/lib/dpkg/info/libaprutil1-ldap:armhf.md5sums
/var/lib/dpkg/info/libaprutil1-dbd-sqlite3:armhf.list
/usr/lib/git-core/git-prune
/usr/lib/git-core/git-prune-packed
/usr/lib/arm-linux-gnueabihf/libaprutil-1.so.0.5.4
/usr/lib/arm-linux-gnueabihf/libaprutil-1.so.0
/usr/share/pastebin.d/sprunge.us.conf
/usr/share/man/man1/git-prune-packed.1.gz
/usr/share/man/man1/git-prune.1.gz
/usr/share/doc/libaprutil1-ldap
/usr/share/doc/libaprutil1
/usr/share/doc/libaprutil1-dbd-sqlite3
/usr/share/initramfs-tools/hooks/ti_pru_firmware
/usr/share/lintian/overrides/libaprutil1
/opt/scripts/device/x15/pru-rpmsg_client_sample
/opt/scripts/device/x15/pru-rpmsg_client_sample/am57xx-pru2_1-fw
/opt/scripts/device/x15/pru-rpmsg_client_sample/am57xx-pru2_0-fw
/opt/scripts/device/x15/pru-rpmsg_client_sample/am57xx-pru1_1-fw
/opt/scripts/device/x15/pru-rpmsg_client_sample/am57xx-pru1_0-fw
/opt/scripts/device/bone/capes/BB-BEAGLELOGIC/beaglelogic-pru0
/opt/scripts/device/bone/capes/BB-BEAGLELOGIC/beaglelogic-pru1
/opt/scripts/device/bone/pru-rpmsg_client_sample
/opt/scripts/device/bone/pru-rpmsg_client_sample/am335x-pru0-fw
/opt/scripts/device/bone/pru-rpmsg_client_sample/am335x-pru1-fw
/opt/source/dtb-4.4-ti/src/arm/am33xx-pruss-rproc.dtsi
/opt/source/dtb-4.4-ti/src/arm/am33xx-pruss-uio.dtsi
/opt/source/bb.org-overlays/src/arm/uio_pruss_enable-00A0.dts
/sys/kernel/debug/clk/pruss_ocp_gclk
/sys/devices/platform/ocp/4a300000.pruss
/sys/devices/platform/ocp/4a326000.pruss-soc-bus
/sys/devices/platform/ocp/480c8000.mailbox/mbox/mbox_pru1
/sys/devices/platform/ocp/480c8000.mailbox/mbox/mbox_pru0
/sys/class/mbox/mbox_pru1
/sys/class/mbox/mbox_pru0
/sys/firmware/devicetree/base/symbols/mbox_pru1
/sys/firmware/devicetree/base/symbols/pru1
/sys/firmware/devicetree/base/symbols/pruss
/sys/firmware/devicetree/base/symbols/pruss_soc_bus
/sys/firmware/devicetree/base/symbols/mbox_pru0
/sys/firmware/devicetree/base/symbols/pru0
/sys/firmware/devicetree/base/symbols/pruss_ocp_gclk
/sys/firmware/devicetree/base/symbols/pruss_mdio
/sys/firmware/devicetree/base/symbols/pruss_intc
/sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000
/sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000
/sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a338000
/sys/firmware/devicetree/base/ocp/pruss_soc_bus@4a326000/pruss@4a300000/pru@4a334000
/sys/firmware/devicetree/base/ocp/pruss@4a300000
/sys/firmware/devicetree/base/ocp/mailbox@480C8000/mbox_pru1
/sys/firmware/devicetree/base/ocp/mailbox@480C8000/mbox_pru0
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_42_pru_ecap_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_91_pruout_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_27_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_41_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_91_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_15_pru_ecap_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_11_pruout_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_92_pruout_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_16_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_17_pru_uart_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_21_pru_uart_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_26_pru_uart_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_12_pruout_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_18_pru_uart_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_92_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_22_pru_uart_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_30_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_30_pruout_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_26_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_27_pruout_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P8_15_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_24_pruin_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_P9_24_pru_uart_pin
/sys/firmware/devicetree/base/ocp/l4_wkup@44c00000/prcm@200000/clocks/pruss_ocp_gclk@530
/sys/bus/platform/devices/4a300000.pruss
/sys/bus/platform/devices/4a326000.pruss-soc-bus
/sys/bus/platform/drivers/pruss-soc-bus
/sys/bus/platform/drivers/pruss-soc-bus/4a326000.pruss-soc-bus
/sys/module/pruss_soc_bus
/sys/module/pruss_soc_bus/drivers/platform:pruss-soc-bus

I understand I can communicate with it, but looking at libprussdrv examples, I see it looks for

/dev/uio

to communicate with the PRU. However, as I can see from my file-syste, this file it’s not created with the default configuration.
Looking for 'uio’ named files on my file-system, I have

/run/udev/data/+module:uio_pdrv_genirq
/run/udev/data/+drivers:platform:uio_pdrv_genirq
/run/udev/data/+class:uio
/run/udev/data/+module:uio
/lib/firmware/uio_pruss_enable-00A0.dtbo
/lib/modules/4.9.54-ti-r68/kernel/drivers/uio
/lib/modules/4.9.54-ti-r68/kernel/drivers/uio/uio_pdrv_genirq.ko
/lib/modules/4.9.54-ti-r68/kernel/drivers/uio/uio.ko
/lib/modules/4.9.54-ti-r68/kernel/drivers/uio/uio_dmem_genirq.ko
/etc/udev/rules.d/uio.rules
/usr/lib/arm-linux-gnueabihf/libicuio.so.57.1
/usr/lib/arm-linux-gnueabihf/libicuio.so.57
/usr/lib/arm-linux-gnueabihf/perl/5.24.1/bits/uio.ph
/usr/lib/arm-linux-gnueabihf/perl/5.24.1/sys/uio.ph
/usr/include/linux/uio.h
/usr/include/arm-linux-gnueabihf/bits/uio.h
/usr/include/arm-linux-gnueabihf/sys/uio.h
/opt/source/dtb-4.4-ti/src/arm/am33xx-pruss-uio.dtsi
/opt/source/bb.org-overlays/src/arm/uio_pruss_enable-00A0.dts
/sys/class/uio
/sys/bus/platform/drivers/uio_pdrv_genirq
/sys/module/uio
/sys/module/uio/holders/uio_pdrv_genirq
/sys/module/uio_pdrv_genirq
/sys/module/uio_pdrv_genirq/drivers/platform:uio_pdrv_genirq

The uio driver is automatically loaded at boot.
What do I have to do to have the /dev/uio enabled for PRU communication ?

Thank you in advance.
Simon

Hi, I’m in the same situation as you now. Were you able to find a solution as it’s confusing me greatly,

Thanks

Andrew

Hi guys,

I struggled with PRUs a few months ago, and I wrote this note about how to use it on 4.9.45-ti-r57 but it is with rpmsg.

https://github.com/PierrickRauby/PRU-RPMsg-Setup-BeagleBoneBlack

Hope it helps!

Pierrick