Error when starting PRU: "-bash: echo: write error: Invalid argument"

Hi,

I am getting the following error when starting the PRU on a Beaglebone Black. The Debian version is Buster IoT 10.3 with all packages up to date. I am using the PRU_gpioToggle example in the ti pru software support package. Also tried other examples, but I get the same error.

root@beaglebone:/home/debian# cp PRU_gpioToggle.out /lib/firmware/
root@beaglebone:/home/debian# echo 'PRU_gpioToggle.out' > /sys/class/remoteproc/remoteproc1/firmware
root@beaglebone:/home/debian# echo 'start' > /sys/class/remoteproc/remoteproc1/state
bash: echo: write error: Invalid argument

From dmesg:

[   77.087964] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[   77.101753] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
[  199.843143] remoteproc remoteproc1: powering up 4a334000.pru
[  199.853266] remoteproc remoteproc1: Booting fw image PRU_gpioToggle.out, size 30172
[  199.853355] remoteproc remoteproc1: Boot failed: -22

Kernel Version:

Linux beaglebone 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020 armv7l GNU/Linux

uEnv.txt Configuration:

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

I’ve also tried running this on a pocketbeagle, but I am getting the same result. Am I missing something?
Any help will be appreciated.

Thanks!

There might be a problem with the Kernel and pru software support package version compatibility.

When I started out working I noticed that the preinstalled pssp in /usr/lib/ti/pru-software-support-package didn’t work (don’t remember the exact error that I got) so it might be the same thing that is happening to you right now. I solved this by downloading a fresh version that did work.

git clone --depth=1 --branch v5.9.0 git://git.ti.com/pru-software-support-package/pru-software-support-package.git

Note that I am getting version 5.9.0 and not the latest 6.X.X as version 6.0.0 dropped support for Kernels older than 5.10. If you’re using newer Kernels you obviously have to use those instead.

Thanks @lopatin. I compiled the code using the PRU support package V5.9.0 and it resolved my problem. Thanks, much appreciated!