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.

DRA829J: Linux Kernal space driver for 'rpmsg' SDK-J721E for SDK version 10

Part Number: DRA829J


Tool/software:

Hello Team,

We are trying to develop a kernel space driver for rpmsg communication with R5F cores. We were able to send/receive data using default endpoint. We want to send data to specific core. For example, if I want to send data to core R5F_MAIN_0_0, how shall I create endpoint for this core and send data through it?

We tried running rpmsg-char-simple example from user space to ensure the communication from user space. We observed that only rproc_id 0 and 1 were working. For other cores, we were getting errors. Attaching the logs for reference. 

root@aptiv-ep2000:~# cd install/
root@aptiv-ep2000:~/install# ls
bin      include  lib
root@aptiv-ep2000:~/install# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/install/lib
root@aptiv-ep2000:~/install# cd bin/
root@aptiv-ep2000:~/install/bin# ks
-sh: ks: command not found
root@aptiv-ep2000:~/install/bin# ls
rpmsg_char_simple
root@aptiv-ep2000:~/install/bin# ./rpmsg_char_simple -r 0
Created endpt device rpmsg-char-0-1081, fd = 3 port = 1025
Exchanging 100 messages with rpmsg device rpmsg-char-0-1081 on rproc id 0 ...

Sending message #0: hello there 0!
Received message #0: round trip delay(usecs) = 194115
hello there 0!
Sending message #1: hello there 1!
Received message #1: round trip delay(usecs) = 90425
hello there 1!
Sending message #2: hello there 2!
Received message #2: round trip delay(usecs) = 84350
hello there 2!
.....
Sending message #98: hello there 98!
Received message #98: round trip delay(usecs) = 68700
hello there 98!
Sending message #99: hello there 99!
Received message #99: round trip delay(usecs) = 78575
hello there 99!

Communicated 100 messages successfully on rpmsg-char-0-1081

TEST STATUS: PASSED
root@aptiv-ep2000:~/install/bin# ./rpmsg_char_simple -r 1
_rpmsg_char_find_rproc: 41400000.r5f is either not probed or not a remoteproc!
Can't create an endpoint device: No such file or directory
TEST STATUS: FAILED
root@aptiv-ep2000:~/install/bin# ./rpmsg_char_simple -r 2
Created endpt device rpmsg-char-2-1084, fd = 3 port = 1025
Exchanging 100 messages with rpmsg device rpmsg-char-2-1084 on rproc id 2 ...

Sending message #0: hello there 0!
Received message #0: round trip delay(usecs) = 145075
hello there 0!
Sending message #1: hello there 1!
Received message #1: round trip delay(usecs) = 109470
hello there 1!
Sending message #2: hello there 2!
Received message #2: round trip delay(usecs) = 81365
.....
Sending message #96: hello there 96!
Received message #96: round trip delay(usecs) = 67280
hello there 96!
Sending message #97: hello there 97!
Received message #97: round trip delay(usecs) = 66460
hello there 97!
Sending message #98: hello there 98!
Received message #98: round trip delay(usecs) = 64750
hello there 98!
Sending message #99: hello there 99!
Received message #99: round trip delay(usecs) = 66710
hello there 99!

Communicated 100 messages successfully on rpmsg-char-2-1084

TEST STATUS: PASSED
root@aptiv-ep2000:~/install/bin# ./rpmsg_char_simple -r 3
_rpmsg_char_find_ctrldev: could not find the matching rpmsg_ctrl device for virtio2.rpmsg_chrdev.-1.14
Can't create an endpoint device: Invalid argument
TEST STATUS: FAILED
root@aptiv-ep2000:~/install/bin# ./rpmsg_char_simple -r 4
_rpmsg_char_find_rproc: 5e00000.r5f does not have any virtio devices!
Can't create an endpoint device: No such file or directory
TEST STATUS: FAILED
root@aptiv-ep2000:~/install/bin# ./rpmsg_char_simple -r 5
_rpmsg_char_find_rproc: 5f00000.r5f does not have any virtio devices!
Can't create an endpoint device: No such file or directory
TEST STATUS: FAILED
root@aptiv-ep2000:~/install/bin# ./rpmsg_char_simple -r 6
_rpmsg_char_find_rproc: 4d80800000.dsp is either not probed or not a remoteproc!
Can't create an endpoint device: No such file or directory
TEST STATUS: FAILED
root@aptiv-ep2000:~/install/bin#


