1:?可以在 nRF Connect SDK 文件夾結構的?samples/ipc/ipc_service
?下找到示例,應用和網絡核心在由 CONFIG_APP_IPC_SERVICE_SEND_INTERVAL 選項指定的時隙內相互發送數據。可以更改該值并觀察每個核心的吞吐量如何變化
nRF5340 DK
可以使用 RPMsg 或 ICMSG 后端來構建示例,對于默認的 RPMsg 后端,請使用以下命令:
west build -p -b nrf5340dk/nrf5340/cpuapp
對于 ICMSG 后端,請使用以下命令:
west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_default .
2:可用于驗證當只有一個核心發送數據時的吞吐量。在構建 IPC 示例時使用這些覆蓋層來測試以下場景
網絡或應用核心通過 IPC 服務使用 RPMsg 發送數據:
west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_rpmsg_cpuapp_sending .
west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_rpmsg_cpunet_sending .
網絡或應用核心通過 IPC 服務使用 ICMsg 后端發送數據:
west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_cpuapp_sending .
west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_cpunet_sending .
3:測試
在默認配置中,應用程序和網絡核心會周期性地打印出由對方核心發送的數據的接收速度。
在將示例程序編程到您的開發板上后,通過執行以下步驟進行測試:
-
使用終端模擬器(例如 Serial Terminal 應用)連接到套件。有關所需設置和步驟,請參閱測試與優化。
-
Reset the kit.??
-
觀察兩個核心的控制臺輸出
對于應用核心,輸出類似于以下內容:*** Booting Zephyr OS build v3.0.99-ncs1 ***
IPC-service nrf5340dk/nrf5340/cpuapp demo started
Δpkt: 9391 (100 B/pkt) | throughput: 7512800 bit/s
Δpkt: 9389 (100 B/pkt) | throughput: 7511200 bit/s
Δpkt: 9388 (100 B/pkt) | throughput: 7510400 bit/s
Δpkt: 9390 (100 B/pkt) | throughput: 7512000 bit/s
Δpkt: 9396 (100 B/pkt) | throughput: 7516800 bit/s
對于網絡核心,輸出類似于以下內容:
*** Booting Zephyr OS build v3.0.99-ncs1 ***
IPC-service nrf5340dk/nrf5340/cpunet demo started
Δpkt: 6665 (100 B/pkt) | throughput: 5332000 bit/s
Δpkt: 6664 (100 B/pkt) | throughput: 5331200 bit/s
Δpkt: 6658 (100 B/pkt) | throughput: 5326400 bit/s
Δpkt: 6665 (100 B/pkt) | throughput: 5332000 bit/s
Δpkt: 6671 (100 B/pkt) | throughput: 5336800 bit/s