2.2. Design Overview

../_images/设计概述002.png
  • IPCM cust initialization only requires calling CVI_IPCM_CustInit and registering a handle with CVI_IPCM_RegisterCustHandle.

  • If the msg length does not exceed 4 bytes, for example when only a command is sent, fill the param field of the msg structure directly and send it to the other RISC-V through the mailbox.

  • If the msg length exceeds 4 bytes, allocate a pool from shared memory, fill the pool, call CVI_IPCM_DataPacked to pack the msg, and then send it to the other RISC-V through the mailbox.

Note

The msg size is limited.

  1. It must not exceed 4095.

  2. It must not exceed the maximum pool size configured in CVI_IPCM_Init.

  • When the RISC-V receives a cust msg, cust_thread is awakened and calls the handle registered during cust initialization. The handle can distinguish different cust messages by port_id and msg_id.