RPMsg_Kernel_Client_Application

本文档详细介绍了如何构建和运行RPMsg Linux内核客户端,以便与从属处理器(如DSP、IPU等)通过RPMess模块进行通信。文中提供了针对Linux客户端和SYS/BIOS从属应用的构建步骤,并指导了如何加载和运行这些应用程序。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://processors.wiki.ti.com/index.php/RPMsg_Kernel_Client_Application

Introduction

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

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

Build

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

Linux client app

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 

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

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

Slave-side app

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值