We’ve been trying to communicate with the M4F on the SOC over the rpmsg. We’ve already enabled the appropritate overlay (verdin-am62_hmp_overlay.dts). But there is no /dev/rpmsg_tty to communicate though.
The description here RPMsg TTY Example says that you have to load the module like: modprobe imx_rpmsg_tty. But there is no module to load since its a different processor.
torizon@verdin-am62-15207085:~$ zcat /proc/config.gz | grep -i config_rpmsg
# CONFIG_RPMSG_TTY is not set
CONFIG_RPMSG=y
CONFIG_RPMSG_CHAR=m
CONFIG_RPMSG_CTRL=m
CONFIG_RPMSG_NS=m
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set
CONFIG_RPMSG_VIRTIO=m
CONFIG_RPMSG_PRU=m
CONFIG_RPMSG_KDRV=y
# CONFIG_RPMSG_KDRV_DEMO is not set
# CONFIG_RPMSG_KDRV_DISPLAY is not set
CONFIG_RPMSG_KDRV_ETH_SWITCH=y
Ti refers to the auxiliary cores of its SoC as Programmable Realtime Unit (PRU). The character devices show up as /dev/rpmsg_pruN.
Devices /dev/rmpsg_tty are created by the imx_rpmsg_tty` driver which does not apply for TI AM62. The rpmsg_pru driver was never upstreamed, hence CONFIG_RPMSG_PRU does not apply to a standard kernel.
Yes, you will need a DT overlay with the memory carveouts for the PRU. Typically something like this:
Of course the memory carveouts have to match with the M4 core external memory section sizes in their linker mapfiles.
The device will not show up unless the M4 core is running and has an endpoint established.
For kernel config you also need: CONFIG_PRU_REMOTEPROC
I would recommend that you use Torizon OS 6.6.1 or newer when using the Cortex-M4 in the Verdin AM62.
The reason for this is that the overlay verdin-am62_hmp_overlay.dts was only officially introduced on BSP 6.6, therefore previous versions may not work with it.
The overlay is also included by default with the Torizon OS 6.6.1 release.
In this overlay, some necessary reserved memory areas are defined, as @RudolfStreif mentioned, and the required mailbox is setup.
This example is not applicable to the Verdin AM62, as it contains quite a lot of NXP-specific information and code.
Also, as you saw in the kernel configuration, the generic driver for RPMSG tty is not enabled on Torizon OS.
If this ends up being a requirement for your project, we can evaluate enabling it by default.
The topic of development for the Cortex-M4 of the Verdin AM62 is still unfortunately not documented on our side.
My recommendation is that you look at the TI documentation on the topic.
The following discussion also went over many of the early problems that can be encountered while trying to work with the AM62’s M4 core: Boot MCU from U-Boot on AM62X
thank you for the answer. I will look into the links you have given.
And I will also update to the newest Torizon OS release, even though the the memory reservation seems to work with the older version.
… this would be the best for our project. How long will this may take? The sources for this seem to be already in there!? (see rpmsg_tty.c)
If it really is just a configuration change with the driver already available, it usually takes just a few days for it to be added to a nightly Torizon OS image.
I will put a request for this configuration change and the Torizon OS team will evaluate it. When we have updates, I will send them on this thread.
One more question:
Are there any release notes for the Torizon OS Nightly and Monthly Releases (like for the Quarterly here for Torizon OS 6.6.1 Quarterly Release)? So we can track when this change is moving to the next release instance.
There are no release notes for the Monthly or Nightly releases.
Configuration changes are usually available on the next Monthlies and subsequent releases.
Information about this and other topics is publicly available on the Torizon OS issue tracker.
There is some delay on the publishing of the issue trackers, so the CONFIG_RPMSG_TTY change is not published yet.
Hello @bruno.tx,
we’ve tested the Nightly Build Verdin AM62 - 6.7.0-devel-20240507+build.564. It works like expected
The communication between the M4 co-processor and the Linux userspace can be done via /dev/ttyRPMSG0 if the firmware in the M4 enables the device. Thank you again!
Looking forward for this change moving to the Quarterly release