More AMP on the i.MX8M Mini with Rpmsg

In a recent post, I described the basics to execute code on the Cortex M4 micro controller inside the i.MX8M Mini SoC. However there was no communication going on between Linux on the Cortex A cores and the application running on the M4. In this post, I will look at an example using the remoteproc and rpmsg (Remote Processor Messaging) frameworks for communication between the processors. The remoteproc subsystem implements basic house keeping for co-processors in Linux and the rpmsg framework implements the actual data channels.
Loading the M4 application from Linux
root@imx8mm-lpddr4-evk:/lib/firmware# ls
LICENCE.broadcom_bcm43xx imx8mm_m4_TCM_low_power_wakeword.elf regulatory.db.p7s
LICENCE.cypress imx8mm_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.elf tee-header_v2.bin
LICENSE.QualcommAtheros_ath10k imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.elf tee-pageable_v2.bin
ath10k imx8mm_m4_TCM_sai_low_power_audio.elf tee-pager_v2.bin
brcm imx8mm_m4_TCM_sai_low_power_audio_wm8524.elf tee-raw.bin
cypress jailhouse.bin tee.bin
imx nxp tee.elf
imx8mm_m4_TCM_hello_world.elf regulatory.db
root@imx8mm-lpddr4-evk:/lib/firmware# echo -n imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.elf > /sys/class/remoteproc/remoteproc0/firmware
root@imx8mm-lpddr4-evk:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
[ 356.002770] remoteproc remoteproc0: powering up imx-rproc
[ 356.017406] remoteproc remoteproc0: Booting fw image imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.elf, size 158184
[ 356.028562] pwm-backlight backlight: supply power not found, using dummy regulator
[ 356.040928] imx-audio-rpmsg imx-audio-rpmsg.1.auto: no reserved DMA memory
[ 356.546554] rproc-virtio rproc-virtio.2.auto: assigned reserved memory node vdevbuffer@b8400000
[ 356.555862] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 356.555883] virtio_rpmsg_bus virtio0: creating channel rpmsg-virtual-tty-channel-1 addr 0x1e
[ 356.556455] pwm-backlight backlight: supply power not found, using dummy regulator
[ 356.560300] imx-audio-rpmsg imx-audio-rpmsg.1.auto: no reserved DMA memory
[ 356.561512] rproc-virtio rproc-virtio.2.auto: registered virtio0 (type 7)
[ 356.561809] pwm-backlight backlight: supply power not found, using dummy regulator
[ 356.567943] imx-audio-rpmsg imx-audio-rpmsg.1.auto: no reserved DMA memory
[ 356.592049] pwm-backlight backlight: supply power not found, using dummy regulator
[ 356.598800] remoteproc remoteproc0: remote processor imx-rproc is now up
[ 356.623367] imx-audio-rpmsg imx-audio-rpmsg.1.auto: no reserved DMA memory
root@imx8mm-lpddr4-evk:/lib/firmware#
root@imx8mm-lpddr4-evk:/lib/firmware# ls /dev/ttyR*
ls: cannot access '/dev/ttyR*': No such file or directory
root@imx8mm-lpddr4-evk:/lib/firmware# modprobe imx_rpmsg_tty
[ 556.923414] imx_rpmsg_tty virtio0.rpmsg-virtual-tty-channel-1.-1.30: new channel: 0x400 -> 0x1e!
[ 556.932806] Install rpmsg tty driver!
[ 556.938215] pwm-backlight backlight: supply power not found, using dummy regulator
[ 556.949840] imx-audio-rpmsg imx-audio-rpmsg.1.auto: no reserved DMA memory
root@imx8mm-lpddr4-evk:/lib/firmware# ls /dev/ttyR*
/dev/ttyRPMSG30
root@imx8mm-lpddr4-evk:/lib/firmware#
Before running the application, let's take a look at the source code.
We can find it in the MCUXpresso SDK checked out via west in the
previous post. The sample is below
examples/evkmimx8mm/multicore_examples/rpmsg_lite_pingpong_rtos/linux_remote
and the main function is contained in main_remote.c . For
completeness, this is the whole source file, but we can concentrate on
the function app_task and keep in mind that the pre-processor
symbol RPMSG_LITE_MASTER_IS_LINUX is defined but MCUMGR_USED
isn't. We also need to remember that this application is using the
Kommentare
Comments powered by Disqus