Part Number: MCU-PLUS-SDK-AM64X
I am trying to use the RPMessage feature in callback mode, and I would like to confirm whether my understanding is correct. Could you please review the following points?
1.
In the function int32_t RPMessage_controlEndPtInit(void) within ipc_rpmsg.c, the following behavior is implemented:
When localEndPt equals RPMESSAGE_CTRL_ENDPOINT_ID, the callback function RPMessage_controlEndPtHandler is invoked.
2.
The return type of the callback function RPMessage_controlEndPtHandler should be RPMessage_RecvCallback, not void.
I am asking because I found the following post indicating that using void did not work for someone:
https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1203769/mcu-plus-sdk-am243x-rpmessage-with-callback-interrupt
3.
When localEndPt is set to a value that is not RPMESSAGE_CTRL_ENDPOINT_ID, it should be possible to configure RPMessage so that a different callback function is invoked.
4.
If I write code like the following, I believe the callback function RPMessage_User_Callback_Handler will be triggered for local endpoints 0 through 6:
for (int i = 0 ; i < 7 ; i++)
{
RPMessage_CreateParams_init(&createPrms);
createPrms.localEndPt = i;
createPrms.recvCallback = RPMessage_User_Callback_Handler;
status = RPMessage_construct(&gIpcRpmsgCtrl.controlEndPtObj, &createPrms);
if (SystemP_SUCCESS != status)
{
break;
}
}
5.
Callback registration is performed at the moment when RPMessage_construct is called, and there is no restriction on when RPMessage_construct can be invoked (i.e., callbacks can be added or removed freely within the application).
Could you please confirm whether the above understanding is correct?