dinuxbg / pru-gcc-examples

Simple example projects for PRU-GCC
49 stars 12 forks source link

Improve docs on running on recent Debian images #4

Closed tallakt closed 4 years ago

tallakt commented 4 years ago

I am trying to run the examples on:

$ uname -a                                                                                                                                                                                                       
Linux beaglebone 4.14.71-ti-r80 #1 SMP PREEMPT Fri Oct 5 23:50:11 UTC 2018 armv7l GNU/Linux

It was downloaded from https://debian.beagleboard.org/images/bone-debian-9.9-iot-armhf-2019-08-03-4gb.img.xz

As far as I can tell, the patch (./blinking-led/host-remoteproc/0001-Fix-remoteproc-to-work-with-the-PRU-GNU-Binutils-por.patch) has been included in this kernel (https://github.com/dinuxbg/pru-gcc-examples/issues/2).

The PRU code compiles fine, and I proceed to copy the firmwares to:

$ sudo cp out/pru-core0.elf /lib/firmware/am335x-pru0-fw
$ sudo cp out/pru-core1.elf /lib/firmware/am335x-pru1-fw

The RPMsg kernel modules seem to be loaded fine:

$ lsmod | grep pru                                                                                                                                                                                               
pruss_soc_bus          16384  0
pru_rproc              28672  0
pruss                  16384  1 pru_rproc
pruss_intc             16384  1 pru_rproc

At this point I was expecting the code to be bootable on the PRU:

$ cat /sys/class/remoteproc/remoteproc1/state                                                                                                                                                                    
offline
$ cat /sys/class/remoteproc/remoteproc2/state                                                                                                                                                                    
offline
$ sudo sh -c 'echo -n "start" > /sys/class/remoteproc/remoteproc1/state'                                                                                                                                         
sh: echo: I/O error
$ sudo sh -c 'echo -n "start" > /sys/class/remoteproc/remoteproc2/state'                                                                                                                                         
sh: echo: I/O error

I am a bit stuck at this point. Recompiling the kernel seems a bit overwhelming at this point. It would be nice if the documentation was a bit more specific about necessary steps to proceed from here. I was hoping to stick to pru-gcc rather than installing the TI tools.

The TI compiled firmware files work fine on this board

dinuxbg commented 4 years ago

Hi,

Thanks for using the GNU tools. Unfortunately your kernel is affected by improperly applied patch in RCN's tree. See https://github.com/beagleboard/linux/pull/187 .

I would suggest to upgrade your kernel. You can do it without recompiling by using RCN's scripts. See https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Kernel_Upgrade

Regards, Dimitar

tallakt commented 4 years ago

Thanks, that did the trick. I am at kernel 4.14.108-ti-r124