Sitemap

BeagleY-AI and the C7x . Running IPC echo on the DSP. With Fancy Rat 11.0

15 min readJul 5, 2025

It took over a year, but now it seems like they have gotten the edge-ai demos running on the beagleY-AI. I will probably do another article exploring this in detail.

This article will instead be a continuation for what I wrote before. As a by-product from Bradys work, I was able to setup a toolchain and compile the IPC-Echo client for the DSP.

If you want more info about remoteproc an rpmsg read here,

or here

Building the example

If you are using my dockerized toolchain you can do,

cd ~/ti/ti-processor-sdk-rtos-j722s-evm-11_00_00_06/mcu_plus_sdk_j722s_11_00_00_12/examples/hello_beagley/ipc/ipc_rpmsg_echo_linux

make -C j722s-evm/c75ss0–0_freertos/ti-c7000

As the beagle image already have ti.ipc4.ping-pong running we modify the service name and destination.

-#define IPC_RPMESSAGE_SERVICE_PING "ti.ipc4.ping-pong"
-#define IPC_RPMESSAGE_ENDPT_PING (13U)
+#define IPC_RPMESSAGE_SERVICE_PING "ti.ipc5.ping-pong"
+#define IPC_RPMESSAGE_ENDPT_PING (11U)

/* This is used to run the echo test with user space kernel */
#define IPC_RPMESSAGE_SERVICE_CHRDEV "rpmsg_chrdev"
-#define IPC_RPMESSAGE_ENDPT_CHRDEV_PING (14U)
+#define IPC_RPMESSAGE_ENDPT_CHRDEV_PING (12U)

#if 1 /* not logging this so that this does not add to the latency of message exchange */
recvMsg[recvMsgSize] = 0; /* add a NULL char at the end of message */
DebugP_log("%s\r\n", recvMsg);
#endif

The file generated/ti_drivers_config.c contains the resource table that we need to allow remoteproc load the firmware


const RPMessage_ResourceTable gRPMessage_linuxResourceTable __attribute__ ((section (".resource_table"), aligned (1024))) =
{
{
1U, /* we're the first version that implements this */
2U, /* number of entries, MUST be 2 */
{ 0U, 0U, } /* reserved, must be zero */
},
/* offsets to the entries */
{
offsetof(RPMessage_ResourceTable, vdev),
offsetof(RPMessage_ResourceTable, trace),
},
/* vdev entry */
{
RPMESSAGE_RSC_TYPE_VDEV, RPMESSAGE_RSC_VIRTIO_ID_RPMSG,
0U, 1U, 0U, 0U, 0U, 2U, { 0U, 0U },
},
/* the two vrings */
{ RPMESSAGE_RSC_VRING_ADDR_ANY, 4096U, 256U, 1U, 0U },
{ RPMESSAGE_RSC_VRING_ADDR_ANY, 4096U, 256U, 2U, 0U },
{
(RPMESSAGE_RSC_TRACE_INTS_VER0 | RPMESSAGE_RSC_TYPE_TRACE),
(uint32_t)gDebugMemLog, DebugP_MEM_LOG_SIZE,
0, "trace:c75ss0_0",
},
};

On the beagleY-AI

We need most of the firmware operations to run as root, so do.

sudo bash
cat /sys/class/remoteproc/remoteproc0/firmware
j722s-c71_0-fw
echo "module ti_k3_dsp_remoteproc +p" > /sys/kernel/debug/dynamic_debug/control
root@BeagleBone:/home/olof# k3conf dump processor
|-----------------------------------------------------------------------------------------|
| VERSION INFO |
|-----------------------------------------------------------------------------------------|
| K3CONF | (version 0.3-nogit built Fri Jun 06 00:20:11 UTC 2025) |
| SoC | J722S SR1.0 |
| SoC identifiers | [0x3323062e] fam: 0x0000000c base: 0x00000460 |
| DIE-ID | [0] 0x2CA60000 [1] 0x00004000 [2] 0x0800fc2d [3] 0x0104d421 |
| SYSFW | ABI: 4.0 (firmware version 0x000b '11.0.9--v11.00.09+ (Fancy Rat))') |
| DM ABI Info | 3.0 |
| DM F/w rev | 11.0.9 |
| DM Component rev | RM/PM HAL:'v11.00.09' SCI_SERV:'MSDK.11.00.00.05+' |
| F/w Capabilities | 0x101: GEN DM-SPLT |
|-----------------------------------------------------------------------------------------|

