Hi,
I am trying an application on OMAP-L138 EVM board which uses Syslink (version 2.20.02.20) for IPC between the Host (ARM) and the DSP (C648).
On the Linux side, I am using the rootfs which came with tv-dvsdk_omapl138-evm_04_03_00_06 and a newer kernel which comes with DaVinci-PSP-SDL-03.22.00.02
uname -a shows
Linux arago 3.3.0 #1 PREEMPT Tue Oct 30 11:24:08 PDT 2012 armv5tejl unknown
I have tried the examples which come with Syslink release and they all work. I was particularly interested in the MessageQ example as my application uses MessageQ (with a slight difference that the example uses HeapBufMP and I use HeapMemMP in my application)
So, I copied the config.bld and relevant portions of the cfg file from that example to build the DSP side of my application. I have also implemented Ipc_start()/Ipc_attach() in a task on the DSP side.
On the Linux side, I do the host side calls like Syslink_setup() followed by Ipc_control(LOADCALLBACK) and then Ipc_control(STARTCALLBACK).
To run, doing the following steps
- use slaveloader to load the DSP and start it
- start the Linux side application from a telnet shell
On the Linux side, the code hangs in the call to Ipc_control(STARTCALLBACK).
On the DSP side, I loaded the code using CCS + XDS510 (before doing the slaveloader above) and saw that the code was spinning in Ipc_start()). So, I am guessing it is looping in the same when loaded via slaveloader as well although I am not sure and that is one of the help requests below
Questions:
---------------
1. In this mode, what is the best way to get logs from the DSP side? i.e., slaveloader loads the DSP and starts it. If DSP does a printf/Log_info, what is the best way to get at those logs? Can I connect CCS to a running DSP code and get logs? If yes, can you please point me to some documentation on how to do it? in general, ways to debug such applications involving both DSP and ARM
2. Anything obvious that jumps out I could be doing wrong compared to the example which would cause Ipc_start() to hang? I tried an experiment where I used the Linux code from my application and the DSP side code from the MessageQ example. With this setup, the Linux code got past STARTCALLBACK. This seems to point out that I am doing something wrong on the DSP side. I am cutting and pasting relevant sections from the cfg file, config.bld file and my source code
Please let me know if you need further information.
Greatly appreciate any help in this regard.
Cheers,
-raja.
cfg file
____________________________________________
/*
* ======== IPC Configuration ========
*/
/* required because SysLink is running on the host processor */
xdc.useModule('ti.syslink.ipc.rtos.Syslink');
/* configure processor names */
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
var procNameAry = MultiProc.getDeviceProcNames();
MultiProc.setConfig("DSP", procNameAry);
/* ipc configuration */
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
/* ipc setup for SR0 Memory (host processor not running Sys/Bios) */
Ipc.sr0MemorySetup = false;
/* set ipc sync to pair, requiring Ipc_attach() call on all processors */
Ipc.procSync = Ipc.ProcSync_PAIR;
/* define host processor */
Ipc.hostProcId = MultiProc.getIdMeta("HOST");
/* shared region configuration */
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
/* configure SharedRegion #0 (IPC) */
var SR0Mem = Program.cpu.memoryMap["SR_0"];
SharedRegion.setEntryMeta(0,
new SharedRegion.Entry({
name: "SR0",
base: SR0Mem.base,
len: SR0Mem.len,
ownerProcId: MultiProc.getIdMeta("HOST"),
cacheEnable: false,
isValid: true
})
);
/* configure SharedRegion #1 (MessageQ Buffers) */
var SR1Mem = Program.cpu.memoryMap["SR_1"];
SharedRegion.setEntryMeta(1,
new SharedRegion.Entry({
name: "MessageQ Buffers",
base: SR1Mem.base,
len: SR1Mem.len,
ownerProcId: MultiProc.getIdMeta("HOST"),
cacheEnable: false,
isValid: true
})
);
/* configure external memory cache property
*
* C000_0000 - C7FF_FFFF 800_0000 ( 128 MB) Cache.MAR192_223
* ----------------------------------------------------------------------------
* C000_0000 - C1FF_FFFF 200_0000 ( 32 MB) -------- don't care
* C200_0000 - C202_FFFF 3_0000 ( 192 KB) SR_0, SR-1 no-cache MAR194
* C203_0000 - C2FF_FFFF FD_0000 ( ~15 MB) -------- no-cache MAR194
* C300_0000 - C37F_FFFF 80_0000 ( 8 MB) DSP_PROG cache enable MAR195
* C380_0000 - C3FF_FFFF 80_0000 ( 8 MB) -------- cache enable MAR195
* C400_0000 - C7FF_FFFF 400_0000 ( 64 MB) -------- don't care
*/
Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
Cache.MAR192_223 = 0x00000008; /* xxxx xxxx xxxx xxxx xxxx xxxx xxxx 10xx */
config.bld
_______________________________________________________________
/*
* ======== config.bld ========
*
*/
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
/* Memory Map for ti.platforms.evmOMAPL138
*
* C000_0000 - C7FF_FFFF 800_0000 ( 128 MB) External Memory
* ------------------------------------------------------------------------
* C000_0000 - C1FF_FFFF 200_0000 ( 32 MB) Linux
* C200_0000 - C200_FFFF 1_0000 ( 64 KB) SR_0 (ipc)
* C201_0000 - C202_FFFF 2_0000 ( 128 KB) SR_1 (MessageQ buffers)
* C203_0000 - C2FF_FFFF FF_0000 ( ~15 MB) --------
* C300_0000 - C3FF_FFFF 100_0000 ( 16 MB) DSP_PROG (code, data)
* C400_0000 - C7FF_FFFF 400_0000 ( 64 MB) Linux
*/
var SR_0 = {
name: "SR_0", space: "data", access: "RWX",
base: 0xC2000000, len: 0x10000,
comment: "SR#0 Memory (64 KB)"
};
var SR_1 = {
name: "SR_1", space: "data", access: "RWX",
base: 0xC2010000, len: 0x20000,
comment: "SR#1 Memory (128 KB)"
};
Build.platformTable["ti.platforms.evmOMAPL138:dsp"] = {
externalMemoryMap: [
[ SR_0.name, SR_0 ],
[ SR_1.name, SR_1 ],
[ "DSP_PROG", {
name: "DSP_PROG", space: "code/data", access: "RWX",
base: 0xC3000000, len: 0x1000000,
comment: "DSP Program Memory (16 MB)"
}]
],
codeMemory: "DSP_PROG",
dataMemory: "DSP_PROG",
stackMemory: "DSP_PROG",
l1DMode: "32k",
l1PMode: "32k",
l2Mode: "32k"
};
/*
* ======== ti.targets.elf.C674 ========
*/
var C674 = xdc.useModule('ti.targets.elf.C674');
C674.ccOpts.suffix += " -mi10 -mo ";
Build.targets.$add(C674);
Relevant source code
____________________________________________________
do
{
status = Ipc_start();
} while (status == Ipc_E_NOTREADY);
if (status < 0)
{
Log_error0("Ipc_start() failed");
goto leave;
}
/* attach to the remote processor */
remoteProcId = MultiProc_getId("HOST");
/* connect to remote processor */
do
{
status = Ipc_attach(remoteProcId);
if (status == Ipc_E_NOTREADY) {
Task_sleep(100);
}
} while (status == Ipc_E_NOTREADY);
if (status < 0)
{
Log_error0("Ipc_attach() failed");
goto leave;
}