This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PRU Training: Lab 5 Part 1 Issue

I am following Lab 5, Part 1 and unable to get this any messages (100) to appear.

Before lab:

root@localhost:~# lsmod
Module                  Size  Used by
usb_f_acm               5719  1 
u_serial                9743  1 usb_f_acm
usb_f_ecm               7925  1 
g_multi                 4010  0 
usb_f_mass_storage     34122  2 g_multi
usb_f_rndis            17792  2 g_multi
u_ether                 9321  3 usb_f_ecm,g_multi,usb_f_rndis
libcomposite           39088  5 usb_f_acm,usb_f_ecm,g_multi,usb_f_mass_storage,usb_f_rndis
remoteproc             24927  0 
virtio_ring             9675  1 remoteproc
virtio                  4624  1 remoteproc
omap_serial_rs485      15232  0 
root@localhost:~# 

am335x-pru0-fw = PRU_Halt.out

am335x-pru1-fw = PRU_RPMsg_Echo_Interrupt1.out

I then insert the modules according to the lab:

root@localhost:/mods# insmod virtio_rpmsg_bus.ko
root@localhost:/mods# insmod pruss_remoteproc.ko
root@localhost:/mods# insmod rpmsg_client_sample.ko
root@localhost:/mods#

No messages are printed per the lab.  The modules installed are now...

root@localhost:/mods# lsmod
Module                  Size  Used by
rpmsg_client_sample     1474  0 
pruss_remoteproc       13231  2 
virtio_rpmsg_bus       10643  1 rpmsg_client_sample
usb_f_acm               5719  1 
u_serial                9743  1 usb_f_acm
usb_f_ecm               7925  1 
g_multi                 4010  0 
usb_f_mass_storage     34122  2 g_multi
usb_f_rndis            17792  2 g_multi
u_ether                 9321  3 usb_f_ecm,g_multi,usb_f_rndis
libcomposite           39088  5 usb_f_acm,usb_f_ecm,g_multi,usb_f_mass_storage,usb_f_rndis
remoteproc             24927  1 pruss_remoteproc
virtio_ring             9675  2 virtio_rpmsg_bus,remoteproc
virtio                  4624  2 virtio_rpmsg_bus,remoteproc
omap_serial_rs485      15232  0 
root@localhost:/mods# 

