I am trying to do remoteproc and rpmsg with i.MX 8QMax MEK Linux Binary Demo files and i.MX Yocto Project User's Guide, Rev. LF5.10.72_2.2.0, 17 December 2021.
My M4 image is come from Demo files/imx_mcore_demos/imx8qm_m4_TCM_hello_world_m40.bin &
i.MX8QM-MEK-MCUSDK/m4/boards/mekmimx8qm/multicore_examples/rpmsg_lite_str_echo_rtos/cm4_core0/armgcc/debug/rpmsg_lite_str_echo_rtos_imxcm4_m40.elf
And Linux image comming from Yocto version is 5.10.72-lts-5.10.y+ga68e31b63f86 :
$ DISTRO=fsl-imx-wayland MACHINE=imx8qmmek source imx-setup-release.sh -b build
$ bitbake imx-image-full
===============================================================================
When I power on, M4 print hello world and keep go into Linux shell..
Then I do modprobe imx_rpmsg_tty and fail
root@imx8qmmek:~# modprobe imx_rpmsg_tty
modprobe: FATAL: Module imx_rpmsg_tty not found in directory /lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86
Change M4 firmware through remotproc also fail
root@imx8qmmek:~# cd /lib/firmware/
root@imx8qmmek:/lib/firmware# echo rpmsg_lite_str_echo_rtos_imxcm4_m40.elf > /sys/class/remoteproc/remoteproc0/firmware
root@imx8qmmek:/lib/firmware# cat /sys/class/remoteproc/remoteproc0/firmware
rpmsg_lite_str_echo_rtos_imxcm4_m40.elf
root@imx8qmmek:/lib/firmware# cat /sys/class/remoteproc/remoteproc0/state
offline
root@imx8qmmek:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
[ 869.481128] remoteproc remoteproc0: powering up imx-dsp-rproc
[ 869.494189] remoteproc remoteproc0: Booting fw image rpmsg_lite_str_echo_rtos_imxcm4_m40.elf, size 512636
[ 869.544564] remoteproc remoteproc0: Registered carveout doesn't fit da request
[ 869.551943] remoteproc remoteproc0: Failed to process resources: -12
[ 869.558636] remoteproc remoteproc0: Boot failed: -12
-sh: echo: write error: Cannot allocate memory
==============================================================================
This is dts I am use showing in uboot(u-boot => printenv).
fdt_file=imx8qm-mek-rpmsg.dtb
Also I check the kernel config, it is already turn on rpmsg:
root@imx8qmmek:/lib/firmware# uname -r
5.10.72-lts-5.10.y+ga68e31b63f86
root@imx8qmmek:/lib/firmware# zcat /proc/config.gz | grep -i rpmsg
CONFIG_KEYBOARD_RPMSG=y
CONFIG_GPIO_IMX_RPMSG=y
# CONFIG_REGULATOR_PF1550_RPMSG is not set
CONFIG_SND_SOC_FSL_RPMSG=y
CONFIG_SND_SOC_IMX_AUDIO_RPMSG=y
CONFIG_SND_SOC_IMX_PCM_RPMSG=y
CONFIG_SND_SOC_IMX_RPMSG=y
CONFIG_SND_SOC_RPMSG_WM8960=y
CONFIG_SND_SOC_RPMSG_WM8960_I2C=y
CONFIG_SND_SOC_RPMSG_AK4497=y
CONFIG_RTC_DRV_IMX_RPMSG=y
# CONFIG_CROS_EC_RPMSG is not set
# Rpmsg drivers
CONFIG_RPMSG=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_CTRL=y
CONFIG_RPMSG_NS=y
CONFIG_RPMSG_QCOM_GLINK=y
CONFIG_RPMSG_QCOM_GLINK_RPM=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_HAVE_IMX_RPMSG=y
CONFIG_IMX_RPMSG_PINGPONG=m
CONFIG_IMX_RPMSG_TTY=m
# end of Rpmsg drivers
CONFIG_RPMSG_LIFE_CYCLE=y
To fix the missing imx_rpmsg_tty kernel module error :
Add this line to your layer.conf.
IMAGE_INSTALL_append = "kernel-modules"
I think kernel modules should install automatically, but now just add it and fix the problem : )
The remoteproc still falling hopefully got good news soon : (