Other Parts Discussed in Thread: AM5728
Hello every one,
I'm trying to use messageQ module between Cortex A15 core1 and C66x DSP1 , But I'm stuck in IPC initializations, I'm using AM5728 IDK, here is my main.c for cortex a15:
#include <xdc/std.h> #include <xdc/runtime/Error.h> #include <xdc/runtime/System.h> #include <ti/sysbios/BIOS.h> #include <ti/sysbios/knl/Task.h> #include <ti/ipc/Ipc.h> #include <ti/ipc/MessageQ.h> #include <ti/ipc/MultiProc.h> #include <ti/sdo/ipc/interfaces/ITransport.h> #include <ti/sdo/ipc/interfaces/IMessageQTransport.h> #define SERVER "DSP1" Void taskFxn(UArg a0, UArg a1) { Int status; UInt16 remoteProcId; /* * initialize the ipc layer */ status = Ipc_start(); System_printf("Ipc_start: %d", status); System_flush(); if (status < 0) { System_abort("Ipc_start failed\n"); } remoteProcId = MultiProc_getId(SERVER); System_printf("remoteProcId: %d", remoteProcId); System_flush(); if (remoteProcId == MultiProc_INVALIDID) { System_abort("Improper MultiProc ID\n"); } do { status = Ipc_attach(remoteProcId); } while ((status < 0) && (status == Ipc_E_NOTREADY)); System_printf("Ipc_attach: %d", status); System_flush(); } /* * ======== main ======== */ Int main() { Task_Handle task; Error_Block eb; System_printf("enter main()\n"); Error_init(&eb); task = Task_create(taskFxn, NULL, &eb); if (task == NULL) { System_printf("Task_create() failed!\n"); BIOS_exit(0); } BIOS_start(); /* does not return */ return(0); }
and this is *.cfg file:
var Defaults = xdc.useModule('xdc.runtime.Defaults'); var Diags = xdc.useModule('xdc.runtime.Diags'); var Error = xdc.useModule('xdc.runtime.Error'); var Log = xdc.useModule('xdc.runtime.Log'); var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf'); var Main = xdc.useModule('xdc.runtime.Main'); var Memory = xdc.useModule('xdc.runtime.Memory') var SysMin = xdc.useModule('xdc.runtime.SysMin'); var System = xdc.useModule('xdc.runtime.System'); var Text = xdc.useModule('xdc.runtime.Text'); System.extendedFormats = '%$L%$S%$F%f'; var BIOS = xdc.useModule('ti.sysbios.BIOS'); var Clock = xdc.useModule('ti.sysbios.knl.Clock'); var Swi = xdc.useModule('ti.sysbios.knl.Swi'); var Task = xdc.useModule('ti.sysbios.knl.Task'); var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); System.maxAtexitHandlers = 4; BIOS.heapSize = 0x1000; /* * Build a custom SYS/BIOS library from sources. */ BIOS.libType = BIOS.LibType_Custom; /* System stack size (used by ISRs and Swis) */ Program.stack = 0x2000; /* Circular buffer size for System_printf() */ SysMin.bufSize = 0x200; /* * Create and install logger for the whole system */ var loggerBufParams = new LoggerBuf.Params(); loggerBufParams.numEntries = 16; var logger0 = LoggerBuf.create(loggerBufParams); Defaults.common$.logger = logger0; Main.common$.diags_INFO = Diags.ALWAYS_ON; System.SupportProxy = SysMin; var SemiHostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport'); /*======================== IPC =======================*/ xdc.useModule('ti.sdo.ipc.Ipc'); xdc.useModule('ti.sdo.ipc.MessageQ'); xdc.useModule('ti.sdo.ipc.SharedRegion'); xdc.useModule('ti.sdo.utils.MultiProc'); xdc.useModule('ti.sysbios.heaps.HeapBuf'); /* configure processor names */ var procNameAry = ["DSP1","DSP2","IPU1","IPU2", "HOST"]; var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc'); MultiProc.setConfig("HOST", procNameAry); /* ipc configuration */ var Ipc = xdc.useModule('ti.sdo.ipc.Ipc'); Ipc.procSync = Ipc.ProcSync_PAIR; Ipc.sr0MemorySetup = true; /* shared region configuration */ var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion'); /* configure SharedRegion #0 (IPC) */ var SHAREDMEM = 0x8E000000; var SHAREDMEMSIZE = 0x1000000; SharedRegion.setEntryMeta(0, new SharedRegion.Entry({ name: "mySharedRegion", base: SHAREDMEM, len: SHAREDMEMSIZE, ownerProcId: 0, isValid: true, cacheEnable: true }) ); /* create a default heap */ var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); var heapMemParams = new HeapMem.Params(); heapMemParams.size = 0x8000; var Memory = xdc.useModule('xdc.runtime.Memory'); Memory.defaultHeapInstance = HeapMem.create(heapMemParams);
and this is my project folder:
I debugged both cores and they both stick in while loop and Ipc_attach returns -11, I think there is something wrong with the sharedRegion but I can't figure it out, I searched the forum, similar resolved questions didn't help so much.
I'm using ti-RTOS on both cores and these are my SW/tools versions;
bios_6_75_02_00,
ccs910,
ipc_3_50_03_05,
xdctools_3_51_01_18,
processor_sdk_rtos_am57xx_6_00_00_07,
B.R,
Alex.