We are using the MessageQ example provided at ipc_3_50_04_08\examples\66AK2G_linux_elf\ex02_messageq to try out IPC between ARM (Linux) host and DSP (TI-RTOS) slave.
We have imported the source files into IDEs (CCS and eclipse for DSP and ARM respectively). We were able to build and run the applications successfully.
Now we want to use static memory allocation for MessageQ eliminating the use of heap memory.
So we used the MessageQ_staticMsgInit instead of MessageQ_alloc API on ARM side.
But we are getting A_heapIdInvalid on DSP side, while sending message from ARM application.
We observed that transportCallbackFxn in TransportRpmsg.c is calling the MessageQ_alloc which uses the invalid heap ID (ti_sdo_ipc_MessageQ_STATICMSG) for copying the received message.
We are getting the error at the following line in TransportRpmsg.c which is caused by the assert failure in MessageQ_alloc due to invalid heap ID, ti_sdo_ipc_MessageQ_STATICMSG.
buf = MessageQ_alloc(msg->heapId, msgSize);
Do we have to any modifications on the DSP side either in cfg file or in C for static MessageQ allocation?
Linux Application:
TI-RTOS Application:
DSP Application Output:
[C66xx] 1 Resource entries at 0x800000
registering rpmsg-proto:rpmsg-proto service on 61 with HOST
[t=0x00000010:0c800547] xdc.runtime.Main: NameMap_sendMessage: HOST 53, port=61
[t=0x00000010:0c810ce3] xdc.runtime.Main: --> smain:
[t=0x00000010:0c823413] Server: Server_create: server is ready
[t=0x00000010:0c82ce1f] Server: <-- Server_create: 0
[t=0x00000010:0c83542a] Server: --> Server_exec:
[t=0x00000011:5b94b1a9] ti.sdo.ipc.MessageQ: ERROR: line 188: assertion failure: A_heapIdInvalid: heapId is invalid
ti.sdo.ipc.MessageQ: line 188: assertion failure: A_heapIdInvalid: heapId is invalid
xdc.runtime.Error.raise: terminating execution
ARM Application Output:
--> main:
--> Main_main:
--> App_create:
App_create: Host is ready
<-- App_create:
--> App_exec:
App_exec: sending message 1