NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

RPMsg Kernel Client Application

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]

The page illustrates how to build and run an rpmsg Linux kernel space client to communicate with a slave processor (e.g. DSP, IPU, etc) using IPC's RPMessage module.

Generally it is recommended to perform core-to-core communication from user space, typically using MessageQ. User space is a more application-friendly environment without GPL constraints, and with fewer compatibility breaks between kernel releases. But some use cases may require kernel space IPC, so this article describes how that can be done.

Requirements[edit]

  • IPC 3.10.02 or greater
  • Linux Kernel with rpmsg and Remoteproc features enabled

Build[edit]

This section outlines how to build both the Linux kernel rpmsg client and corresponding RPMessage slave-side application.

Linux client app[edit]

Recent Linux kernel releases contain an rpmsg client sample that can be built as a module. As of Linux kernel version 3.11 or less, the rpmsg client sample build is broken and requires some manual steps to build.

The Linux-side sample module is located in the samples/rpmsg directory of the Linux kernel sources.

Edit the Makefile in the samples/rpmsg directory to include only the following line:

obj-m := rpmsg_client_sample.o

NOTE: The $(CONFIG_SAMPLE_RPMSG_CLIENT) string was replaced with m in the Makefile.

Issue the following command to build the application as a module. Replace the variables below to the appropriate location of the Linux kernel sources and the ARM's cross-compiler tools.

make -C $(KERNEL_INSTALL_DIR) M=$(KERNEL_INSTALL_DIR)/samples/rpmsg ARCH=arm CROSS_COMPILE=$(TOOLCHAIN_INSTALL_DIR)/bin/arm-none-linux-gnueabi- modules

This results with an rpmsg_client_sample.ko file located in the samples/rpmsg directory of your Linux kernel. Copy the file to your device’s file-system.

SYS/BIOS slave app[edit]

The IPC distribution contains a corresponding RPMessage based slave application. Follow the IPC Install Guide for building the SYS/BIOS-side of IPC appropriate for your device. Once the build completes, navigate to the $(IPC_INSTALL_DIR)/packages/ti/ipc/tests/bin/<PLATFORM> directory. There you will find an ping_tasks.x<suffix> file. Copy the file to your device's file-system.

Run[edit]

This section outlines how to load and run the previous built applications.

Slave-side app[edit]

The Linux kernel's remoteproc features are used to load the slave core(s). The slave core binary(s) must be copied into the /lib/firmware directory of your device's file-system and renamed appropriately for the target device.

For DRA7XX, the files should be as follows:

dra7-dsp1-fw.xe66
dra7-dsp2-fw.xe66
dra7-ipu1-fw.xem4
dra7-ipu2-fw.xem4

Execute the following to load the slave core(s) on your target's file-system.

target# modprobe remoteproc
target# modprobe omap_remoteproc

The slave-core application(s) are now loaded.

Linux-side app[edit]

The Linux kernel's rpmsg driver must be installed onto the running kernel assuming the driver has been built as the kernel module. To install in, execute the following on the target.

target# modprobe rpmsg_proto

The rpmsg client application is implemented as a kernel module. It's written to send/receive 100 messages from the slave core(s). To run the rpmsg client module, execute the following on the target.

 target# modprobe rpmsg_client_sample

or

target# insmod rpmsg_client_sample.ko

The output should resemble the following:

rpmsg_client_sample rpmsg0: new channel: 0x400 -> 0x32!
rpmsg_client_sample rpmsg1: new channel: 0x401 -> 0x33!
rpmsg_client_sample rpmsg0: incoming msg 1 (src: 0x32)
rpmsg_client_sample rpmsg0: incoming msg 2 (src: 0x32)
rpmsg_client_sample rpmsg0: incoming msg 3 (src: 0x32)
.
.
.

To re-run the application, the module needs to be removed and re-installed (repeat step above).

 target# modprobe -r rpmsg_client_sample

or

target# rmmod rpmsg_client_sample
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article RPMsg Kernel Client Application here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article RPMsg Kernel Client Application here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article RPMsg Kernel Client Application here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article RPMsg Kernel Client Application here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article RPMsg Kernel Client Application here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article RPMsg Kernel Client Application here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article RPMsg Kernel Client Application here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article RPMsg Kernel Client Application here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article RPMsg Kernel Client Application here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity