Beaglebone Green - Remoteproc dynamic firmware change. Module in Use Error.

102 views
Skip to first unread message

Neil Jubinville

unread,
Jan 11, 2017, 10:27:05 AM1/11/17
to BeagleBoard
Hi All, wishing everyone success in 2017!

Last night I was working on an automation routine for the green version and saw all the remoteproc stuff was in place, so I decided to move towards the remoteproc method of interacting with the PRU.

I was able to get the TI PRU Sample code compiled and the CGT clpru installed and run it the firmware build.  However I need to reboot the board everytime for it to load the firmware file.   I need to be able to make code changes, compile, and reload like I did with uio_pruss.

The searching I have read states that a simple removal and loading of the remoteproc module does the loading process as well from /lib/firmware.

I am receiving the message   FATAL module is in use.

I tried unloading other "in use" other modules but still got the same message.

Any ideas why or what locks a module from being reloaded or removed?   

Neil

Greg

unread,
Jan 12, 2017, 9:32:20 AM1/12/17
to BeagleBoard
I've never seen the FATAL error.

The following should work:

rmmod pru_rproc
modprobe pru_rproc

The above commands remove the remote proc kernel module, and then reinserts it.
Your revised firmware should be loaded after executing the modprobe command.

You will need root access or sudo prefix to the above commands.
What distribution are you using?

Regards,
Greg

Neil Jubinville

unread,
Jan 13, 2017, 2:49:19 PM1/13/17
to BeagleBoard
Hi Greg,

root@beaglebone:~# rmmod pru_rproc
rmmod: ERROR: Module pru_rproc is in use

or 

root@beaglebone:~# modprobe -r pru_rproc
modprobe: FATAL: Module pru_rproc is in use.

I am using kernel 4.4.9-ti-r25  Debian 8.6

I did not flash a new image - this is straight out of the box.  Do you know what the mechanism is that blocks the module remove in the OS?   

Neil

Neil Jubinville

unread,
Jan 13, 2017, 2:59:10 PM1/13/17
to BeagleBoard
OK this worked:

root@beaglebone:~# rmmod -f pru_rproc

I added the -f  and it forced it out.   Thx!!! 

Neil

Greg

unread,
Jan 14, 2017, 8:31:39 AM1/14/17
to BeagleBoard
Interesting.  On more recent distributions I did not have to use the -f option.
In some earlier TI documentation, rmmod -f was the recommended method to remote the PRU RemoteProc module.
But there have been changes since then and the PRU RemoteProc framework has continued to mature.

Please see the documentation in this project for another method to control RemoteProc from sysfs in user-space:


Follow the link to the github repository.  The documentation is in the doc directory.  Look for the PDF file.
Also there is a link to ZeekHuge's github repository where you can find more information.

Regards,
Greg
Reply all
Reply to author
Forward
0 new messages