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.

Linux/AM3358: Can't set up RPMsg

Part Number: AM3358

Tool/software: Linux

I'm building my custom image for AM335x SoC using buildroot. The board is Beagle Bone Black compatible. Now I'm trying to add RPMsg support to my zImage (I'm using  PRU Training: Hands-on Labs guide). But when I do

echo 'PRU_RPMsg_Echo_Interrupt1.out' > /sys/class/remoteproc/remoteproc0/firmware

echo 'start' > /sys/class/remoteproc/remoteproc0/state

I get a following error in dmesg:

[  409.633006] remoteproc remoteproc0: powering up 4a334000.pru
[  409.640022] remoteproc remoteproc0: Booting fw image PRU_PRMsg_Echo_Interrupt1_1.out, size 76944
[  409.655059] pruss 4a300000.pruss: channel 1 (req. intr_no 1) already assigned to intr_no 1
[  409.664030] pru-rproc 4a334000.pru: failed to configure pruss intc -17
[  409.670867] remoteproc remoteproc0: Failed to process post-loading resources: -17
[  409.678908] remoteproc remoteproc0: Boot failed: -17


As far as I understood the numbers of system events (interrupts) that are used for communication between ARM and PRU are 15 16 17 18 (It's stated in the device tree and PRU project). So, why am I getting these errors?
I've attached my device tree source file, my linux config file, dmesg log, the project that I am trying to load is PRU_PRMsg_Echo_Interrupt1 from examples. Thanks!)

https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/logs.7z



  • Please post which Linux version you use.
  • I'm using 4.14.40 linux kernel from git://git.ti.com/processor-sdk/processor-sdk-linux.git
  • Hello Andrey,

    1) Are you running something else on the PRU core that is not using RPMsg? If so, try again without that non-RPMsg PRU core running. If that fixes your issue, jump down to 1, cont.

    2) The Hands-on labs are a good resource. The labs also have a lot of non-RPMsg information, so I suggest going through the RPMsg Quick Start Guide to see if that resolves your problem.

    3) If you are having trouble going through specific steps in either the Labs or the Quick Start Guide, tell me which step you are having trouble with.

    1, cont) If your issue is fixed by only using one PRU core, you might have to modify the system event > interrupt channel > host interrupt mapping in the INTC. Ask me for more information on how to do this. The INTC is shared by both PRUs (see the technical reference manual for AM335x, chapter Programmable Real-Time Unit Subsystem and Industrial Communication Subsystem (PRU-ICSS) > Functional Description > Interrupt Controller (INTC)

    Regards,
    Nick
  • Thanks for the reply, Nick!) I've try to do the following to run only RPMsg things on PRU:
    echo 'PRU_Halt_1.out' > /sys/class/remoteproc/remoteproc0/firmware
    echo 'start' > /sys/class/remoteproc/remoteproc0/state
    echo 'PRU_PRMsg_Echo_Interrupt1_1.out' > /sys/class/remoteproc/remoteproc1/firmware
    echo 'start' > /sys/class/remoteproc/remoteproc1/state

    And the error remained... So I will keep on digging...
  • Hello Andrey,

    Ok, good luck with the continued debugging. I'm double-checking to see if there are known situations where the INTC will complain that it is already configured. If I don't learn anything new, I'll just wait for an update from your end.

    Regards,
    Nick
  • After some point I started to get the following error instead of mentioned above: virtio vring interrupt mechanisms are not provided (not sure what have triggered that change though, it didn't look like i'd changed anything). After some searching through linux RPMsg drivers code I realized that the reason is that pru_rproc module couldn't create mailbox for ARM<->PRU communications (the problem was in sanity check before mailbox creation that I didn't get completely - if (pru->irq_vring <= 0 && pru->irq_kick <= 0 &&!of_device_is_compatible(np, "ti,k2g-pru"))) - so I've commented it and mailbox finally was created (I also added mboxes property for pru instances in my device tree). But still when I tried to modprobe rpmsg_client_sample there is no output in dmesg and there is no pru devices in /dev/ directory. It looks like rpmsg_pru_probe function from rpmsg_pru module hadn't been called for some reason. I also found the following thread with similar problem: e2e.ti.com/.../672762. It's look like different versions of RPMsg software uses different mechanisms for ARM<->PRU communications - either mailboxes or system events. So maybe I don't need mailboxes for ARM<->PRU communications. So, I am still confused about what should I do with my kernel to get this example working... By the way here is my lsmod output:
    Module Size Used by Not tainted
    rpmsg_client_sample 16384 0
    rpmsg_rpc 28672 0
    rpmsg_proto 16384 0
    rpmsg_char 16384 0
    virtio_rpmsg_bus 20480 0
    pruss_soc_bus 16384 0
    pru_rproc 24576 2
    pruss_intc 16384 1 pru_rproc
    rpmsg_pru 16384 0
    rpmsg_core 16384 6 rpmsg_client_sample,rpmsg_rpc,rpmsg_proto,rpmsg_char,virtio_rpmsg_bus,rpmsg_pru
    pruss 16384 1 pru_rproc
    omap_mailbox 20480 2
  • FYI: the exact kernel version from git://git.ti.com/processor-sdk/processor-sdk-linux.git is 4.14.40-4796173
  • Hello Andrey,

    Yes, if the PRU is expecting to use mailboxes that will cause problems. We used to use mailboxes for the PRU <-> ARM communication, but a year or so back we changed the Linux RPMsg driver to use interrupts.

    If you are getting your PRU Software Support Package from the git repo rather than an SDK, tag v5.2.1 was intended to be used with kernel version 4.14.40.

    Git repo: git.ti.com/.../
    Note that source tree > download master as tar.gz does not work on that URL. If you want to download the repo using a download button, please use the cgit site git.ti.com/.../

    Regards,
    Nick
  • Hello Andrey,

    I am going to mark this thread resolved. Feel free to reply if you need to continue the discussion.

    Regards,
    Nick