工具与软件:
尊敬的 TI 支持团队:
请参考、我使用的是 SDKv09.02.01.10。
请提供有关如何将10KB 或5KB 数据文件从 A53内核(运行 Linux)传输到 TI AM64xx 中的 R5F 内核(运行 RTOS)的步骤。
此致、Kalyan
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具与软件:
尊敬的 TI 支持团队:
请参考、我使用的是 SDKv09.02.01.10。
请提供有关如何将10KB 或5KB 数据文件从 A53内核(运行 Linux)传输到 TI AM64xx 中的 R5F 内核(运行 RTOS)的步骤。
此致、Kalyan
您好 Kalyan:
对于此处的延迟响应、我们深表歉意。
我假设您只是想传输原始数据、而不是特定格式的文件?
请先看一下零复制示例。 请参阅以下其他主题:
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1454876/processor-sdk-am64x-am64x-how-to-solve-the-data-consistency-problem-between-r5-and-a53-shared-memory/5589138#5589138
此致、
Nick
您好 Kalyan:
我 不理解。 您希望对该固件文件执行什么操作?
R5F 固件、它将自动重置
如果要将新固件重新加载到 R5F 内核中、应使用 Linux 来平稳地关闭 R5F、并使用更新的固件重新启动它。 请参阅 AM64x Academy 中的以下页面:
https://dev.ti.com/tirex/explore/node?node=A__AdAyuKWUWVV5j4wBc7C6XA__AM64-ACADEMY__WI1KRXP__LATEST
https://dev.ti.com/tirex/explore/node?node=A__AVt2qZLTY3BgKr3D4YIv8w__AM64-ACADEMY__WI1KRXP__LATEST
R5F 内核的数据、就会发现这是一个很好的选择
您可以传输的数据量没有限制。 只要用户愿意、就可以将共享存储器区域编程为任何所需的大小。
此致、
Nick
您好、Nick。
运行./rpmsg_char_zerocopy 时、函数 rpmsg_char_open()抛出错误:"_rpmsg_char_find_ctrldev:找不到与 virtio0.rpmsg_chrdev.-1.16匹配的 rpmsg_ctrl 设备。 如果我错过了任何内容、可以告诉我吗? 此外、你能否提供任何调试步骤来确定 DMA 堆共享存储器初始化是否成功?
仅供参考、我使用了 SDKv09.02.01.10、并下载了 rpmsg_char_zerocopy ti-linux-6.1和
下载的链接::https://git.ti.com/cgit/rpmsg/rpmsg_char_zerocopy/commit/?h=ti-linux-6.1 并在定制硬件上执行。
按照自述文件中的建议、我已将 dma_buf_phys 和共享内存节点添加到 k3-am642-customevm.dts 器件树中:
{
dma_buf_phys{
compatible ="ti、dma_buf_phys";
};
保留存储器{
...
apps-shared-memory{
compatible ="dma-heap-carveout";
REG =<0x00 0xa7000000 0x00 0x02000000>;//32MB
无地图;
}; //由 Kalyan 添加 //0xa7000000-0xa8ffffff 范围。
...
};
}
错误快照:

一些调试信息:
root@am64xx-EVM:~/kalyan/fileTransfer_a53tor5f lsmod | grep rpmsg
rpmsg_ctrl 12288 0
rpmsg_char 12288 3 rpmsg_ctrl
Virtio_rpmsg_BUS 16384 0
rpmsg_ns 12288 1 virtio_rpmsg_BUS
root@am64xx-EVM:~/kalyan/fileTransfer_a53tor5f LS /dev/rpmsg *
/dev/rpmsg0 /dev/rpmsg1 /dev/rpmsg_ctrl0 /dev/rpmsg_ctrl1
root@am64xx-EVM:~/kalyan/fileTransfer_a53tor5f dmesg | grep rpmsg
[7.576762] virtio_rpmsg_BUS virtio0: rpmsg host is online.
[7.630623] virtio_rpmsg_BUS virtio1: rpmsg 主机联机
[ 7.686370] virtio_rpmsg_bus virtio1:正在创建通道 ti.ipc4.ping-pong addr 0xd
[7.686607] virtio_rpmsg_BUS virtio1: creating channel rpmsg_chrdev addr 0xe.
root@am64xx-evm:~/kalyan/fileTransfer_a53tor5f ls /dev/rpmsg
/dev/rpmsg0 /dev/rpmsg1 /dev/rpmsg_ctrl0 /dev/rpmsg_ctrl1