|------------------------------------------------------------------------------------------|
| Device ID | Processor ID | Processor Name | Processor State | Processor Frequency |
|------------------------------------------------------------------------------------------|
| 121 | 1 | WKUP_R5FSS0_CORE0 | DEVICE_STATE_ON | 800000000 |
| 9 | 3 | MCU_R5FSS0_CORE0 | DEVICE_STATE_OFF | 800000000 |
| 262 | 4 | R5FSS0_CORE0 | DEVICE_STATE_OFF | 800000000 |
| 135 | 32 | A53SS0_CORE_0 | DEVICE_STATE_ON | 1200000000 |
| 136 | 33 | A53SS0_CORE_1 | DEVICE_STATE_ON | 1200000000 |
| 137 | 34 | A53SS0_CORE_2 | DEVICE_STATE_ON | 1200000000 |
| 138 | 35 | A53SS0_CORE_3 | DEVICE_STATE_ON | 1200000000 |
| 208 | 48 | C7X256V0_C7XV_CORE_0 | DEVICE_STATE_OFF | 1000000000 |
| 268 | 49 | C7X256V1_C7XV_CORE_0 | DEVICE_STATE_OFF | 1000000000 |
| 225 | 128 | HSM0 | DEVICE_STATE_ON | 500000000 |
|------------------------------------------------------------------------------------------|

Add some more debug output from the kernel
echo "module ti_k3_dsp_remoteproc +p" > /sys/kernel/debug/dynamic_debug/control
echo 'file drivers/rpmsg/* +p' > /sys/kernel/debug/dynamic_debug/control
echo "file drivers/remoteproc/ti_k3_dsp_remoteproc.c +p" > /sys/kernel/debug/dynamic_debug/control
echo "module remoteproc_elf_loader.c +p" > /proc/dynamic_debug/control
echo "module ti_k3_dsp_remoteproc +p" > /proc/dynamic_debug/control

# Make a symbolic link to the firmware, dont mix up 0 and 1
ln -s /home/olof/ipc_rpmsg_echo_linux.release.out /lib/firmware/j722s-c71_0-fw

dmesg | grep rpmsg
[ 8.343195] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 8.343641] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xd
[ 8.378118] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xe

echo start > /sys/class/remoteproc/remoteproc0/state
[ 773.233842] remoteproc remoteproc0: powering up 7e000000.dsp
[ 773.237367] remoteproc remoteproc0: Booting fw image j722s-c71_0-fw, size 2263952
[ 773.238713] k3-dsp-rproc 7e000000.dsp: booting DSP core using boot addr = 0xa3600000
[ 773.253489] rproc-virtio rproc-virtio.8.auto: assigned reserved memory node c7x-dma-memory@a3000000
[ 773.255185] virtio_rpmsg_bus virtio1: rpmsg host is online
[ 773.255262] rproc-virtio rproc-virtio.8.auto: registered virtio1 (type 7)
[ 773.255273] remoteproc remoteproc0: remote processor 7e000000.dsp is now up

We can try the rpmsg client from our previous article.