root@aptiv-ep2000:~# ls /sys/bus/rpmsg/devices
virtio0.rpmsg_chrdev.-1.14       virtio1.rpmsg_chrdev.-1.14       virtio2.rpmsg_ctrl.0.0
virtio0.rpmsg_ctrl.0.0           virtio1.rpmsg_ctrl.0.0           virtio2.rpmsg_ns.53.53
virtio0.rpmsg_ns.53.53           virtio1.rpmsg_ns.53.53
virtio0.ti.ipc4.ping-pong.-1.13  virtio1.ti.ipc4.ping-pong.-1.13

Kindly check, provide your suggestions.

  • Hello,

    May i know what firmware's are present in main domain cores ?

    Please run the command ls -l /lib/firmware/ and share me the screenshot

    Regards

    Tarun Mukesh

  • Hello Tarun,

    here is the log attached above.

    root@aptiv-ep2000:~# ls -la /lib/firmware/
    total 11172
    drwxr-xr-x 3 root root 4096 Mar 9 2018 .
    drwxr-xr-x 29 root root 12288 Mar 9 2018 ..
    -rw-r--r-- 1 root root 482664 Mar 9 2018 bl32.bin
    -rw-r--r-- 1 root root 4433352 Mar 9 2018 bl32.elf
    drwxr-xr-x 2 root root 4096 Mar 9 2018 cadence
    lrwxrwxrwx 1 root root 30 Mar 9 2018 j7-main-r5f0_0-fw -> mcu2_0_application_strip.xer5f
    lrwxrwxrwx 1 root root 30 Mar 9 2018 j7-main-r5f0_1-fw -> mcu2_1_application_strip.xer5f
    lrwxrwxrwx 1 root root 30 Mar 9 2018 j7-main-r5f1_0-fw -> mcu3_0_application_strip.xer5f
    lrwxrwxrwx 1 root root 30 Mar 9 2018 j7-main-r5f1_1-fw -> mcu3_1_application_strip.xer5f
    -rw-r--r-- 1 root root 88280 Mar 9 2018 mcu2_0_application_strip.xer5f
    -rw-r--r-- 1 root root 88280 Mar 9 2018 mcu2_1_application_strip.xer5f
    -rw-r--r-- 1 root root 88280 Mar 9 2018 mcu3_0_application_strip.xer5f
    -rw-r--r-- 1 root root 88280 Mar 9 2018 mcu3_1_application_strip.xer5f
    -rw-r--r-- 1 root root 247469 Mar 9 2018 pvdec_full_bin.fw
    -rw-r--r-- 1 root root 28 Mar 9 2018 tee-header_v2.bin
    -rw-r--r-- 1 root root 0 Mar 9 2018 tee-pageable_v2.bin
    -rw-r--r-- 1 root root 482664 Mar 9 2018 tee-pager_v2.bin
    -rw-r--r-- 1 root root 482664 Mar 9 2018 tee-raw.bin
    -rw-r--r-- 1 root root 482692 Mar 9 2018 tee.bin
    -rw-r--r-- 1 root root 4433352 Mar 9 2018 tee.elf

    /Subhan

  • Hello,

    lrwxrwxrwx 1 root root 30 Mar 9 2018 j7-main-r5f0_0-fw -> mcu2_0_application_strip.xer5f
    lrwxrwxrwx 1 root root 30 Mar 9 2018 j7-main-r5f0_1-fw -> mcu2_1_application_strip.xer5f
    lrwxrwxrwx 1 root root 30 Mar 9 2018 j7-main-r5f1_0-fw -> mcu3_0_application_strip.xer5f
    lrwxrwxrwx 1 root root 30 Mar 9 2018 j7-main-r5f1_1-fw -> mcu3_1_application_strip.xer5f

    Could you tell me what these executable's are ?

    We tried running rpmsg-char-simple example from user space to ensure the communication from user space. We observed that only rproc_id 0 and 1 were working. For other cores, we were getting errors

    rpmsg_char_simple only communicates with ipc_echo_test executable's on other cores .If you flash any other executable then there won't be any communication with rpmsg_char_simple application.

    Regards

    Tarun Mukesh

  • Hello Tarun,

    Thanks for the clarification. We understand that our firmware's were customized and that's why echo test is not working for us.

    Regarding kernel space driver, we tried using the rpmsg_client_sample driver available in samples/rpmsg/ folder. But this driver is not working. It was not getting probed. Is there any configuration we have to make for this driver to work on our platform?