Defualt PRU firmware changing after reboot.

Hi,
I am working around with both the BB PRUs, properly installed the codes using

make install_PRU0
make install_PRU1
I load:
echo ‘am335x-pru0-fw’ in > /sys/class/remoteproc/remoteproc1/firmware
echo ‘am335x-pru1-fw’ in > /sys/class/remoteproc/remoteproc2/firmware

code works fine and sweet. but after a reboot the firmwares got swapped.

cat /sys/class/remoteproc/remoteproc1/firmware
am335x-pru1-fw

cat /sys/class/remoteproc/remoteproc2/firmware
am335x-pru0-fw

Is there is any way to fix the firmware, such that it didnot get swapeed after reboot.

first, you are leaving out a lot of detail:

  • what OS version are you running?
  • what does the install_PRU? script look like?

at some point, you need to cp (copy) your firmware into am335x-pru?-fw … where is this done?

AND as far as I know, this needs to be done every time at reboot… I don’t know of any way that PRU firmware survives a reboot… this is why my first question is about what OS version you are running, I’d love to find out how to have my PRU code survive a reboot.

good luck
gomer

In linux, the offset number in remoteproc is not stable between reboots. /sys/class/remoteproc/remoteprocX/… So don’t hardcode your script to copy specific firwmare based off that one # if you run tree in that directory you’ll see a memory offset:

debian@23-am335x-bbb:~$ tree /sys/class/remoteproc/remoteproc1/ | grep pru
├── device -> ../../../4a334000.pru
debian@23-am335x-bbb:~$ tree /sys/class/remoteproc/remoteproc2/ | grep pru
├── device -> ../../../4a338000.pru

Use those magic numbers to help you figure out pru0 vs pru1 … (also kernel specifc…)

debian@23-am335x-bbb:~$ uname -r
5.10.168-ti-r77

If you copy your firmware am335x-pru1-fw/am335x-pru0-fw under /lib/firwmare/ and also copy them into hte initrd, they will be auto-loaded on bootup…

Regards,