enum rproc_id {
R5F_MCU0_0 = 0,
R5F_MCU0_1 = 1,
R5F_MAIN0_0 = 2,
R5F_MAIN0_1 = 3,
R5F_MAIN1_0 = 4,
R5F_MAIN1_1 = 5,
DSP_C66_0 = 6,
DSP_C66_1 = 7,
DSP_C71_0 = 8,
M4F_MCU0_0 = 9,
DSP_C71_1 = 10,
R5F_MAIN2_0 = 11,
R5F_MAIN2_1 = 12,
DSP_C71_2 = 13,
DSP_C71_3 = 14,
R5F_WKUP0_0 = 15,
RPROC_ID_MAX,
};

Note that -r is rproc_id. As we now have more kernel logging we get this:


./a.out -r 15 -n 4 -p 14
Created endpt device rpmsg-char-15-2587, fd = 4 port = 1025
Exchanging 4 messages with rpmsg device rpmsg-char-15-2587 on rproc id 15 ...

Sending message #0: hello there 0!
Received message #0: round trip delay(usecs) = 249002
hello there 0!
Sending message #1: hello there 1!
Received message #1: round trip delay(usecs) = 166386
hello there 1!
Sending message #2: hello there 2!
Received message #2: round trip delay(usecs) = 232722
hello there 2!
Sending message #3: hello there 3!
Received message #3: round trip delay(usecs) = 229372
hello there 3!

Communicated 4 messages successfully on rpmsg-char-15-2587

TEST STATUS: PASSED

[ 1563.937837] rpmsg_ctrl virtio0.rpmsg_ctrl.0.0: TX From 0x401, To 0xe, Len 14, Flags 0, Reserved 0
[ 1563.937882] rpmsg_virtio TX: 01 04 00 00 0e 00 00 00 00 00 00 00 0e 00 00 00 ................
[ 1563.937893] rpmsg_virtio TX: 68 65 6c 6c 6f 20 74 68 65 72 65 20 30 21 hello there 0!
[ 1563.937989] virtio_rpmsg_bus virtio0: rpmsg_xmit_done
[ 1563.938008] virtio_rpmsg_bus virtio0: From: 0xe, To: 0x401, Len: 14, Flags: 0, Reserved: 1
[ 1563.938025] rpmsg_virtio RX: 0e 00 00 00 01 04 00 00 01 00 00 00 0e 00 00 00 ................
[ 1563.938036] rpmsg_virtio RX: 68 65 6c 6c 6f 20 74 68 65 72 65 20 30 21 hello there 0!
[ 1563.938062] virtio_rpmsg_bus virtio0: Received 1 messages
[ 1563.938143] rpmsg_ctrl virtio0.rpmsg_ctrl.0.0: TX From 0x401, To 0xe, Len 14, Flags 0, Reserved 0
[ 1563.938163] rpmsg_virtio TX: 01 04 00 00 0e 00 00 00 00 00 00 00 0e 00 00 00 ................
[ 1563.938173] rpmsg_virtio TX: 68 65 6c 6c 6f 20 74 68 65 72 65 20 31 21 hello there 1!
k3conf dump processor
| 208 | 48 | C7X256V0_C7XV_CORE_0 | DEVICE_STATE_ON | 1000000000 |
| 268 | 49 | C7X256V1_C7XV_CORE_0 | DEVICE_STATE_OFF | 1000000000 |

