Support of rpmsg in TorizonCore on Verdin iMX8MP

Hi @MadDoc,

Sorry for the delay, it took me a while to debug what was going on and I have some points to share with you. Please let me know if you have any questions.

This is my setup, it’s using TorizonCore 6.1.0-devel-202212-build.4 as you mentioned:

torizon@verdin-imx8mp-07174398:~$ sudo tdx-info
Password:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.77-6.1.0-devel+git.a8d2c55c6ae7 #1-TorizonCore SMP PREEMPT Wed Nov 30 08:37:42 UTC 2022
Kernel command line:      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/f1353018bbd86b36fe524851f42350278b14e7160971752d450fc53ac0c43b90/0
Distro name:              NAME="TorizonCore"
Distro version:           VERSION_ID=6.1.0-devel-202212-build.4
Hostname:                 verdin-imx8mp-07174398
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.0D
Serial number:            07174398
Processor arch:           aarch64
------------------------------------------------------------

First, I updated the overlay source code a little bit to disable some peripherals on the Linux part that might cause some issues. Please, download the source code and the compiled DTBO here: Download - Toradex File Sharing Platform.

Next, u-boot is crashing as you mentioned because apparently the FDT relocation is disabled by default by NXP. To correct that, run the following command in your u-boot terminal:

> setenv fdt_high 0xffffffffffffffff
> saveenv
> reset

This will fix the issue you’re seeing.

Then, enable the overlay that I’ve sent. Mine looks like this:

torizon@verdin-imx8mp-07174398:~$ cat /boot/ostree/torizon-f1353018bbd86b36fe524851f42350278b14e7160971752d450fc53ac0c43b90/dtb/overlays.txt
fdt_overlays=verdin-imx8mp_hdmi_overlay.dtbo verdin-imx8mp_dsi-to-hdmi_overlay.dtbo verdin-imx8mp_spidev_overlay.dtbo verdin-imx8mp_hmp_overlay.dtbo

Now, after rebooting your board, the overlay should load fine.
In order to load your HMP binary, please run the following commands:

> ext4load mmc 2:1 ${loadaddr} /ostree/deploy/torizon/var/hello_world.bin
8292 bytes read in 3 ms (2.6 MiB/s)
> cp.b ${loadaddr} 0x7e0000 10000
> dcache flush
> bootaux 0x7e0000
## Starting auxiliary core stack = 0x20020000, pc = 0x0000048D...

Please note that my binary is inside /var/ on TorizonCore and the MMC partition you should look into is 2:1. I’m also using the TCM memory 0x7e0000. The partition changed for TorizonCore 6, I will update the article How to load compiled binaries into Cortex-M | Toradex Developer Center to fix that.

Now, the HMP should work. I tested the hello world and RPMSG demos.

RPMSG String Echo FreeRTOS RTOS API Demo...

Nameservice sent, ready for incoming messages...
Get Message From Master Side : "hello world!" [len : 12]
Get Message From Master Side : "hiago" [len : 5]
Get New Line From Master Side

I noticed a bug inside the Remote Proc framework. Sometimes it works, and sometimes it crashes the kernel. I’m not sure why this is happening right now, I opened a ticket internally so we can take a look into that.

For now, please use the bootaux (u-boot) instead of the Remote Proc.

Thanks for your patience. Please note that we’re still developing our documentation and tests regarding the HMP. Any feedback is appreciated.

Let me know if you need anything else.

Best Regards,
Hiago.