Skip to content

Xilinx EDF: rpmsg endpoint freeze in FreeRTOS in code, based on legacy echo example #103

@snikulov

Description

@snikulov

Hello, everyone.

I'm trying to implement some communication task in freertos based on echo example.

Linux amd-edf 6.12.40-xilinx-g31626ef92ff1 #1 SMP Fri Nov 7 15:28:23 UTC 2025 aarch64 GNU/Linux
RPU0 FreeRTOS 10 with simple task which is trying to initialize endpoint

and log with xil_printf

root@amd-edf:~# ./runfw.sh 
[   20.711476] remoteproc remoteproc0: powering up ffe00000.r5f
[   20.776540] remoteproc remoteproc0: Booting fw image main.r5.elf, size 5300268
[   20.796984] virtio_rpmsg_bus virtio0: rpmsg host is online
Xil_SetMPURegion buff=0x405803E8 sz=0x1000 returned 0
xil: main started trace buff=0x405803E8 sz=0x1000
[   20.809778] rproc-virtio rproc-virtio.1.auto: registered virtio0 (type 7)
[   20.816612] remoteproc remoteproc0: remote processor ffe00000.r5f is now up
root@amd-edf:~# Success hw init
RPU0: registered generic bus
RPU0: kick device irq id = 65
RPU0: sys interrupt 33 config success
RPU0: Initialize remoteproc successfully.
RPU0: platform init success
FreeRTOS Version: 10.6.1
openamp lib version: 1.7.0
libmetal lib version: 1.7.0
Starting application...
metal log level: 7
entering: platform_create_rpmsg_vdev
rproc table:
version: 1
num entries: 2
vring0 da: 0x42000000
vring1 da: 0x42004000
get resource table: 
version: 1
num entries: 2
vring0 da: 0x42000000
vring1 da: 0x42004000
get resource table after restore: 
version: 1
num entries: 2
vring0 da: 0x42000000
vring1 da: 0x42004000
RPU0: creating remoteproc virtio
RPU0: initializing rpmsg shared buffer pool
RPU0: initializing rpmsg vdev
RPU0: initializing rpmsg vdev
vdev created
entering create endpoint

Here the RPU0 stop output logs after the call

	ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME,
			       RPMSG_ADDR_ANY, RPMSG_ADDR_ANY,
			       rpmsg_endpoint_cb,
			       rpmsg_service_unbind);

After some debugging with JTAG/xil_printf I'v found that on creation endpoint framework should sent NS message to host and here I receive an error

virtqueue_get_available_buffer exit: vq_available = 256 return nullptr

All platform_init code is picked up from latest legacy_examples except some difference in virtio/buff memory address configurations

  • Could you please suggest common strategy to analyze such issues?
  • Is any common issue related to memory configuration I should check?
  • Maybe some mis-configuration in examples?

here is some log on bus before and after run RPU 0 firmware

root@amd-edf:~# tree /sys/bus/rpmsg/
/sys/bus/rpmsg/
|-- devices
|-- drivers
|   |-- rpmsg_ns
|   |   |-- bind
|   |   |-- uevent
|   |   `-- unbind
|   `-- rpmsg_tty
|       |-- bind
|       |-- uevent
|       `-- unbind
|-- drivers_autoprobe
|-- drivers_probe
`-- uevent