Any ideas?

  • Which Lab 5 is this? Can you point to the wiki page?
  • The lab is "PRU Training: Hands-on Labs"

    To head off any set up questions, my DTSI has the following defined for the pruss:

    823                 pruss: pruss@4a300000 {                                                                                         
    824                         compatible = "ti,am3352-pruss", "ti,pruss-v2";                                                          
    825                         ti,hwmods = "pruss";                                                                                    
    826                         reg = <0x4a300000 0x2000>,                                                                              
    827                               <0x4a302000 0x2000>,                                                                              
    828                               <0x4a310000 0x3000>,                                                                              
    829                               <0x4a320000 0x2000>,                                                                              
    830                               <0x4a326000 0x2000>;                                                                              
    831                         reg-names = "dram0", "dram1", "shrdram2", "intc", "cfg";                                                
    832                         interrupts = <20 21 22 23 24 25 26 27>;                                                                 
    833                         #address-cells = <1>;                                                                                   
    834                         #size-cells = <1>;                                                                                      
    835                         ranges;                                                                                                 
    836                                                                                                                                 
    837                         pru0: pru@4a334000 {                                                                                    
    838                                 compatible = "ti,am3352-pru-rproc";                                                             
    839                                 reg = <0x4a334000 0x2000>,                                                                      
    840                                       <0x4a322000 0x400>,                                                                       
    841                                       <0x4a322400 0x100>;                                                                       
    842                                 reg-names = "iram", "control", "debug";                                                         
    843                                 mboxes = <&mailbox &mbox_pru0>;                                                                 
    844                         };                                                                                                      
    845                                                                                                                                 
    846                         pru1: pru@4a338000 {                                                                                    
    847                                 compatible = "ti,am3352-pru-rproc";                                                             
    848                                 reg = <0x4a338000 0x2000>,                                                                      
    849                                       <0x4a324000 0x400>,                                                                       
    850                                       <0x4a324400 0x100>;                                                                       
    851                                 reg-names = "iram", "control", "debug";                                                         
    852                                 mboxes = <&mailbox &mbox_pru1>;                                                                 
    853                         };                                                                                                      
    854                 };  

    And after all modules are loaded, my dev directory looks like:

    root@localhost:/mods# ls /dev
    ashmem           loop-control        stdout  tty26  tty45  tty7       vcs2
    autofs           mapper              tty     tty27  tty46  tty8       vcs3
    binder           mem                 tty0    tty28  tty47  tty9       vcs4
    block            memory_bandwidth    tty1    tty29  tty48  ttyGS0     vcs5
    btrfs-control    mmcblk0             tty10   tty3   tty49  ttyO1      vcs6
    bus              mmcblk0boot0        tty11   tty30  tty5   ttyS0      vcs7
    char             mmcblk0boot1        tty12   tty31  tty50  ttyS1      vcsa
    console          mmcblk0p1           tty13   tty32  tty51  ttyS2      vcsa1
    cpu_dma_latency  net                 tty14   tty33  tty52  ttyS3      vcsa2
    cuse             network_latency     tty15   tty34  tty53  ttyS4      vcsa3
    disk             network_throughput  tty16   tty35  tty54  ttyS5      vcsa4
    fd               null                tty17   tty36  tty55  ttyS6      vcsa5
    full             ppp                 tty18   tty37  tty56  ttyS7      vcsa6
    fuse             ptmx                tty19   tty38  tty57  ttyS8      vcsa7
    hwrng            ptp0                tty2    tty39  tty58  ttyS9      vhci
    i2c-0            pts                 tty20   tty4   tty59  ttyprintk  watchdog
    i2c-2            random              tty21   tty40  tty6   urandom    watchdog0
    input            rtc0                tty22   tty41  tty60  usbmon0    zero
    kmem             shm                 tty23   tty42  tty61  usbmon1
    kmsg             stderr              tty24   tty43  tty62  vcs
    log              stdin               tty25   tty44  tty63  vcs1
    root@localhost:/mods# 
    

    When I run the "rpmsg_pru_user_space_echo.out" app, as talked about in lab 5, I get the following:

    bwilcutt2@bwilcutt-VirtualBox:/opt/ti-processor-sdk-linux-am335x-evm-02.00.00.00/example-applications/pru/labs/lab_5$ ./rpmsg_pru_user_space_echo.out 
    Failed to open /dev/rpmsg_pru31
    

    Thank you!

  • Lab 5 Part 1 is meant to showcase kernel space communication between Linux and the PRU. The rpmsg_client_sample.ko module is probed when an RPMsg channel is created with CHAN_NAME "rpmsg_client_sample". The CHAN_NAME is set in the main.c file of the PRU_RPMsg_Echo_Interrupt1 project.

    Lab 5 Part 2 shows user space communication between Linux and the PRU by creating the character device that you are looking for in the /dev/ directory. The rpmsg_pru.ko module is probed when an RPMsg channel is created with CHAN_NAME "rpmsg_pru". Once again, the CHAN_NAME is set in the main.c file of the PRU_RPMsg_Echo_Interrupt1 project.

    It appears like you are loading the kernel space module while trying to use the user space CHAN_NAME. Please try going through the steps in Lab 5 Part 2 again: 

    Jason Reeder

  • Jason,

    Excellent!  Changing the name to match was the magic formula, thank you very much!

    root@localhost:/mods# ls /dev
    ashmem           loop-control        stdin   tty25  tty44  tty63      vcs1
    autofs           mapper              stdout  tty26  tty45  tty7       vcs2
    binder           mem                 tty     tty27  tty46  tty8       vcs3
    block            memory_bandwidth    tty0    tty28  tty47  tty9       vcs4
    btrfs-control    mmcblk0             tty1    tty29  tty48  ttyGS0     vcs5
    bus              mmcblk0boot0        tty10   tty3   tty49  ttyO1      vcs6
    char             mmcblk0boot1        tty11   tty30  tty5   ttyS0      vcs7
    console          mmcblk0p1           tty12   tty31  tty50  ttyS1      vcsa
    cpu_dma_latency  net                 tty13   tty32  tty51  ttyS2      vcsa1
    cuse             network_latency     tty14   tty33  tty52  ttyS3      vcsa2
    disk             network_throughput  tty15   tty34  tty53  ttyS4      vcsa3
    fd               null                tty16   tty35  tty54  ttyS5      vcsa4
    full             ppp                 tty17   tty36  tty55  ttyS6      vcsa5
    fuse             ptmx                tty18   tty37  tty56  ttyS7      vcsa6
    hwrng            ptp0                tty19   tty38  tty57  ttyS8      vcsa7
    i2c-0            pts                 tty2    tty39  tty58  ttyS9      vhci
    i2c-2            random              tty20   tty4   tty59  ttyprintk  watchdog
    input            rpmsg_pru31         tty21   tty40  tty6   urandom    watchdog0
    kmem             rtc0                tty22   tty41  tty60  usbmon0    zero
    kmsg             shm                 tty23   tty42  tty61  usbmon1
    log              stderr              tty24   tty43  tty62  vcs
    root@localhost:/mods# 
    

    When I looked at the at the rpmsg_client_sample.c file I noticed the PROBE function expects a "struct rpmsg_channel *".   My UIO driver's probe function expects a "struct platform_device *".   Is there a way to reconcile these two data types with the TI drivers?  Is there a way to get the TI drivers to probe my UIO instead?