Following on from this thread, I would like to implement an RPMSG communication from the M4 to the Linux userspace and back.
/dev/rpmsg_cntrl0 … 3 are present
On Linux side:
I understand the approach in such a way that via the /dev/rpmsg_ctrlX
and ioctl(fd, RPMSG_CREATE_EPT_IOCTL, &ept)
a new endpoint is created.
this then appears e.g. as /dev/rpmsg0
if I use /dev/rpmsg_ctrl0
I should then be able to read and write to /dev/rpmsg0
.
When I call:
fd = open("/dev/rpmsg_ctrl0", O_RDWR);
I get a:
‘-1’ for all 4 control devices (access denied … ?)
I think there is something fundamentally wrong.
The TTY example works on the M4 side, which creates / wants to create an endpoint itself.
The /dev/ttyRPMSG31 is not created because the rpmsg_tty kernel module is not present.
(See LOCAL_EPT_ADDR is 30 or 31 … M40 or M41)
At least the M4 program overcomes the code:
while (0 == rpmsg_lite_is_link_up(my_rpmsg))
;
because the message:
PRINTF("\r\nNameservice sent, ready for incoming messages...\r\n");
appears on the serial debug output.
First I need to know why I can’t access /dev/rpmsg_ctrlX from a docker container as described here:
application-development
Maybe the solution is very simple?
Best regards
additionally
on the apalis module in the torizon home directory: /var/rootdirs/home/torizon
created a folder named ‘rpmsg_char_dev’. included is a file called ‘rpmsg_char_dev’… what for?
Here are some printouts of my surroundings
root@apalis-imx8-07201831:/var/rootdirs/home/torizon# ls -la /dev/rpm*
crw------- 1 root root 511, 0 Apr 28 2022 /dev/rpmsg_ctrl0
crw------- 1 root root 511, 1 Apr 28 2022 /dev/rpmsg_ctrl1
crw------- 1 root root 511, 2 Apr 28 2022 /dev/rpmsg_ctrl2
crw------- 1 root root 511, 3 Apr 28 2022 /dev/rpmsg_ctrl3
Software summary
------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 5.15.77-6.2.0+git.aa0ff7e3554e #1-TorizonCore SMP PREEMPT Wed Mar 29 15:33:40 UTC 2023
Kernel command line: pci=nomsi root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/fde04e5dc537e7d0fb52b2b3582fcf35a6a4c9a662edf9914167a2bada0feb30/0
Distro name: NAME="TorizonCore"
Distro version: VERSION_ID=6.2.0-build.2
Hostname: apalis-imx8-07201831
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model: Toradex Apalis iMX8QM V1.1 on Apalis Ixora V1.2 Carrier Board
Toradex version: 0037 V1.1E
Serial number: 07201831
Processor arch: aarch64
------------------------------------------------------------
root@apalis-imx8-07201831:/var/rootdirs/home/torizon# dmesg | grep rpmsg
[ 0.083998] imx rpmsg driver is registered.
[ 1.430106] imx-rpmsg 90000000.rpmsg0: assigned reserved memory node vdevbuffer@90400000
[ 1.466745] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 1.496753] virtio_rpmsg_bus virtio1: rpmsg host is online
[ 1.497274] imx-rpmsg 90100000.rpmsg1: assigned reserved memory node vdevbuffer@90400000
[ 1.498083] virtio_rpmsg_bus virtio2: rpmsg host is online
[ 1.498911] virtio_rpmsg_bus virtio3: rpmsg host is online
[ 1.498940] virtio_rpmsg_bus virtio3: creating channel rpmsg-virtual-tty-channel-1 addr 0x1f
[ 1.500965] virtio_rpmsg_bus virtio2: creating channel rpmsg-i2c-channel addr 0x1
[ 1.501139] i2c-rpmsg virtio2.rpmsg-i2c-channel.-1.1: new channel: 0x400 -> 0x1!