5 directories, 9 files
root@amd-edf:~# ./runfw.sh 
[   44.787674] remoteproc remoteproc0: powering up ffe00000.r5f
[   44.852553] remoteproc remoteproc0: Booting fw image main.r5.elf, size 5300268
[   44.875664] virtio_rpmsg_bus virtio0: rpmsg host is online
Xil_SetMPURegion for buff=0x405803E8 sz=0x1000 returned 0
xil: main started trace buff=0x405803E8 sz=0x1000
[   44.888450] rproc-virtio rproc-virtio.1.auto: registered virtio0 (type 7)
[   44.895281] remoteproc remoteproc0: remote processor ffe00000.r5f is now up
root@amd-edf:~# Success hw init
RPU0: registered generic bus
RPU0: kick device irq id = 65
RPU0: sys interrupt 33 config success
RPU0: Initialize remoteproc successfully.
RPU0: platform init success
FreeRTOS Version: 10.6.1
openamp lib version: 1.7.0
libmetal lib version: 1.7.0
Starting application...
metal log level: 7
entering: platform_create_rpmsg_vdev
rproc table:
version: 1
num entries: 2
vring0 da: 42000000
vring1 da: 42004000
get resource table: 
version: 1
num entries: 2
vring0 da: 42000000
vring1 da: 42004000
get resource table after restore: 
version: 1
num entries: 2
vring0 da: 42000000
vring1 da: 42004000
RPU0: creating remoteproc virtio
RPU0: initializing rpmsg shared buffer pool
RPU0: initializing rpmsg vdev
RPU0: initializing rpmsg vdev
vdev created
entering create endpoint

