From: G Anthony Date: Fri, 22 Feb 2013 02:08:05 +0000 (-0800) Subject: ping_rpmsg: Added ping test over MessageQCopy. X-Git-Tag: 3.00.00.11_eng~27 X-Git-Url: https://git.ti.com/gitweb?p=ipc%2Fipcdev.git;a=commitdiff_plain;h=ba8ab5364ffe3702d4c3a110847e5cc5a556f044 ping_rpmsg: Added ping test over MessageQCopy. Linux side works over rpmsg-proto socket. BIOS side works over MessageQCopy, and makes use of MessageQCopy callback feature to receive messages (rather than MessageQCopy_send). Signed-off-by: G Anthony --- diff --git a/.gitignore b/.gitignore index fc5da2f..e276d7a 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,4 @@ packages/ti/ipc/transports/TransportVirtioSetup.h /linux/src/tests/MessageQMulti_* /linux/src/tests/NameServerApp_* /linux/src/tests/nano_test_* -/linux/src/tests/ping_rpmsg_* +/linux/src/tests/ping_rpmsg diff --git a/linux/src/tests/Makefile.am b/linux/src/tests/Makefile.am index 9d25908..866bf58 100644 --- a/linux/src/tests/Makefile.am +++ b/linux/src/tests/Makefile.am @@ -8,7 +8,7 @@ AM_CFLAGS = -I$(top_srcdir)/linux/include -I$(top_srcdir)/packages -I$(CMEM_INST ############################################################################### # the program to build (the names of the final binaries) -bin_PROGRAMS = +bin_PROGRAMS = ping_rpmsg if OMAP4430 bin_PROGRAMS += MessageQApp_omap4430 MessageQBench_omap4430 MessageQMulti_omap4430 \ @@ -57,6 +57,9 @@ nameServer_common_sources = \ $(top_srcdir)/packages/ti/ipc/NameServer.h \ NameServerApp.c +# list of sources for the 'ping_rpmsg' binary +ping_rpmsg_SOURCES = ping_rpmsg.c + # list of sources for the 'MessageQApp' binary MessageQApp_omap4430_SOURCES = $(common_sources) MessageQApp.c MessageQApp_omapl138_SOURCES = $(common_sources) MessageQApp.c @@ -87,6 +90,9 @@ nano_test_omapl138_SOURCES = $(common_sources) nano_test.c common_libraries = -lpthread $(top_builddir)/linux/src/api/libtiipc.la \ $(top_builddir)/linux/src/utils/libtiipcutils.la +# the additional libraries to link ping_rpmsg +ping_rpmsg_LDADD = -lrt + # the additional libraries needed to link MessageQApp MessageQApp_omap4430_LDADD = $(common_libraries) \ $(top_builddir)/linux/src/family/libtiipccfg_omap4430.la $(AM_LDFLAGS) diff --git a/linux/src/tests/ping_rpmsg.c b/linux/src/tests/ping_rpmsg.c new file mode 100644 index 0000000..3383930 --- /dev/null +++ b/linux/src/tests/ping_rpmsg.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2012-2013, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * ======== ping_rpmsg.c ======== + * + * Works with the ping_rpmsg BIOS sample over the rpmsg-proto socket. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* SysLink Socket Protocol Family */ +#include + +#define CORE0 (0) /* This should be MultiProc_getId("CORE0") - 1 */ + +#define NUMLOOPS 100 + +long diff(struct timespec start, struct timespec end) +{ + struct timespec temp; + + if ((end.tv_nsec - start.tv_nsec) < 0) { + temp.tv_sec = end.tv_sec - start.tv_sec-1; + temp.tv_nsec = 1000000000UL + end.tv_nsec - start.tv_nsec; + } else { + temp.tv_sec = end.tv_sec - start.tv_sec; + temp.tv_nsec = end.tv_nsec - start.tv_nsec; + } + + return (temp.tv_sec * 1000000UL + temp.tv_nsec / 1000); +} + +int main(void) +{ + int sock, err; + struct sockaddr_rpmsg src_addr, dst_addr; + socklen_t len; + const char *msg = "Ping!"; + char buf[512]; + struct timespec start,end; + long elapsed=0,delta; + int i; + + /* create an RPMSG socket */ + /* QNX PORTING NOTE: call fd = open("/dev/????", ...); */ + sock = socket(AF_RPMSG, SOCK_SEQPACKET, 0); + if (sock < 0) { + printf("socket failed: %s (%d)\n", strerror(errno), errno); + return -1; + } + + /* connect to remote service */ + memset(&dst_addr, 0, sizeof(dst_addr)); + dst_addr.family = AF_RPMSG; + dst_addr.vproc_id = CORE0; + dst_addr.addr = 51; // use 51 for ping_tasks; + //dst_addr.addr = 61; // use 61 for messageQ transport; + + printf("Connecting to address 0x%x on vprocId %d\n", + dst_addr.addr, dst_addr.vproc_id); + + len = sizeof(struct sockaddr_rpmsg); + /* QNX PORTING NOTE: call ioctl(fd, CONNECT_IOTL, *args)*/ + err = connect(sock, (struct sockaddr *)&dst_addr, len); + if (err < 0) { + printf("connect failed: %s (%d)\n", strerror(errno), errno); + return -1; + } + + /* let's see what local address we got */ + /* QNX PORTING NOTE: call ioctl(fd, GETLOCALENDPOINT_IOTL, *args)*/ + err = getsockname(sock, (struct sockaddr *)&src_addr, &len); + if (err < 0) { + printf("getpeername failed: %s (%d)\n", strerror(errno), errno); + return -1; + } + + printf("Our address: socket family: %d, proc id = %d, addr = %d\n", + src_addr.family, src_addr.vproc_id, src_addr.addr); + + printf("Sending \"%s\" in a loop.\n", msg); + + for (i = 0; i < NUMLOOPS; i++) { + clock_gettime(CLOCK_REALTIME, &start); + + /* QNX PORTING NOTE: call write(fd, msg,len); */ + err = send(sock, msg, strlen(msg) + 1, 0); + if (err < 0) { + printf("sendto failed: %s (%d)\n", strerror(errno), errno); + return -1; + } + + memset(&src_addr, 0, sizeof(src_addr)); + + len = sizeof(src_addr); + + /* QNX PORTING NOTE: len = read(fd, buf, len); */ + err = recvfrom(sock, buf, sizeof(buf), 0, + (struct sockaddr *)&src_addr, &len); + + if (err < 0) { + printf("recvfrom failed: %s (%d)\n", strerror(errno), errno); + return -1; + } + if (len != sizeof(src_addr)) { + printf("recvfrom: got bad addr len (%d)\n", len); + return -1; + } + + clock_gettime(CLOCK_REALTIME, &end); + delta = diff(start,end); + elapsed += delta; + + printf("%d: Received msg: %s, from: %d\n", i, buf, src_addr.addr); + + /* + printf ("Message time: %ld usecs\n", delta); + printf("Received a msg from address 0x%x on processor %d\n", + src_addr.addr, src_addr.vproc_id); + printf("Message content: \"%s\".\n", buf); + */ + } + printf ("Avg time: %ld usecs over %d iterations\n", elapsed / i, i); + + /* QNX PORTING NOTE: close(fd); */ + close(sock); + + return 0; +} diff --git a/src/ti/ipc/tests/package.bld b/src/ti/ipc/tests/package.bld index 41f152e..4f21562 100644 --- a/src/ti/ipc/tests/package.bld +++ b/src/ti/ipc/tests/package.bld @@ -83,7 +83,7 @@ for (var i = 0; i < Build.targets.length; i++) { /* currently only build for OMAPL138, Appleton and Kepler */ if (!((platform.match(/^ti\.platforms\.evm6614\:DSP/)) || (platform.match(/^ti\.platforms\.simKepler/)) || - (platform.match(/^ti\.platforms\.evmOMAPL138\:DSP/)))) { + (platform.match(/\.platforms\.evmOMAPL138/)))) { continue; } @@ -93,6 +93,13 @@ for (var i = 0; i < Build.targets.length; i++) { // replace all ':' and '.' with '_' in platform name platform.replace(/\:/g, "_").replace(/\./g, "_"); + Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, { + cfgScript: "ping_rpmsg" + }).addObjects(["ping_rpmsg.c"]); + + /* TEMP: Just build ping_rpmsg for now: */ + continue; + /* Only build this for our multicore platforms: */ if (platform.match(/^ti\.platforms\.simKepler/) || platform.match(/^ti\.platforms\.evm6614\:DSP/)) { diff --git a/src/ti/ipc/tests/package.xdc b/src/ti/ipc/tests/package.xdc index cc03678..168a877 100644 --- a/src/ti/ipc/tests/package.xdc +++ b/src/ti/ipc/tests/package.xdc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Texas Instruments Incorporated + * Copyright (c) 2012-2013, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,5 +39,5 @@ * Currently not shipping these modules */ -package ti.ipc.tests [1,0,0,0] { +package ti.ipc.tests [1,0,0] { } diff --git a/src/ti/ipc/tests/ping_rpmsg.c b/src/ti/ipc/tests/ping_rpmsg.c new file mode 100644 index 0000000..5671a8e --- /dev/null +++ b/src/ti/ipc/tests/ping_rpmsg.c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2012-2013, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * ======== ping.c ======== + * + * Works with the ping_rpmsg HLOS test over the rpmsg-proto service. + * The ping_rpmsg test is in the linux/src/tests directory of this tree. + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +static UInt16 dstProc; +static MessageQCopy_Handle handle = NULL; +static UInt32 myEndpoint = 0; +static UInt32 counter = 0; + +/* Send me a zero length data payload to tear down the MesssageQCopy object: */ +static Void pingCallbackFxn(MessageQCopy_Handle h, UArg arg, Ptr data, + UInt16 len, UInt32 src) +{ + const Char *reply = "Pong!"; + UInt replyLen = strlen(reply) + 1; + + System_printf("%d: Received msg: %s from %d, len:%d\n", + counter++, data, src, len); + + /* Send data back to remote endpoint: */ + MessageQCopy_send(dstProc, src, myEndpoint, (Ptr)reply, replyLen); +} + +Void pingTaskFxn(UArg arg0, UArg arg1) +{ + System_printf("ping_task at port %d: Entered...\n", arg0); + + /* Create the messageQ for receiving, and register callback: */ + handle = MessageQCopy_create(arg0, pingCallbackFxn, NULL, &myEndpoint); + if (!handle) { + System_abort("MessageQCopy_createEx failed\n"); + } + + /* Announce we are here: */ + NameMap_register("rpmsg-proto", arg0); + + /* Note: we don't get a chance to teardown with MessageQCopy_destroy() */ +} + +Int main(Int argc, char* argv[]) +{ + System_printf("%s starting..\n", MultiProc_getName(MultiProc_self())); + + BIOS_start(); + + return (0); +} diff --git a/src/ti/ipc/tests/ping_rpmsg.cfg b/src/ti/ipc/tests/ping_rpmsg.cfg new file mode 100644 index 0000000..66f37f6 --- /dev/null +++ b/src/ti/ipc/tests/ping_rpmsg.cfg @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2012-2013, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var Memory = xdc.useModule('xdc.runtime.Memory'); +var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); +var BIOS = xdc.useModule('ti.sysbios.BIOS'); +BIOS.heapSize = 0x20000; +//BIOS.libType = BIOS.LibType_Custom; + +var Idle = xdc.useModule('ti.sysbios.knl.Idle'); +Idle.addFunc('&VirtQueue_cacheWb'); + +var System = xdc.useModule('xdc.runtime.System'); +var SysMin = xdc.useModule('xdc.runtime.SysMin'); +System.SupportProxy = SysMin; + +var Diags = xdc.useModule('xdc.runtime.Diags'); + +print ("Program.cpu.deviceName = " + Program.cpu.deviceName); +print ("Program.platformName = " + Program.platformName); +if (Program.cpu.deviceName == "OMAPL138") { + xdc.useModule('ti.ipc.family.omapl138.VirtQueue'); + xdc.useModule('ti.sdo.ipc.family.da830.InterruptDsp'); + + var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc'); + MultiProc.setConfig("DSP", ["HOST", "DSP"]); + + /* Enable Memory Translation module that operates on the Resource Table */ + var Resource = xdc.useModule('ti.ipc.remoteproc.Resource'); + Resource.loadSegment = Program.platform.dataMemory; + + Program.sectMap[".text:_c_int00"] = new Program.SectionSpec(); + Program.sectMap[".text:_c_int00"].loadSegment = "DDR"; + Program.sectMap[".text:_c_int00"].loadAlign = 0x400; + + var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi'); + + var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache'); + /* Set 0xc4000000 -> 0xc4ffffff to be non-cached for shared memory IPC */ + Cache.MAR192_223 = 0x00000010; + + Program.global.sysMinBufSize = 0x8000; + SysMin.bufSize = Program.global.sysMinBufSize; + + var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer'); + var Clock = xdc.useModule('ti.sysbios.knl.Clock'); + Timer.timerSettings[1].master = true; + Timer.defaultHalf = Timer.Half_LOWER; + Clock.timerId = 1; + + Diags.setMaskMeta("ti.ipc.family.omapl138.Interrupt", Diags.USER1, + Diags.ALWAYS_ON); + Diags.setMaskMeta("ti.ipc.family.omapl138.VirtQueue", Diags.USER1, + Diags.ALWAYS_ON); +} +else if (Program.platformName.match(/6614/)) { + var VirtQueue = xdc.useModule('ti.ipc.family.tci6614.VirtQueue'); + var Interrupt = xdc.useModule('ti.ipc.family.tci6614.Interrupt'); + + /* Note: MultiProc_self is set during VirtQueue_init based on DNUM. */ + var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc'); + MultiProc.setConfig(null, ["HOST", "CORE0", "CORE1", "CORE2", "CORE3"]); + + Program.sectMap[".text:_c_int00"] = new Program.SectionSpec(); + Program.sectMap[".text:_c_int00"].loadSegment = "L2SRAM"; + Program.sectMap[".text:_c_int00"].loadAlign = 0x400; + + var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi'); + + /* This makes the vrings address range 0xa0000000 to 0xa1ffffff uncachable. + We assume the rest is to be left cacheable. + Per sprugw0b.pdf + 0184 8280h MAR160 Memory Attribute Register 160 A000 0000h - A0FF FFFFh + 0184 8284h MAR161 Memory Attribute Register 161 A100 0000h - A1FF FFFFh + */ + var Cache = xdc.useModule('ti.sysbios.family.c66.Cache'); + /* This doesn't work: + Cache.MAR160_191 = 0xFFFFFFFC; + So, need to do this: + */ + Cache.setMarMeta(0xA0000000, 0x1FFFFFF, 0); + + Program.global.sysMinBufSize = 0x8000; + SysMin.bufSize = Program.global.sysMinBufSize; + + /* Enable Memory Translation module that operates on the Resource Table */ + var Resource = xdc.useModule('ti.ipc.remoteproc.Resource'); + Resource.loadSegment = Program.platform.dataMemory; + + /* COMMENT OUT TO SHUT OFF LOG FOR BENCHMARKS: */ + /* + Diags.setMaskMeta("ti.ipc.family.tci6614.Interrupt", Diags.USER1, + Diags.ALWAYS_ON); + Diags.setMaskMeta("ti.ipc.family.tci6614.VirtQueue", Diags.USER1, + Diags.ALWAYS_ON); + Diags.setMaskMeta("ti.ipc.transports.TransportVirtio", + Diags.INFO|Diags.USER1|Diags.STATUS, + Diags.ALWAYS_ON); + Diags.setMaskMeta("ti.ipc.namesrv.NameServerRemoteRpmsg", Diags.INFO, + Diags.ALWAYS_ON); + */ +} +else if (Program.platformName.match(/simKepler/)) { + var VirtQueue = xdc.useModule('ti.ipc.family.tci6638.VirtQueue'); + var Interrupt = xdc.useModule('ti.ipc.family.tci6638.Interrupt'); + + /* Note: MultiProc_self is set during VirtQueue_init based on DNUM. */ + var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc'); + MultiProc.setConfig(null, ["HOST", "CORE0", "CORE1", "CORE2", "CORE3", + "CORE4", "CORE5", "CORE6", "CORE7"]); + Program.sectMap[".text:_c_int00"] = new Program.SectionSpec(); + Program.sectMap[".text:_c_int00"].loadSegment = "L2SRAM"; + Program.sectMap[".text:_c_int00"].loadAlign = 0x400; + + var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi'); + + /* This makes the vrings address range 0xa0000000 to 0xa1ffffff uncachable. + We assume the rest is to be left cacheable. + Per sprugw0b.pdf + 0184 8280h MAR160 Memory Attribute Register 160 A000 0000h - A0FF FFFFh + 0184 8284h MAR161 Memory Attribute Register 161 A100 0000h - A1FF FFFFh + */ + var Cache = xdc.useModule('ti.sysbios.family.c66.Cache'); + /* This doesn't work: + Cache.MAR160_191 = 0xFFFFFFFC; + So, need to do this: + */ + /* TBD: Update for Kepler: */ + Cache.setMarMeta(0xA0000000, 0x1FFFFFF, 0); + + Program.global.sysMinBufSize = 0x8000; + SysMin.bufSize = Program.global.sysMinBufSize; + + /* Enable Memory Translation module that operates on the Resource Table */ + var Resource = xdc.useModule('ti.ipc.remoteproc.Resource'); + Resource.loadSegment = Program.platform.dataMemory; + + /* COMMENT OUT TO SHUT OFF LOG FOR BENCHMARKS: */ + /* + Diags.setMaskMeta("ti.ipc.family.tci6638.Interrupt", Diags.USER1, + Diags.ALWAYS_ON); + Diags.setMaskMeta("ti.ipc.family.tci6638.VirtQueue", Diags.USER1, + Diags.ALWAYS_ON); + Diags.setMaskMeta("ti.ipc.transports.TransportVirtio", + Diags.INFO|Diags.USER1|Diags.STATUS, + Diags.ALWAYS_ON); + Diags.setMaskMeta("ti.ipc.namesrv.NameServerRemoteRpmsg", Diags.INFO, + Diags.ALWAYS_ON); + */ +} +else if (Program.platformName.match(/OMAP5/)) { + var Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi'); + + /* Modules used in Power Management */ + xdc.loadPackage('ti.pm'); + var Power = xdc.useModule('ti.sysbios.family.arm.ducati.omap4430.Power'); + Power.loadSegment = "PM_DATA"; + /* IpcPower idle function must be at the end */ + Idle.addFunc('&IpcPower_idle'); + + xdc.includeFile("ti/configs/omap4430/DucatiCore0.cfg"); + xdc.includeFile("ti/configs/omap4430/DucatiAmmu.cfg"); +} +else { + throw("messageq_common.cfg: Did not match any platform!"); +} + +Hwi.enableException = true; + +xdc.loadPackage('ti.ipc.ipcmgr'); +BIOS.addUserStartupFunction('&IpcMgr_rpmsgStartup'); + +xdc.loadPackage('ti.ipc.rpmsg'); + +var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf'); +var List = xdc.useModule('ti.sdo.utils.List'); + +xdc.useModule('ti.sysbios.xdcruntime.GateThreadSupport'); +var GateSwi = xdc.useModule('ti.sysbios.gates.GateSwi'); + +var Task = xdc.useModule('ti.sysbios.knl.Task'); +var params = new Task.Params; +params.instance.name = "ping"; +params.arg0= 51; +//params.arg0= 61; +Program.global.tsk1 = Task.create('&pingTaskFxn', params); +Task.deleteTerminatedTasks = true; + +var Assert = xdc.useModule('xdc.runtime.Assert'); +var Defaults = xdc.useModule('xdc.runtime.Defaults'); +var Diags = xdc.useModule('xdc.runtime.Diags'); +var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys'); +var LoggerSysParams = new LoggerSys.Params(); + +/* Enable Logger: */ +//Defaults.common$.logger = LoggerSys.create(LoggerSysParams); +Defaults.common$.logger = null; + +/* Enable runtime Diags_setMask() for non-XDC spec'd modules: */ +var Text = xdc.useModule('xdc.runtime.Text'); +Text.isLoaded = true; +var Registry = xdc.useModule('xdc.runtime.Registry'); +Registry.common$.diags_INFO = Diags.ALWAYS_ON; +Registry.common$.diags_STATUS = Diags.ALWAYS_ON; +Registry.common$.diags_LIFECYCLE = Diags.ALWAYS_ON; +Diags.setMaskEnabled = true;