Start pru at boot

Hello,

I’m trying to load and start pru firmware at boot time. I see that the images are loaded, but the execution doen’t start:

`
root@beaglebone:~# dmesg | grep pru
[ 3.620397] ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices
[ 3.620598] irq: no irq domain found for /ocp/pruss@4a300000/intc@4a320000 !
[ 3.633760] irq: no irq domain found for /ocp/pruss@4a300000/intc@4a320000 !
[ 3.671299] remoteproc1: 4a338000.pru1 is available
[ 3.681586] pru-rproc 4a338000.pru1: booting the PRU core manually
[ 3.681620] remoteproc1: powering up 4a338000.pru1
[ 3.681935] remoteproc1: Booting fw image am335x-pru1-fw, size 35392
[ 3.682009] remoteproc1: remote processor 4a338000.pru1 is now up
[ 3.682052] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss@4a300000/pru1@4a338000 probed successfully
[ 3.690194] remoteproc2: 4a334000.pru0 is available
[ 3.696169] pru-rproc 4a334000.pru0: booting the PRU core manually
[ 3.696201] remoteproc2: powering up 4a334000.pru0
[ 3.696513] remoteproc2: Booting fw image am335x-pru0-fw, size 36296
[ 3.696585] remoteproc2: remote processor 4a334000.pru0 is now up
[ 3.696621] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss@4a300000/pru0@4a334000 probed successfully
root@beaglebone:~#

`

I have to manualy do:

`
root@beaglebone:~# rmmod -f pru-rproc
root@beaglebone:~# modprobe pru-rproc

`

After doing so the pru’s are executing as expected… Is there a way so that the firmware starts automatic each boot time?

my environment:

`
root@beaglebone:~# uname -a
Linux beaglebone 4.4.91-ti-r133 #1 SMP Tue Oct 10 05:18:08 UTC 2017 armv7l GNU/Linux
root@beaglebone:~# cat /boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.4.91-ti-r133
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1

I'd try running:

sudo update-initramfs -uk `uname -r`
sudo reboot

maybe the firmware isn't loaded early enough into the pru???

Regards,

OK, thanks, this made it…

Can you explain (or give link(s) to explain) what was the problem and how update-initramfs… solved it?

Thanks again.

It's a race condition..

When the pru-rproc module (or built-in) loads it looks for the
firmware files. While they are on the filesystem at /lib/firmware/,
the file system isn't fully loaded, thus they aren't really available.

By running:

sudo update-initramfs -uk `uname -r`

The am335x-pru0-fw/am335x-pru1-fw files will be coped into the initrd,
that way they'll be available for pru-rproc right away, thus no longer
depended on the rootfs being up..

Here is the update-initramfs hook-functions that does the coping:

https://github.com/rcn-ee/repos/blob/master/bb-customizations/suite/jessie/debian/ti_pru_firmware

PS, this also has a side affect, make sure you re-run:

sudo update-initramfs -uk `uname -r` ; sudo reboot

on "every" pruX-fw modification, as the initrd will always have the
"last" version...

Regards,