root@amd-edf:~# tree /sys/bus/rpmsg/
/sys/bus/rpmsg/
|-- devices
|   |-- virtio0.rpmsg_ctrl.0.0 -> ../../../devices/platform/remoteproc-split@ffe00000/ffe00000.r5f/remoteproc/remoteproc0/rproc-virtio.1.auto/virtio0/virtio0.rpmsg_ctrl.0.0
|   `-- virtio0.rpmsg_ns.53.53 -> ../../../devices/platform/remoteproc-split@ffe00000/ffe00000.r5f/remoteproc/remoteproc0/rproc-virtio.1.auto/virtio0/virtio0.rpmsg_ns.53.53
|-- drivers
|   |-- rpmsg_chrdev
|   |   |-- bind
|   |   |-- module -> ../../../../module/rpmsg_char
|   |   |-- uevent
|   |   `-- unbind
|   |-- rpmsg_ctrl
|   |   |-- bind
|   |   |-- module -> ../../../../module/rpmsg_ctrl
|   |   |-- uevent
|   |   |-- unbind
|   |   `-- virtio0.rpmsg_ctrl.0.0 -> ../../../../devices/platform/remoteproc-split@ffe00000/ffe00000.r5f/remoteproc/remoteproc0/rproc-virtio.1.auto/virtio0/virtio0.rpmsg_ctrl.0.0
|   |-- rpmsg_ns
|   |   |-- bind
|   |   |-- uevent
|   |   |-- unbind
|   |   `-- virtio0.rpmsg_ns.53.53 -> ../../../../devices/platform/remoteproc-split@ffe00000/ffe00000.r5f/remoteproc/remoteproc0/rproc-virtio.1.auto/virtio0/virtio0.rpmsg_ns.53.53
|   `-- rpmsg_tty
|       |-- bind
|       |-- uevent
|       `-- unbind
|-- drivers_autoprobe
|-- drivers_probe
`-- uevent

13 directories, 15 files
root@amd-edf:~# 

device tree is

╰─$ cat memory.dtsi 
/ {
        reserved-memory {
                #address-cells = <2>;
                #size-cells = <2>;
                ranges;

                /* Firmware elf file */
                rproc_0_fw_image: memory@40000000 {
                        no-map;
                        reg = <0x0 0x40000000 0x0 0x2000000>;
                };

                /* vring0: RING_TX */
                vdev0vring0: vdev0vring0@42000000 {
                        no-map;
                        reg = <0x0 0x42000000 0x0 0x4000>; /* 16 KB, up to 0x42004000 */
                };

                /* vring1: RING_RX */
                vdev0vring1: vdev0vring1@42004000 {
                        no-map;
                        reg = <0x0 0x42004000 0x0 0x4000>; /* 16 KB, up to 0x42008000 */
                };

                /* OpenAMP buffer */
                rpu0vdev0buffer: rpu0vdev0buffer@42008000 {
                        no-map;
                        reg = <0x0 0x42008000 0x0 0x100000>; /* 1 MB, up to 0x42108000 */
                };

                rproc_1_fw_image: memory@50000000 {
                        no-map;
                        reg = <0x0 0x50000000 0x0 0x2000000>;
                };
        };

};

╰─$ cat remoteproc.dtsi 
/ {
        compatible = "xlnx,zynqmp";
        #address-cells = <2>;
        #size-cells = <2>;

        axi {
                /* IPI channel 7 device */
                ipi_amp: ipi@ff340000 {
                        compatible = "ipi_uio";
                        reg = <0x0 0xff340000 0x0 0x1000>; /* IPI7 base address */
                        interrupt-parent = <&gic>;
                        interrupts = <0 29 4>; /* Add 32 to get real interrupt line number, i.e. 61 */
                };
        };

        rproc_split: remoteproc-split@ffe00000 {
                status = "okay";
                compatible = "xlnx,zynqmp-r5fss";
                xlnx,cluster-mode = <0>;
                xlnx,tcm-mode = <0>;

                #address-cells = <2>;
                #size-cells = <2>;

                ranges = <0x0 0x0 0x0 0xffe00000 0x0 0x10000>,
                         <0x0 0x20000 0x0 0xffe20000 0x0 0x10000>,
                         <0x1 0x0 0x0 0xffe90000 0x0 0x10000>,
                         <0x1 0x20000 0x0 0xffeb0000 0x0 0x10000>;

                r5f@0 {
                        compatible = "xlnx,zynqmp-r5f";
                        reg = <0x0 0x0 0x0 0x10000>, <0x0 0x20000 0x0 0x10000>;
                        reg-names = "atcm0", "btcm0";
                        power-domains = <&zynqmp_firmware 7>,       /* PD_RPU_0     */
                                        <&zynqmp_firmware 15>,      /* PD_R5_0_ATCM */
                                        <&zynqmp_firmware 16>;      /* PD_R5_0_BTCM */
                        memory-region = <&rproc_0_fw_image>, <&vdev0vring0>, <&vdev0vring1>, <&rpu0vdev0buffer>;

                        /* channel 0 mboxes */
                        mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
                        mbox-names = "tx", "rx";
                };

                r5f@1 {
                        compatible = "xlnx,zynqmp-r5f";
                        reg = <0x1 0x0 0x0 0x10000>, <0x1 0x20000 0x0 0x10000>;
                        reg-names = "atcm0", "btcm0";
                        power-domains = <&zynqmp_firmware 8>,      /* PD_RPU_1 */
                                        <&zynqmp_firmware 17>,     /* PD_R5_1_ATCM */
                                        <&zynqmp_firmware 18>;     /* PD_R5_1_BTCM */
                        memory-region = <&rproc_1_fw_image>;

                };
        };

    /* 1. Standard IPI Mailbox for APU (IPI 0) */
    zynqmp_ipi_0 {
        compatible = "xlnx,zynqmp-ipi-mailbox";
        interrupt-parent = <&gic>;
        interrupts = <0 35 4>;        /* GIC IRQ 67 (IPI 0) */
        reg = <0x0 0xff300000 0x0 0x20>;
        xlnx,ipi-id = <0>;            /* Linux is IPI 0 */
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;

        /* APU-to-RPU0 Channel */
        ipi_mailbox_rpu0: mailbox@ff990400 {
            reg = <0xff990400 0x20>,  /* local_request_region */
                  <0xff990420 0x20>,  /* local_response_region */
                  <0xff990440 0x20>,  /* remote_request_region */
                  <0xff990460 0x20>;  /* remote_response_region */
            reg-names = "local_request_region", "local_response_region",
                        "remote_request_region", "remote_response_region";
            #mbox-cells = <1>;
            xlnx,ipi-id = <1>;        /* Remote target is RPU0 (IPI 1) */
        };
    };

};

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions