This conflict is expected between ndk and messageq.
< .cfg file >
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
var nameList=[];// = MultiProc.getDeviceProcNames();
switch (Program.platformName)
{
case "ti.sdo.ipc.examples.platforms.evm6678.core0":
case "ti.platforms.evm6678":
nameList = ["CORE0", "CORE1", "CORE2", "CORE3"];
break;
default:
throw("Unsupported platform: " + Program.platformName); }
/* * Since this is a single-image example, we don't (at build-time) which * processor we're building for. We therefore supply 'null' * as the local procName and allow IPC to set the local procId at runtime. */
MultiProc.setConfig(null, nameList);
var Memory = xdc.useModule('xdc.runtime.Memory');
var Log = xdc.useModule('xdc.runtime.Log');
//var Error = xdc.useModule('xdc.runtime.Error');
var System = xdc.useModule('xdc.runtime.System');
var SysStd = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;
var BiosCache = xdc.useModule('ti.sysbios.hal.Cache');
var SysMin = xdc.useModule("xdc.runtime.SysMin");
System.SupportProxy = SysMin;
SysMin.bufSize = 0x8000;
/* Support for %f in printf */
System.extendedFormats = '%$L%$S%$F%f%g%e';
/* Modules explicitly used in the application */
var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
//MessageQ.SetupTransportProxy = xdc.useModule('ti.sdo.ipc.transports.TransportShmNotifySetup');
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
var Notify = xdc.useModule('ti.sdo.ipc.Notify');
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x8000000;
heapMemParams.sectionName = "systemHeapMaster";
Program.global.heap1 = HeapMem.create(heapMemParams);
Memory.defaultHeapInstance = Program.global.heap1;
Memory.defaultHeapSize = 0x10000;
//var LoggerCircBuf = xdc.useModule('ti.uia.runtime.LoggerCircBuf');
var Load = xdc.useModule('ti.sysbios.utils.Load');
var Diags = xdc.useModule('xdc.runtime.Diags');
//var Defaults = xdc.useModule('xdc.runtime.Defaults');
//var Main = xdc.useModule('xdc.runtime.Main');
CpuTimestamp = xdc.useModule('ti.uia.family.c66.TimestampC66XLocal');
GlobalTimestamp = xdc.useModule('ti.uia.family.c66.TimestampC66XGlobal');
LogSync = xdc.useModule('ti.uia.runtime.LogSync');
LogSync.GlobalTimestampProxy = GlobalTimestamp;
LogSync.CpuTimestampProxy = CpuTimestamp;
CpuTimestamp.maxTimerClockFreq = {lo:1000000000,hi:0};
CpuTimestamp.maxBusClockFreq = {lo:1000000000,hi:0};
GlobalTimestamp.maxTimerClockFreq = {lo:250000000,hi:0};
GlobalTimestamp.maxBusClockFreq = {lo:1000000000,hi:0};
GlobalTimestamp.cpuCyclesPerTick = 4;
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Exc = xdc.useModule('ti.sysbios.family.c64p.Exception');
Exc.common$.logger = LoggerBuf.create();
Exc.enablePrint = true;
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
/* Increase the sysbios logger and turn Hwi and Swi logging off */
LoggingSetup.sysbiosLoggerSize = 32768;
LoggingSetup.mainLoggerSize = 8*1024;
LoggingSetup.loadLoggerSize = 32768;
LoggingSetup.loadLogging = true;
LoggingSetup.sysbiosTaskLogging = false;
LoggingSetup.sysbiosSwiLogging = false;
LoggingSetup.sysbiosHwiLogging = false;
LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_NONJTAGTRANSPORT;
var Csl = xdc.useModule('ti.csl.Settings');
var Cppi = xdc.loadPackage('ti.drv.cppi');
var Qmss = xdc.loadPackage('ti.drv.qmss');
var Pa = xdc.useModule('ti.drv.pa.Settings');
var PlatformLib = xdc.loadPackage('ti.platform.evmc6678l');
var NdkTransPort = xdc.loadPackage('ti.transport.ndk');
var Ecm = xdc.useModule ('ti.sysbios.family.c64p.EventCombiner');
Ecm.eventGroupHwiNum[0] = 7;
Ecm.eventGroupHwiNum[1] = 8;
Ecm.eventGroupHwiNum[2] = 9;
Ecm.eventGroupHwiNum[3] = 10;
var Global = xdc.useModule('ti.ndk.config.Global');
Global.enableCodeGeneration = false;
/*
if( MultiProc.id == 0 ) {
Program.sectMap["systemHeapMaster"] = "DDR3"; } */
var PlatformLib = xdc.loadPackage('ti.platform.evmc6678l');
var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
//var cache = xdc.useModule('xdc.runtime.knl.Cache');
//var GateMP = xdc.useModule('ti.sdo.ipc.GateMP');
/* BIOS/XDC modules */
var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.taskEnabled = true;
var Task = xdc.useModule('ti.sysbios.knl.Task');
Task.defaultStackSize = 64*1024;
Task.common$.namedInstance = true;
var tsk0 = Task.create('&tsk0_func');
tsk0.instance.name = "tsk0";
tsk0.stackSize = 0x4000;
tsk0.priority = 0x5;
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var Event = xdc.useModule('ti.sysbios.knl.Event');
var mbx = xdc.useModule('ti.sysbios.knl.Mailbox');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
//Semaphore.supportsEvents = true;
/* var instti_MailboxParams = new mbx.Params(); instti_MailboxParams.sectionName = "DDR3"; instti_MailboxParams.heap = null; instti_MailboxParams.instance.name="mbx"; instti_MailboxParams.buf = null; instti_MailboxParams.bufSize = 0; */
/* Synchronize all processors (this will be done in Ipc_start) */
Ipc.procSync = Ipc.ProcSync_ALL;
/* Shared Memory base address and length */
var SHAREDMEM = 0x0C000000;
var SHAREDMEMSIZE = 0x002E50C0;
/* * Need to define the shared region. The IPC modules use this * to make portable pointers. All processors need to add this * call with their base address of the shared memory region. * If the processor cannot access the memory, do not add it. */
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
SharedRegion.setEntryMeta(0,
{
base: SHAREDMEM,
len: SHAREDMEMSIZE,
ownerProcId: 0,
isValid: true,
//createHeap: true,
name: "sharemem",
});
/* var ServiceMgr = xdc.useModule('ti.uia.runtime.ServiceMgr'); ServiceMgr.topology = ServiceMgr.Topology_MULTICORE; ServiceMgr.masterProcId = 0; */
var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');
Program.global.HEAP_MSGSIZE = 2048;
Program.heap = 0x10000;
Program.stack = 0xA000;
Program.sectMap[".vecs"] = "DDR3";
Program.sectMap[".switch"] = "DDR3";
Program.sectMap[".cio"] = "L2SRAM";
Program.sectMap[".args"] = "DDR3";
Program.sectMap[".cppi"] = "L2SRAM";
Program.sectMap[".qmss"] = "L2SRAM";
Program.sectMap[".nimu_eth_ll2"] = "L2SRAM";
Program.sectMap[".resmgr_memregion"] = {loadSegment: "L2SRAM", loadAlign:128}; /* QMSS descriptors region */
Program.sectMap[".resmgr_handles"] = {loadSegment: "L2SRAM", loadAlign:16}; /* CPPI/QMSS/PA Handles */
Program.sectMap[".resmgr_pa"] = {loadSegment: "L2SRAM", loadAlign:8}; /* PA Memory */
Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "L2SRAM", loadAlign: 8};
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "L2SRAM", loadAlign: 8};
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "L2SRAM", loadAlign: 128};
Program.sectMap[".init_array"] = "DDR3";
Program.sectMap["systemHeapMaster"] = "DDR3";
Program.sectMap[".cinit"] = "DDR3";
Program.sectMap[".const"] = "DDR3";
Program.sectMap[".text"] = "DDR3";
Program.sectMap[".far"] = "DDR3";
Program.sectMap[".bss"] = "DDR3";
Program.sectMap[".rodata"] = "DDR3";
Program.sectMap[".neardata"] = "DDR3";
Program.sectMap[".code"] = "DDR3";
Program.sectMap[".data"] = "DDR3";
Program.sectMap[".sysmem"] = "DDR3";
Program.sectMap[".defaultStackSection"] = "L2SRAM";
Program.sectMap[".stack"] = "L2SRAM";
Program.sectMap["platform_lib"] = "DDR3";
var Startup = xdc.useModule('xdc.runtime.Startup');
Startup.firstFxns.$add('&EVM_init');
< main.c >
main()
{
ipc_start();
}
tsk0_func()
{
if( platform_get_coreid() == 0 )//selfId == 0 ) { HANDLE hCfg; CI_SERVICE_TELNET telnet; CI_SERVICE_HTTP http; QMSS_CFG_T qmss_cfg; CPPI_CFG_T cppi_cfg;
/* Initialize QMSS */ if (platform_get_coreid() == 0) { qmss_cfg.master_core = 1; } else { qmss_cfg.master_core = 0; } qmss_cfg.max_num_desc = MAX_NUM_DESC; qmss_cfg.desc_size = MAX_DESC_SIZE; qmss_cfg.mem_region = Qmss_MemRegion_MEMORY_REGION1; if (res_mgr_init_qmss (&qmss_cfg) != 0) { platform_write ("Failed to initialize the QMSS subsystem \n"); goto main_exit; } else { platform_write ("QMSS successfully initialized \n"); }
/* Initialize CPPI */ if (platform_get_coreid() == 0) { cppi_cfg.master_core = 1; } else { cppi_cfg.master_core = 0; } cppi_cfg.dma_num = Cppi_CpDma_PASS_CPDMA; cppi_cfg.num_tx_queues = NUM_PA_TX_QUEUES; cppi_cfg.num_rx_channels = NUM_PA_RX_CHANNELS; if (res_mgr_init_cppi (&cppi_cfg) != 0) { platform_write ("Failed to initialize CPPI subsystem \n"); goto main_exit; } else { platform_write ("CPPI successfully initialized \n"); }
if (res_mgr_init_pass()!= 0) { platform_write ("Failed to initialize the Packet Accelerator \n"); goto main_exit; } else { platform_write ("PA successfully initialized \n"); }
rc = NC_SystemOpen( NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT ); if( rc ) { platform_write("NC_SystemOpen Failed (%d)\n",rc); for(;;); }
hCfg = CfgNew(); if( !hCfg ) { platform_write("Unable to create configuration\n"); goto main_exit; }
// We better validate the length of the supplied names if( strlen( nc->domainName ) >= CFG_DOMAIN_MAX || strlen( nc->hostName ) >= CFG_HOSTNAME_MAX ) { platform_write("Names too long\n"); goto main_exit; }
// Add our global hostname to hCfg (to be claimed in all connected domains) CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0, strlen(nc->hostName), (UINT8 *)nc->hostName, 0 );
HeapBufMP_Params_init(&heapBufParams_d); heapBufParams_d.regionId = 0; heapBufParams_d.name = HEAP_D_NAME; heapBufParams_d.numBlocks = 1; heapBufParams_d.blockSize = sizeof(DIRECTION); //heapBufParams_d.gate = NULL; heapHandle_d = HeapBufMP_create(&heapBufParams_d); if (heapHandle_d == NULL) { platform_write("HeapBufMP_create failed\n" ); }
HeapBufMP_Params_init(&heapBufParams_tp); heapBufParams_tp.regionId = 0; heapBufParams_tp.name = HEAP_TP_NAME; heapBufParams_tp.numBlocks = 5; heapBufParams_tp.blockSize = sizeof(THETAPHI); //heapBufParams_tp.gate = NULL; heapHandle_tp = HeapBufMP_create(&heapBufParams_tp); if (heapHandle_tp == NULL) { platform_write("HeapBufMP_create failed\n" ); }
MessageQ_registerHeap((IHeap_Handle)heapHandle_d, HEAPID_D); MessageQ_registerHeap((IHeap_Handle)heapHandle_tp, HEAPID_TP);
if (!platform_get_switch_state(1)) { CI_IPNET NA; CI_ROUTE RT; IPN IPTmp;
// Setup manual IP address bzero( &NA, sizeof(NA) ); NA.IPAddr = inet_addr(nc->localIpAddress); NA.IPMask = inet_addr(nc->localIpMask); strcpy( NA.Domain, nc->domainName ); NA.NetType = 0;
// Add the address to interface 1 CfgAddEntry( hCfg, CFGTAG_IPNET, 1, 0, sizeof(CI_IPNET), (UINT8 *)&NA, 0 );
// Add the default gateway. Since it is the default, the // destination address and mask are both zero (we go ahead // and show the assignment for clarity). bzero( &RT, sizeof(RT) ); RT.IPDestAddr = 0; RT.IPDestMask = 0; RT.IPGateAddr = inet_addr(nc->gatewayIp);
// Add the route CfgAddEntry( hCfg, CFGTAG_ROUTE, 0, 0, sizeof(CI_ROUTE), (UINT8 *)&RT, 0 );
// Manually add the DNS server when specified IPTmp = inet_addr(nc->dnsServer); if( IPTmp ) CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_DOMAINNAMESERVER, 0, sizeof(IPTmp), (UINT8 *)&IPTmp, 0 ); } // Else we specify DHCP else { CI_SERVICE_DHCPC dhcpc;
platform_write("Configuring DHCP client\n");
// Specify DHCP Service on IF-1 bzero( &dhcpc, sizeof(dhcpc) ); dhcpc.cisargs.Mode = CIS_FLG_IFIDXVALID; dhcpc.cisargs.IfIdx = 1; dhcpc.cisargs.pCbSrv = &ServiceReport; dhcpc.param.pOptions = DHCP_OPTIONS; dhcpc.param.len = 2;
CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_DHCPCLIENT, 0, sizeof(dhcpc), (UINT8 *)&dhcpc, 0 ); } // Specify TELNET service for our Console example bzero( &telnet, sizeof(telnet) ); telnet.cisargs.IPAddr = INADDR_ANY; telnet.cisargs.pCbSrv = &ServiceReport; telnet.param.MaxCon = 2; telnet.param.Callback = &ConsoleOpen; CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_TELNET, 0, sizeof(telnet), (UINT8 *)&telnet, 0 );
// HTTP Authentication { CI_ACCT CA;
// Name our authentication group for HTTP (Max size = 31) // This is the authentication "realm" name returned by the HTTP // server when authentication is required on group 1. CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_SYSINFO_REALM1, 0, 30, (UINT8 *)"DSP_CLIENT_DEMO_AUTHENTICATE1", 0 );
// Create a sample user account who is a member of realm 1. // The username and password are just "username" and "password" strcpy( CA.Username, "username" ); strcpy( CA.Password, "password" ); CA.Flags = CFG_ACCTFLG_CH1; // Make a member of realm 1 rc = CfgAddEntry( hCfg, CFGTAG_ACCT, CFGITEM_ACCT_REALM, 0, sizeof(CI_ACCT), (UINT8 *)&CA, 0 ); }
// Specify HTTP service bzero( &http, sizeof(http) ); http.cisargs.IPAddr = INADDR_ANY; http.cisargs.pCbSrv = &ServiceReport; CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_HTTP, 0, sizeof(http), (UINT8 *)&http, 0 );
// // Configure IPStack/OS Options //
// We don't want to see debug messages less than WARNINGS rc = DBG_INFO; CfgAddEntry( hCfg, CFGTAG_OS, CFGITEM_OS_DBGPRINTLEVEL, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
// // This code sets up the TCP and UDP buffer sizes // (Note 8192 is actually the default. This code is here to // illustrate how the buffer and limit sizes are configured.) //
// TCP Transmit buffer size rc = 8192; CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_SOCKTCPTXBUF, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
// TCP Receive buffer size (copy mode) rc = 8192; CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_SOCKTCPRXBUF, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
// TCP Receive limit (non-copy mode) rc = 8192; CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_SOCKTCPRXLIMIT, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
// UDP Receive limit rc = 8192; CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_SOCKUDPRXLIMIT, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
#if 0 // TCP Keep Idle (10 seconds) rc = 100; // This is the time a connection is idle before TCP will probe CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_TCPKEEPIDLE, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
// TCP Keep Interval (1 second) // This is the time between TCP KEEP probes rc = 10; CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_TCPKEEPINTVL, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
// TCP Max Keep Idle (5 seconds) // This is the TCP KEEP will probe before dropping the connection rc = 50; CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_TCPKEEPMAXIDLE, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 ); #endif
// // Boot the system using this configuration // // We keep booting until the function returns 0. This allows // us to have a "reboot" command. // do { rc = NC_NetStart( hCfg, NetworkOpen, NetworkClose, NetworkIPAddr ); } while( rc > 0 );
// Delete Configuration CfgFree( hCfg ); main_exit: NC_SystemClose();
}
else
{
do { status = HeapBufMP_open(HEAP_D_NAME, &heapHandle_d); /* * Sleep for 1 clock tick to avoid inundating remote processor * with interrupts if open failed */ if (status < 0) { //platform_delay(1); Task_sleep(1); } } while (status < 0);
do { status = HeapBufMP_open(HEAP_TP_NAME, &heapHandle_tp); /* * Sleep for 1 clock tick to avoid inundating remote processor * with interrupts if open failed */ if (status < 0) { //platform_delay(1); Task_sleep(1); } } while (status < 0);
MessageQ_registerHeap((IHeap_Handle)heapHandle_d, HEAPID_D); MessageQ_registerHeap((IHeap_Handle)heapHandle_tp, HEAPID_TP);
}
dir_messageQ = MessageQ_create(localQueueName_dir, NULL);
if (dir_messageQ == NULL) { platform_write("dir MessageQ_create failed\n" ); }
tp_messageQ = MessageQ_create(localQueueName_tp, NULL);
if (tp_messageQ == NULL) { platform_write("tp MessageQ_create failed\n" ); }
............
}
please help me....
thank you..