I got a PocketBeagle and I want to try out the PRU on it. Everything seems different from the PRUSSDRV stuff I’m used to. I can’t get remoteproc to work, so I wanted to know which kernel and interfaces I should use.
Specifically, I’m running the 2017-10-10 Stretch IoT build from http://beagleboard.org/latest-images
I tried running the remoteproc “Hello world” from here.
First, I ran into problems with stdint.h not found; I eventually found it in /usr/share/ti/cgt-pru/include - is that the right include path to use?
When I ran the program, I got a bunch of warnings:
Note: remoteproc is still under development and considered experimental.
THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn’t yet guaranteed.
And then the program died with “Failed to open /dev/rpmsg_pru31”
So: is remoteproc what I should be using, or is it still “experimental”? Am I using the right kernel? And what is “resource_table.h”?
Which kernel version are you using? If it’s the 4.9 version (most likely as it is the Stretch image), some additional steps are required because the binary won’t start up automatically at boot as it does in kernel version 4.4.
This is a change that happened done going from 4.4-4.9.
To boot the binary, once you build and put it into /lib/firmware you would have to manually boot it.
Go to /sys/class/remoteproc in a root shell
There should be 3 directories, remoteproc0, remoteproc1, remoteproc2. To find which is the correct one for PRU0 for example, do: cat /sys/class/remoteproc/remoteproc1/device/of_node/label . It should say “pru0” (at least it does on my board)
Once you have found the correct remoteproc directory, cd into it. Let’s for example assume for PRU0 the directory is /sys/class/remoteproc/remoteproc1
Then you have to set the name for the firmware you have copied into /lib/firmware using: echo am335x-pru0-fw > firmware .
Then you have to start the device using: echo start > state . To stop the PRU, do: echo stop > state .
I hope this should get the rpmsg driver to show up. Pastebin your kernel logs so that I can take a look.
Resource table is a way of signifying to the remoteproc driver:
the PRU interrupts it should configure on PRU boot,
virtqueues used for PRU<->Kernel communication
The resource table is placed in an ELF section that the remoteproc kernel driver reads before it loads the firmware into the PRUs.
Hi Ken,
Having recently also bought a pocket beagle(my first), I ran through these steps from Jason, as he suggested in another thread recently, successfully : https://gist.github.com/jadonk/2ecf864e1b3f250bad82c0eae12b7b64
I thought it would be instructive to work out how to run the example you tried also though. Basically taking the working gist and resolving issues with your example as they appear.
Resulting in:
I am also having some troubles with rpmsg, having migrated from 4.4 to 4.9.
Your instructions seem to work fine, at least when I run my program for the first time. If I want to change the firmware for the PRU, I have to remove the pru_rproc module, but when I load the module again I no longer have the 3 directories remoteproc0, remoteproc1 and remoteproc2, but instead I have remoteproc0, remoteproc3 and remoteproc4. If I ignore that and try to run my program again I get a bunch of messages from syslogd@beaglebone and everything ends with a segmentation fault.
If I try to use the new files, remoteproc3 and remoteproc4, I get the following errors (output of dmesg):
So the events are still assigned to the previous channels?
Can you please help me understand what’s happening? First of all, what are these remoteproc1,2,etc. files (are they somehow related to the channels used to communicate with the PRU?), why do remoteproc1/2 disappear from /sys/class/remoteproc but the events are still assigned to them? And finally, how can I reload the firmware in case of a change?
Hi Alex,
thank you for your recommendations, got an adaption of the project remoteproc “Hello World” working on Debian 2017/10/10.
If somebody is interested, here is a running version on Github. https://github.com/RoSchmi/Beaglebone-PRU-RPMsg-HelloWorld
Kind regards
RoSchmi