PRU Problems with Debian Stretch - Segmentation Fault


In the past I had some PRU code running on Beaglebone Black with Debian Jessie. Recently upgraded to Debian Stretch (ver 9.4) and existing PRU code now generates a segmentation fault.

I’ve updated uBoot to use the old dbto file (that worked in Jessie) and uBoot seems OK. (I’ve included the output of

root@engraver:~# /opt/scripts/tools/
dogtag:[ Debian Image 2018-01-28]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.01-00002-g9aa111a004]
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]
dmesg | grep pinctrl-single
[ 1.385819] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568

I’ve also tried building the example PRU files in /am335x_pru_package/pru_sw/example_apps/PRU_memAccess_DDR_PRUsharedRAM and still get a segmentation fault.


@texasEE, your u-boot overlay doesn’t match the kernel version:


Use instead (in /boot/uEnv.txt):


Also it’s wise to update u-boot, kernel, and bb-cape-overlays

debian@test-bbb-2:~$ cd /opt/scripts/tools/
debian@test-bbb-2:/opt/scripts/tools$ git pull
Already up-to-date.
debian@test-bbb-2:/opt/scripts/tools$ sudo ./ 
debian@test-bbb-2:/opt/scripts/tools$ sudo ./developers/ 
debian@test-bbb-2:/opt/scripts/tools$ sudo apt install --only-upgrade bb-cape-overlays



Updated u-boot, kernel and bb-cape-overlays. Still have segmentation error.

What is difference between the two PRUSS Options in /boot/uEnv? WHen do you use one vs the other and also there are now several AM335X-PRU-RPROC-* files in /lib/firmware. Any information on which one should be used and when?



Bummer, at least the kernel and overlay match now.

So over the lifetime of the Beagle there’s been currently 4 major methods to communicate with the pru:

UIO: (almost every kernel): AM335X-PRU-UIO-00A0.dtbo
ti-remoteproc: 4.4.x kernel: AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
ti-remoteproc: 4.9.x kernel: AM335X-PRU-RPROC-4-9-TI-00A0.dtbo
ti-remoteproc: 4.14.x kernel: AM335X-PRU-RPROC-4-14-TI-00A0.dtbo

uio came first, initially supported in 3.8.x based kernels, we’ve been patching the driver since all the way up to v4.18.x (v4.19.x brought in major changes to the uio driver, so i need to fix that)… Almost all examples use this driver (machinekit,etc)…

TI decided the uio driver was not “proper” for the am335x pru’s so they’ve been developing their own driver, each incompatible with each other:

4.4.x-ti remoteproc: biggest user was libroboticape (BeagleBone Blue) up to v0.3.4
4.9.x-ti remoteproc: biggest user was BeagleLogic
4.14.x-ti remoteproc: libroboticape from 0.4.0 -> 1.0.x

also for 4.14.x-ti remoteproc, there’s a new book in development:



Problem Resolved by including the following lines in the /boot/uEnv file.

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

Also make sure that none of the other dtbo files listed in the /boot/uEnv file contain the IO mapping for the PRUSS.

It is an error to include the example from Listing 13-1 in Derek Molloy’s book on PRU mapping. In that dts file you must not include the following lines:

fragment@1 { // Enable the PRUSS
target = <&pruss>;
overlay {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&pru_pru_pins>;

They will cause the PRUSS mapping to be incorrect and result in a segmentation error.


Sadly Derek’s current book is very much tied to the old 3.8.x kernel.

Hopefully he will have a chance to update it now that we have things working great with U-Boot overlays.