您好、Nick。
现在、通过使用 DMA 堆共享存储器(0xA7000000)从 A53到 R5F、我可以在一条消息中传输最大32KB 的数据。 您能否告诉我是否有任何可以更改最大大小的预定义变量? 如果是、我可以定义的最大尺寸是多少? 请参阅、它在更改 rproc ID 后开始按预期工作。
我的用例涉及使用 CAN 总线将文件从 A53传输到 STM32。 然而、R5F 使用 CAN 总线、所以我的第一步是将文件传输至 R5F、然后通过 CAN 总线将其发送至 STM32。 是否有更有效的方法可以通过 CAN 总线将固件文件从 A53传输到 STM32? 如有任何建议、我将不胜感激。 提前感谢您。
结果日志:./rpmsg_char_zerocopy -r 4 -e carveout_apps-shared-memory -t 01020304 -s 32768 -n 1. 
此致、Kalyan
您好、Nick。
您是否有机会查看以下问题? 请分享您对此的宝贵反馈。
提前感谢您。
此致、Kalyan
您好 Kalyan:
您可以期待接下来的几个回复
我将一直坚持到您能够顺利运行和修改零复制示例为止。 我不是 CAN 专家、因此稍后可能需要将您的线程重新分配给其他团队成员。
如何更改示例中的共享存储器分配
由于这只是一个示例(而不是完整的软件框架)、因此对于可以传输的数据量没有限制。 使共享存储器区域根据用例需求大小调整。
我重新编写了 Linux/README.md、以便在更新的分支中更加清晰、因此、让我在这里复制粘贴该信息、以防对您有所帮助:
* Shared memory option 1: Add a "dma-heap-reserved" reserved memory in the board devicetree (dts) file.
The TI vendor kernel tree contains additional support for reserving
contiguous memory blocks for use with DMA-heaps. This might be required
for cases where we can't use the CMA reserved range in the MCU application,
or the application requires a specific memory range. The reserved heap
range can be enabled my adding a new "dma-heap-reserved" compatible
node under the "reserved-memory" node. The memory range defined by the
new entry must not conflict with other reserved memory ranges.
Example:
Add a new 32MB range named "apps-shared-memory" at 0xa6000000.
```
reserved-memory {
...
apps-shared-memory {
compatible = "dma-heap-carveout";
reg = <0x00 0xa6000000 0x00 0x2000000>;
no-map;
};
...
}
```
In this example, the new DMA-heap name ("apps-shared-memory") can be used with
the "-e" parameter to change the default allocation from the "reserved" DMA-heap
range to the 0xa6000000-0xa7ffffff range.
* Shared memory option 2: Use the CMA heap
Some EVM devicetree files have a reserved memory entry for CMA
(`linux,cma-default`), while others do not. If the dts file for your EVM board
does not reserve a memory entry for CMA, you can still reserve a range for CMA
by using the `cma` kernel command line parameter. For example, running these
commands in uboot would reserve a 256MB memory region for CMA, starting from
0xC000_0000:
```
=> env set optargs cma=256M@3G
=> boot
```
然后、您可以在自述文件的下方看到使用 CMA 堆与 devicetre 存储器区域分割的不同示例。 这部分在两个分支上是相同的:
## Examples - Test zerocopy buffer update between M4F core (id=9) and Linux with 128KB buffer, allocated on the cma-reserved dma-heap, with the default pattern (0xaaaa5555): ``` # ./rpmsg_char_zerocopy -r 9 -s 128 ``` - Test the zerocopy buffer update between M4F core (id=9) and Linux with default buffer size (1MB) allocated on carveout dma-heap named "apps-shared-memory", with the default pattern: ``` # ./rpmsg_char_zerocopy -r 9 -e apps-shared-memory
对 CAN 问题有什么初步想法?
R5F 是否使用 CAN 与 STM32进行其他数据传输? 或者、该 CAN 是否仅使用一次、用于将固件写入 STM32?
此致、
Nick