I have the original numbered firmware so we try that as well
ln -s echo/j722s-c71_1-fw j722s-c71_1-fw
echo start > /sys/class/remoteproc/remoteproc1/state
[ 2096.648948] remoteproc remoteproc1: powering up 7e200000.dsp
[ 2096.677952] remoteproc remoteproc1: Booting fw image j722s-c71_1-fw, size 2264968
[ 2096.679385] k3-dsp-rproc 7e200000.dsp: booting DSP core using boot addr = 0xa4600000
[ 2096.694201] rproc-virtio rproc-virtio.9.auto: assigned reserved memory node c7x-dma-memory@a4000000
[ 2096.694647] virtio_rpmsg_bus virtio2: buffers: va 000000005bc8ec86, dma 0x00000000a4040000
[ 2096.696085] virtio_rpmsg_bus virtio2: rpmsg host is online
[ 2096.696166] rproc-virtio rproc-virtio.9.auto: registered virtio2 (type 7)
[ 2096.696179] remoteproc remoteproc1: remote processor 7e200000.dsp is now up
[ 2096.703325] k3-dsp-rproc 7e200000.dsp: mbox msg: 0x0
[ 2096.703364] virtio_rpmsg_bus virtio2: From: 0x35, To: 0x35, Len: 40, Flags: 0, Reserved: 4
[ 2096.703385] rpmsg_virtio RX: 35 00 00 00 35 00 00 00 04 00 00 00 28 00 00 00 5...5.......(...
[ 2096.703396] rpmsg_virtio RX: 74 69 2e 69 70 63 34 2e 70 69 6e 67 2d 70 6f 6e ti.ipc4.ping-pon
[ 2096.703407] rpmsg_virtio RX: 67 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 g...............
[ 2096.703415] rpmsg_virtio RX: 0d 00 00 00 00 00 00 00 ........
[ 2096.703429] NS announcement: 74 69 2e 69 70 63 34 2e 70 69 6e 67 2d 70 6f 6e ti.ipc4.ping-pon
[ 2096.703439] NS announcement: 67 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 g...............
[ 2096.703449] NS announcement: 0d 00 00 00 00 00 00 00 ........
[ 2096.703461] virtio_rpmsg_bus virtio2: creating channel ti.ipc4.ping-pong addr 0xd
[ 2096.703714] virtio_rpmsg_bus virtio2: From: 0x35, To: 0x35, Len: 40, Flags: 0, Reserved: 4
[ 2096.703736] rpmsg_virtio RX: 35 00 00 00 35 00 00 00 04 00 00 00 28 00 00 00 5...5.......(...
[ 2096.703749] rpmsg_virtio RX: 72 70 6d 73 67 5f 63 68 72 64 65 76 00 00 00 00 rpmsg_chrdev....
[ 2096.703760] rpmsg_virtio RX: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
[ 2096.703768] rpmsg_virtio RX: 0e 00 00 00 00 00 00 00 ........
[ 2096.703804] NS announcement: 72 70 6d 73 67 5f 63 68 72 64 65 76 00 00 00 00 rpmsg_chrdev....
[ 2096.703819] NS announcement: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
[ 2096.703827] NS announcement: 0e 00 00 00 00 00 00 00 ........
[ 2096.703839] virtio_rpmsg_bus virtio2: creating channel rpmsg_chrdev addr 0xe
[ 2096.706736] virtio_rpmsg_bus virtio2: Received 2 messages
[ 2096.706802] k3-dsp-rproc 7e200000.dsp: mbox msg: 0x0
[ 2096.706812] k3-dsp-rproc 7e200000.dsp: no message was found in vqid 0

Now we have this,

ls /sys/class/rpmsg
rpmsg0 rpmsg1 rpmsg_ctrl0 rpmsg_ctrl1 rpmsg_ctrl2

ls /dev/rpmsg*
/dev/rpmsg0 /dev/rpmsg1 /dev/rpmsg2 /dev/rpmsg_ctrl0 /dev/rpmsg_ctrl1 /dev/rpmsg_ctrl2

Look at output from the dsp

cat /sys/kernel/debug/remoteproc/remoteproc1/trace0
[c75ss1] 0.001083s : [IPC RPMSG ECHO] Version: REL.MCUSDK.09.00.00.16 (Jul 3 2025 06:01:23):
[c75ss1] 0.001322s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 13 … !!!
[c75ss1] 0.001366s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 14 … !!!
for i in /sys/class/remoteproc/remoteproc*/; do      echo "=== $i ===";     cat $i/name 2>/dev/null;     cat $i/state 2>/dev/null;     echo; done
=== /sys/class/remoteproc/remoteproc0/ ===
7e000000.dsp
running

=== /sys/class/remoteproc/remoteproc1/ ===
7e200000.dsp
running

=== /sys/class/remoteproc/remoteproc2/ ===
79000000.r5f
offline

=== /sys/class/remoteproc/remoteproc3/ ===
78000000.r5f
attached

=== /sys/class/remoteproc/remoteproc4/ ===
78400000.r5f
offline
 cat /sys/kernel/debug/remoteproc/remoteproc*/trace0
[c75ss0] 0.001160s : [IPC RPMSG ECHO] Version: REL.MCUSDK.09.00.00.16 (Jul 5 2025 21:47:32):
[c75ss0] 0.005201s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 11 ... !!!
[c75ss0] 0.005237s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 12 ... !!!
[c75ss1] 0.001095s : [IPC RPMSG ECHO] Version: REL.MCUSDK.09.00.00.16 (Jul 3 2025 06:01:23):
[c75ss1] 0.071212s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 13 ... !!!
[c75ss1] 0.071261s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 14 ... !!!
[wkup-r5f0-0] 0.000990s : Sciclient direct init..... SUCCESS
[wkup-r5f0-0] 0.001775s : Sciserver Testapp Built On: Mar 19 2025 10:50:19
[wkup-r5f0-0] 0.006314s : Sciserver Version: 11.0.0-REL.MCUSDK.11.00.00.05+
[wkup-r5f0-0] 0.010946s : RM_PM_HAL Version: v11.00.09
[wkup-r5f0-0] 0.013668s : Starting Sciserver..... PASSED
[wkup-r5f0-0] 0.016607s : [IPC RPMSG ECHO] Version: REL.MCUSDK.09.00.00.16 (Mar 19 2025 10:50:35):
[wkup-r5f0-0] 21.197205s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 13 ... !!!
[wkup-r5f0-0] 21.204162s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 14 ... !!!

Note that this echo test code is AI generated. It works but needs further investigation. It is better to use the ti-rpmsg char library. Also note that #include <linux/rpmsg.h> would probably be better than #define RPMSG_CREATE_EPT_IOCTL. I aslo think RPMSG_DESTROY_EPT_IOCTL is wrong.

https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-am67a/11_00_00/exports/docs/linux/Foundational_Components_IPC_J722S.html

RPMsg char driver library stack

rpmsg_echo_test.c

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <dirent.h>
#include <sys/ioctl.h>
#include <linux/rpmsg.h>

#define SYSFS_RPMSG_PATH "/sys/class/rpmsg/"
#define RPMSG_CREATE_EPT_IOCTL _IOW(0xb5, 0x01, struct rpmsg_endpoint_info)
#define RPMSG_DESTROY_EPT_IOCTL _IO(0xb5, 0x02)

int find_rpmsg_dev_by_dst(int remote_addr, char *out_path, size_t maxlen) {
DIR *dir = opendir(SYSFS_RPMSG_PATH);
if (!dir) return -1;

struct dirent *ent;
while ((ent = readdir(dir))) {
if (strncmp(ent->d_name, "rpmsg", 5) != 0 || strstr(ent->d_name, "ctrl")) continue;

char dst_path[256];
snprintf(dst_path, sizeof(dst_path), SYSFS_RPMSG_PATH "%s/dst", ent->d_name);
FILE *f = fopen(dst_path, "r");
if (!f) continue;

int dst = -1;
fscanf(f, "%d", &dst);
fclose(f);

if (dst == remote_addr) {
snprintf(out_path, maxlen, "/dev/%s", ent->d_name);
closedir(dir);
return 0;
}
}

closedir(dir);
return -1;
}

int main(int argc, char *argv[]) {
const char *ctrl_dev = NULL;
int remote_addr = -1;
int num_msgs = 1;
int opt;

while ((opt = getopt(argc, argv, "d:p:n:")) != -1) {
switch (opt) {
case 'd': ctrl_dev = optarg; break;
case 'p': remote_addr = atoi(optarg); break;
case 'n': num_msgs = atoi(optarg); break;
default:
fprintf(stderr, "Usage: %s -d /dev/rpmsg_ctrlX -p <remote_addr> [-n <msg_count>]\n", argv[0]);
return EXIT_FAILURE;
}
}

if (!ctrl_dev || remote_addr < 0) {
fprintf(stderr, "Missing required arguments.\n");
return EXIT_FAILURE;
}

int ctrl_fd = open(ctrl_dev, O_RDWR);
if (ctrl_fd < 0) {
perror("Failed to open rpmsg ctrl device");
return EXIT_FAILURE;
}

struct rpmsg_endpoint_info eptinfo = {
.name = "rpmsg-echo",
.src = -1,
.dst = remote_addr,
};

if (ioctl(ctrl_fd, RPMSG_CREATE_EPT_IOCTL, &eptinfo) < 0) {
perror("Failed to create endpoint");
close(ctrl_fd);
return EXIT_FAILURE;
}

char ept_dev[128];
sleep(1); // give udev time to populate /dev
if (find_rpmsg_dev_by_dst(remote_addr, ept_dev, sizeof(ept_dev)) != 0) {
fprintf(stderr, "Could not find rpmsg device for dst %d\n", remote_addr);
ioctl(ctrl_fd, RPMSG_DESTROY_EPT_IOCTL);
close(ctrl_fd);
return EXIT_FAILURE;
}

int ept_fd = open(ept_dev, O_RDWR);
if (ept_fd < 0) {
perror("Failed to open endpoint device");
ioctl(ctrl_fd, RPMSG_DESTROY_EPT_IOCTL);
close(ctrl_fd);
return EXIT_FAILURE;
}

for (int i = 0; i < num_msgs; i++) {
char msg[64], reply[64];
struct timespec start, end;
clock_gettime(CLOCK_MONOTONIC, &start);
snprintf(msg, sizeof(msg), "hello DSP, msg %d", i);
if (write(ept_fd, msg, strlen(msg)) < 0) {
perror("write");
break;
}
printf("Sent: %s\n", msg);

int len = read(ept_fd, reply, sizeof(reply) - 1);
if (len > 0) {
reply[len] = '\0';
printf("Recv: %s\n", reply);
} else {
perror("read");
}
clock_gettime(CLOCK_MONOTONIC, &end);
double delta_us = (end.tv_sec - start.tv_sec) * 1e6 +
(end.tv_nsec - start.tv_nsec) / 1e3;
printf("Round-trip latency: %.2f us\n", delta_us);
}

ioctl(ctrl_fd, RPMSG_DESTROY_EPT_IOCTL);
close(ept_fd);
close(ctrl_fd);
return 0;
}

As delete endpoint does not work, this is how you cleanup stale endpoints

sudo rmmod rpmsg_char
sudo modprobe rpmsg_char
Or reboot if needed.

gcc rpmsg_echo_test.c -o rpmsg_echo_test

sudo ./rpmsg_echo_test -d /dev/rpmsg_ctrl2 -p 13 -n 3

[ 3908.193314] rpmsg_ctrl virtio2.rpmsg_ctrl.0.0: TX From 0x401, To 0xd, Len 16, Flags 0, Reserved 0
[ 3908.193357] rpmsg_virtio TX: 01 04 00 00 0d 00 00 00 00 00 00 00 10 00 00 00 ................
[ 3908.193371] rpmsg_virtio TX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 30 hello DSP, msg 0
[ 3908.193465] k3-dsp-rproc 7e200000.dsp: mbox msg: 0x1
[ 3908.193469] rpmsg_ctrl virtio2.rpmsg_ctrl.0.0: TX From 0x401, To 0xd, Len 16, Flags 0, Reserved 0
[ 3908.193485] virtio_rpmsg_bus virtio2: rpmsg_xmit_done
[ 3908.193489] rpmsg_virtio TX: 01 04 00 00 0d 00 00 00 00 00 00 00 10 00 00 00 ................
[ 3908.193493] k3-dsp-rproc 7e200000.dsp: mbox msg: 0x0
[ 3908.193501] rpmsg_virtio TX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 31 hello DSP, msg 1
[ 3908.193506] virtio_rpmsg_bus virtio2: From: 0xd, To: 0x401, Len: 16, Flags: 0, Reserved: 4
[ 3908.193537] rpmsg_virtio RX: 0d 00 00 00 01 04 00 00 04 00 00 00 10 00 00 00 ................
[ 3908.193551] rpmsg_virtio RX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 30 hello DSP, msg 0
[ 3908.193551] rpmsg_ctrl virtio2.rpmsg_ctrl.0.0: TX From 0x401, To 0xd, Len 16, Flags 0, Reserved 0
[ 3908.193568] rpmsg_virtio TX: 01 04 00 00 0d 00 00 00 00 00 00 00 10 00 00 00 ................
[ 3908.193571] virtio_rpmsg_bus virtio2: From: 0xd, To: 0x401, Len: 16, Flags: 0, Reserved: 4
[ 3908.193579] rpmsg_virtio TX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 32 hello DSP, msg 2
[ 3908.193591] rpmsg_virtio RX: 0d 00 00 00 01 04 00 00 04 00 00 00 10 00 00 00 ................
[ 3908.193609] rpmsg_virtio RX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 31 hello DSP, msg 1
[ 3908.193622] virtio_rpmsg_bus virtio2: From: 0xd, To: 0x401, Len: 16, Flags: 0, Reserved: 4
[ 3908.193637] rpmsg_virtio RX: 0d 00 00 00 01 04 00 00 04 00 00 00 10 00 00 00 ................
[ 3908.193648] rpmsg_virtio RX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 32 hello DSP, msg 2
[ 3908.193656] virtio_rpmsg_bus virtio2: msg received with no recipient
[ 3908.193664] virtio_rpmsg_bus virtio2: Received 3 messages
[ 3908.193678] k3-dsp-rproc 7e200000.dsp: mbox msg: 0x1
[ 3908.193685] virtio_rpmsg_bus virtio2: rpmsg_xmit_done
[ 3908.193691] k3-dsp-rproc 7e200000.dsp: mbox msg: 0x0
[ 3908.193699] k3-dsp-rproc 7e200000.dsp: no message was found in vqid 0
[ 3908.193705] k3-dsp-rproc 7e200000.dsp: mbox msg: 0x1
[ 3908.193713] virtio_rpmsg_bus virtio2: rpmsg_xmit_done
[ 3908.193719] k3-dsp-rproc 7e200000.dsp: mbox msg: 0x0
[ 3908.193726] k3-dsp-rproc 7e200000.dsp: no message was found in vqid 0

We can run on remoteporc 0. /rpmsg_echo_test -d /dev/rpmsg_ctrl0 -p 11 -n 3

Note that numbering of /dev/rpmsg_ctrlX depends on the order you have started them in. Warmstart(reboot) and coldstart or starting on the command-line will give

[  631.886976] rpmsg_ctrl virtio0.rpmsg_ctrl.0.0: TX From 0x401, To 0xb, Len 16, Flags 0, Reserved 0
[ 631.887021] rpmsg_virtio TX: 01 04 00 00 0b 00 00 00 00 00 00 00 10 00 00 00 ................
[ 631.887032] rpmsg_virtio TX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 30 hello DSP, msg 0
[ 631.887128] virtio_rpmsg_bus virtio0: rpmsg_xmit_done
[ 656.016588] rpmsg_ctrl virtio0.rpmsg_ctrl.0.0: TX From 0x401, To 0xb, Len 16, Flags 0, Reserved 0
[ 656.016629] rpmsg_virtio TX: 01 04 00 00 0b 00 00 00 00 00 00 00 10 00 00 00 ................
[ 656.016640] rpmsg_virtio TX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 30 hello DSP, msg 0
[ 656.016736] virtio_rpmsg_bus virtio0: rpmsg_xmit_done
[ 880.354186] rpmsg_ctrl virtio1.rpmsg_ctrl.0.0: TX From 0x401, To 0xb, Len 16, Flags 0, Reserved 0
[ 880.354226] rpmsg_virtio TX: 01 04 00 00 0b 00 00 00 00 00 00 00 10 00 00 00 ................
[ 880.354237] rpmsg_virtio TX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 30 hello DSP, msg 0
[ 880.354368] virtio_rpmsg_bus virtio1: rpmsg_xmit_done
[ 880.354389] virtio_rpmsg_bus virtio1: From: 0xb, To: 0x401, Len: 16, Flags: 0, Reserved: 3
[ 880.354407] rpmsg_virtio RX: 0b 00 00 00 01 04 00 00 03 00 00 00 10 00 00 00 ................
[ 880.354417] rpmsg_virtio RX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 30 hello DSP, msg 0
[ 880.354442] virtio_rpmsg_bus virtio1: Received 1 messages
[ 880.354492] rpmsg_ctrl virtio1.rpmsg_ctrl.0.0: TX From 0x401, To 0xb, Len 16, Flags 0, Reserved 0
[ 880.354510] rpmsg_virtio TX: 01 04 00 00 0b 00 00 00 00 00 00 00 10 00 00 00 ................
[ 880.354521] rpmsg_virtio TX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 31 hello DSP, msg 1
[ 880.354570] virtio_rpmsg_bus virtio1: rpmsg_xmit_done
[ 880.354586] virtio_rpmsg_bus virtio1: From: 0xb, To: 0x401, Len: 16, Flags: 0, Reserved: 3
[ 880.354601] rpmsg_virtio RX: 0b 00 00 00 01 04 00 00 03 00 00 00 10 00 00 00 ................
[ 880.354611] rpmsg_virtio RX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 31 hello DSP, msg 1
[ 880.354628] virtio_rpmsg_bus virtio1: Received 1 messages
[ 880.354678] rpmsg_ctrl virtio1.rpmsg_ctrl.0.0: TX From 0x401, To 0xb, Len 16, Flags 0, Reserved 0
[ 880.354697] rpmsg_virtio TX: 01 04 00 00 0b 00 00 00 00 00 00 00 10 00 00 00 ................
[ 880.354708] rpmsg_virtio TX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 32 hello DSP, msg 2
[ 880.354765] virtio_rpmsg_bus virtio1: rpmsg_xmit_done
[ 880.354781] virtio_rpmsg_bus virtio1: From: 0xb, To: 0x401, Len: 16, Flags: 0, Reserved: 3
[ 880.354798] rpmsg_virtio RX: 0b 00 00 00 01 04 00 00 03 00 00 00 10 00 00 00 ................
[ 880.354809] rpmsg_virtio RX: 68 65 6c 6c 6f 20 44 53 50 2c 20 6d 73 67 20 32 hello DSP, msg 2
[ 880.354824] virtio_rpmsg_bus virtio1: Received 1 messages

And we can see this in the tracelog

cat /sys/kernel/debug/remoteproc/remoteproc0/trace0
[c75ss0] 0.001160s : [IPC RPMSG ECHO] Version: REL.MCUSDK.09.00.00.16 (Jul 5 2025 21:47:32):
[c75ss0] 0.005201s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 11 ... !!!
[c75ss0] 0.005237s : [IPC RPMSG ECHO] Remote Core waiting for messages at end point 12 ... !!!
[c75ss0] 872.346803s : hello DSP, msg 0
[c75ss0] 872.347055s : hello DSP, msg 1
[c75ss0] 872.347241s : hello DSP, msg 2

As we can see, round-trip latency per message is around 250–270 µs

Here is the source code

This should give us the tools to create a program running on the DSP and returning the results.

--

--

No responses yet