Objective: Use MessageQ to pass generic messages between the ARM and DSP cores within an OMAP-L138 installed on a custom board. So far I've not been able to get MessageQ_open() to successfully return on the DSP core, but one thing at a time.
Tool Versions:
CCS 6.1.0.00104
XDCtools 3.31.2.38_core
IPC 3.40.0.06
SYS/BIOS 6.42.2.29
I've referred extensively to the online IPC API documentation ( downloads.ti.com/.../index.html
I've also referred extensively to the ex02_messageq example provided with the IPC toolchain; however, while my 2 coworkers work on getting that to work (they coincidentally seem to be stuck on the same spot with Linux on the ARM core and SYS/BIOS on the DSP core, but they're using an LCDK-OMAPL138), I thought I'd try to build up 2 simple SYS/BIOS projects to get messaging working.
I'll post the relevant code below then further explain my difficulties.
arm.cfg:
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
Ipc.procSync = Ipc.ProcSync_PAIR;
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
MultiProc.numProcessors = 2;
MultiProc.setConfig("HOST", ["HOST", "DSP"]);
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
SharedRegion.translate = false;
//SharedRegion.cacheLineSize = 32;
SharedRegion.numEntries = 4;
var SHAREDMEM = 0xC2000000;
var SHAREDMEMSIZE = 0x0E000000;
SharedRegion.setEntryMeta(0,
{ base: SHAREDMEM,
len: SHAREDMEMSIZE,
ownerProcId: 0,
isValid: true,
cacheEnable: false,
cacheLineSize: 32,
createHeap: true,
name: "SR0"
}
);
var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
MessageQ.maxRuntimeEntries = 2;
var SyncSwi = xdc.useModule('ti.sysbios.syncs.SyncSwi');
dsp.cfg:
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
Ipc.procSync = Ipc.ProcSync_PAIR;
//Ipc.procSync = Ipc.ProcSync_ALL;
var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
MessageQ.maxRuntimeEntries = 2;
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
MultiProc.numProcessors = 2;
MultiProc.setConfig("DSP", ["HOST", "DSP"]);
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
SharedRegion.translate = false;
//SharedRegion.cacheLineSize = 32;
SharedRegion.numEntries = 4;
var SHAREDMEM = 0xC2000000;
var SHAREDMEMSIZE = 0x0E000000;
SharedRegion.setEntryMeta(0,
{ base: SHAREDMEM,
len: SHAREDMEMSIZE,
ownerProcId: 0,
isValid: true,
cacheEnable: false,
cacheLineSize: 32,
createHeap: true,
name: "SR0"
}
);
shared.h:
#ifndef SHARED_H
#define SHARED_H
#define MESSAGEQ_ARM_DSP ("mqad")
#endif
arm.c:
extern Swi_Handle swi_messageq;
MessageQ_Handle messageQ;
MessageQ_Params messageQParams;
SyncSwi_Params syncSwiParams;
SyncSwi_Handle syncSwiHandle;
int main()
{
/* Task Creation */
/* ... */
BIOS_start();
return 0;
}
Void taskFxn()
{
Bool bContinue = true;
Int status;
status = Ipc_start();
if(status < 0)
{
/* log error and system exit*/
}
/* Create a message queue using SyncSwi as the synchronizer */
SyncSwi_Params_init(&syncSwiParams);
syncSwiParams.swi = swi_messageq;
syncSwiHandle = SyncSwi_create(&syncSwiParams, NULL);
MessageQ_Params_init(&messageQParams);
messageQParams.synchronizer = SyncSwi_Handle_upCast(syncSwiHandle);
messageQ = MessageQ_create(MESSAGEQ_ARM_DSP, &messageQParams);
if(NULL == messageQ)
{
/* log error and system exit */
}
else
{
/* We're good! So far this seems to be working... */
}
while(bContinue)
{
Task_sleep(10);
}
}
dsp.c:
int main()
{
/* Task Creation */
/* ... */
BIOS_start();
return 0;
}
Void taskFxn()
{
MessageQ_QueueId remoteQueueId;
Int status;
status = Ipc_start();
if(status < 0)
{
/* log error and system exit */
}
do
{
status = MessageQ_open(MESSAGEQ_ARM_DSP, &remoteQueueId);
Task_sleep(1);
} while(status < 0);
}
As you can see, I haven't done anything really complicated here. So far, my Ipc_start() calls both return successfully. My MultiProc_getID() and _getName() calls produce what I expect on both cores. The call to MessageQ_create() returns with a valid handle on the ARM. But the call to MessageQ_open() always returns MessageQ_E_NOTFOUND indefinitely.
Any ideas on where to start debugging this further? I'm suspecting it either has something to do with my SharedRegion not being set up correctly (although I would expect the calls to Ipc_start() to fail if this were true), or the processors aren't actually attached (even though Ipc_start() seems to indicate they are by returning successfully).
Thanks in advance for any help!