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.

[参考译文] AM623:AM623、SDK11.02.08.02 如何动态替换在 R5f 内核上运行的程序?

Guru**** 2873830 points

Other Parts Discussed in Thread: AM623

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1631838/am623-am623-sdk11-02-08-02-how-is-the-program-running-on-the-r5f-core-dynamically-replaced

器件型号: AM623

AM623、SDK 11.02.08.02 是如何动态替换 R5f 内核上运行的程序。 我在 CCS 上编译了一个名为“hello_world_am62x-sk_r5fss0-0_freertos_ti-arm-clang.out 的程序。
将 Remoteproc 驱动程序添加到内核时、可以看到:
[  7.530526]平台 78000000.r5f:R5F 内核可能已由不同的主机上电、编程状态 (0)!=实际状态 (1)
[  7.530717] platform 78000000.r5f:将 R5F 配置为仅 IPC 模式
[  7.530925] platform 78000000.r5f:分配了保留的内存节点 r5f-dma-memory@9da00000
[7.542474]  可提供 Remoteproc remoteproc1: 78000000.r5f
[7.542598]  Remoteproc Remoteproc1:连接到 78000000.r5f
[  7.543190] rproc-virtio rproc-virtio.3.auto:分配了保留的内存节点 r5f-dma-memory@9da00000
[7.5497884]  远程处理器 remoteproc 1:远程处理器 78000000.r5f 现已连接

Root@am62xx-EVM:~# ls /sys/class/remoteproc /-al
总计 0
drwxr-xr-x 2 根根 0 Mar 31 08:32。
drwxr-xr-x 76 根根 0 2025年5月29日 ..
lrwxrwx 1 根根 0 3 月 31 日 07:39 remoteproc0 ->./../devices/platform/bus@f0000/bus@f0000:bus@4000000/5000000.m4fss/remoteproc/remoteproc0
lrwxrwxrwx 1 根根根 0 3 月 31 日 03:18 remoteproc1 ->./../devices/platform/bus@f0000/bus@f0000:bus@b00000/bus@f0000:bus@b00000:r5fss@78000000/78000000.r5f/remoteproc/remoteproc1
lrwxrwx 1 根根根 0 3 月 31 日 07:39 remoteproc2 ->./../devices/platform/bus@f0000/30040000.pruss/30074000.pru/remoteproc/remoteproc2
lrwxrwx 1 根根根 0 3 月 31 日 07:39 remoteproc3 ->./../devices/platform/bus@f0000/30040000.pruss/30078000.pru/remoteproc/remoteproc3.

我执行了以下命令:

root@am62xx-EVM:~# cat /sys/class/remoteproc/remoteproc1/state
随附
root@am62xx-EVM:~# ls -la /lib/firmware/hello_world_am62x-sk_r5fss0-0_freertos_ti-arm-clang.out
-rw-r--r-- 1 根根根 1349932 3 月 31 日 01:41 /lib/firmware/hello_world_am62x-sk_r5fss0-0_freertos_ti-arm-clang.out
root@am62xx-EVM:~# file /lib/firmware/hello_world_am62x-sk_r5fss0-0_freertos_ti-arm-clang.out
/lib/firmware/hello_world_am62x-sk_r5fss0-0_freertos_ti-arm-clang.out:ELF 32 位 LSB 可执行文件、ARM、EABI5 版本 1 (SYSV)、静态链接、带 DEBUG_INFO、未剥离
root@am62xx-EVM:~# echo “hello_world_am62x-sk_r5fss0-0_freertos_ti-arm-clang.out >/sys/class/remoteproc/remoteproc1/firmware
-sh:echo:写入错误:设备或资源忙
Root@am62xx-EVM:~# dmesg | tail –10
[11.686507] am65-cpsw-Nuss 8000000.Ethernet eth0:链路接通 — 100Mbps/full — 流控制 Rx/TX
[15.771710] 审计:type=1006 审计 (1774926975.161:2):pid=1102 uid=0 old-auid=4294967295 auid=1000 tty=(无)old-ses=4294967295 ses=1 res=1
[15.771743] 审计:type=1300 审计 (1774926975.161:2):arch=c00000b7 syscall=64 成功=yes exit=4 a0=8 a1=fffffb949b08 a2=4 a3=1 项目=0 ppid=1 pid=1000 uid=0 gid=0 gid=0 fsid=0 /usr/lib/systemd/systemd-executor
[15.771757] 审计:type=1327 审计 (1774926975.161:2):proctitle=“(systemd)"</s>“
[ 164.058915]平台 78000000.r5f:在运行时无法更改固件
[ 276.330302] platform 78000000.r5f:在运行时无法更改固件
[1362.988747] remoteproc remoteproc1: Unrecognized option: stoped

[ 1475.266782] platform 78000000.r5f:在运行时无法更改固件
[20222.922861]平台 78000000.r5f:在运行时无法更改固件

如果我发现它不起作用、应该如何使 Remoteproc 加载并运行由 CCS 软件编译的程序?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    您看到的行为是预期行为。 这就是原因。

    R5F 内核 (78000000_r5f、remoteproc1) 是设备管理器 R5F (DM R5F)。 与由 Linux Remoteproc 加载的其他远程内核不同、DM R5F 是引导流程的关键部分 — 在引导过程的早期,在 Linux 启动之前、它作为 tispl.bin 的一部分由 U-Boot 加载。 它运行设备管理器任务、用作 SoC 上所有其他内核的资源和电源管理器。

    到 Linux 引导时、DM R5F 已在运行。 Remoteproc 驱动程序会检测到该情况并将其置于仅 IPC 模式、引导日志将确认该模式:

    [7.530526]  platform 78000000.r5f:R5F 内核可能已由不同的主机供电、编程状态 (0)!=实际状态 (1)
    [  7.530717] platform 78000000.r5f:配置为仅 IPC 模式的 R5F

    在此模式下、Linux 可通过 RPMsg 与 DM R5F 通信、但无法停止、重新加载或替换其固件、因此在运行时无法更改固件。 这是按照设计实现的、因为停止 DM R5F 将导致整个处理器停止正常运行。

    若要在 DM R5F 上运行自定义固件、必须将其打包到 tispl.bin 并在引导时加载。 固件还必须调用 sciServer_init() 以保持设备管理器运行。 有关详细信息、请参阅:

    1. 进行开发的更多资源
    2. 引导和禁用远程内核

    有关在远程核心上开发应用程序的更广泛指导,请参阅 — 远程核心上的应用程序开发

    此致、
    Harshith