I have an omapl138 board, and use dsplink_linux_1_65_00_02
The sample run correctly under kernel 2.6.33
But when I patch kernel to 2.6.33-rt8, the sample code hang after call PROC_start function.
I use PREMPT_RT patch.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I have an omapl138 board, and use dsplink_linux_1_65_00_02
The sample run correctly under kernel 2.6.33
But when I patch kernel to 2.6.33-rt8, the sample code hang after call PROC_start function.
I use PREMPT_RT patch.
Lei,
Could you please provide some dsplink trace so we might have a better idea as to why this is hanging? You can follow the instructions here for enabling trace in dsplink:
http://processors.wiki.ti.com/index.php/Enabling_trace_in_DSPLink
You will to run your app with the rebuilt trace-enabled dsplink.ko.
Thanks,
Janet
Here is the trace
/project # insmod dsplinkk.ko
/project # mknod /dev/dsplink c 230 0
/project # ./loopgpp loop.out 1024 1
=============== Sample Application : LOOP ==========
==== Executing sample for DSP processor Id 0 ====
Entered LOOP_Create ()
Entered PROC_setup ()
linkCfg [0x0]
Entered DRV_Initialize ()
drvObj [0x28744]
arg [0x0]
Leaving DRV_Initialize () status [0x8000]
Entered DRV_ProtectInit ()
drvObj [0x29008]
Leaving DRV_ProtectInit () status [0x8000]
Entered DRV_ProtectEnter ()
drvObj [0x29008]
Leaving DRV_ProtectEnter () status [0x8000]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e011]
arg1 [0xbe862c30]
arg2 [0x0]
Entered DRV_installCleanupRoutines ()
linkCfgPtr [0x28710]
Leaving DRV_installCleanupRoutines ()
osStatus: 0
Entered _POOL_init ()
Leaving _POOL_init ()
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered _MEM_USR_init ()
Leaving _MEM_USR_init () status [0x8000]
Entered _IDM_USR_init ()
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e053]
arg1 [0xbe862c04]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _IDM_USR_init () status [0x8000]
Entered _SYNC_USR_init ()
Entered _IDM_USR_create ()
key [0x10080]
attrs [0xbe862c0c]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e055]
arg1 [0xbe862be4]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _IDM_USR_create () status [0x8000]
Leaving _SYNC_USR_init () status [0x8000]
Entered _SYNC_USR_createCS ()
idKey [0x25164]
csObj [0x2874c]
Entered _IDM_USR_acquireId ()
key [0x10080]
idKey [0x25164]
id [0xbe862c10]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e057]
arg1 [0xbe862be4]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _IDM_USR_acquireId () status [0x8000]
Leaving _SYNC_USR_createCS () status [0x8000]
Entered DRV_ProtectLeave ()
drvObj [0x29008]
Leaving DRV_ProtectLeave () status [0x8000]
Entered PROC_resetCurStatus ()
Leaving PROC_resetCurStatus ()
Leaving PROC_setup () status [0x8000]
Entered PROC_attach ()
procId [0x0]
attr [0x0]
Entered DRV_Initialize ()
drvObj [0x28744]
arg [0x0]
Entered _SYNC_USR_enterCS ()
csObj [0x29020]
Leaving _SYNC_USR_enterCS () status [0x8000]
Entered _SYNC_USR_leaveCS ()
csObj [0x29020]
Leaving _SYNC_USR_leaveCS () status [0x8000]
Leaving DRV_Initialize () status [0x8000]
Entered _SYNC_USR_enterCS ()
csObj [0x29020]
Leaving _SYNC_USR_enterCS () status [0x8000]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e018]
arg1 [0xbe862c2c]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered _NOTIFY_init ()
dspId [0x0]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e049]
arg1 [0xbe862be4]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _NOTIFY_init () status [0x8000]
Entered _MPCS_init ()
procId [0x0]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e047]
arg1 [0xbe862bf8]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered _MPCS_open ()
procId [0x0]
name [0x237d0]
mpcsHandle [0x28e9c]
mpcsShObj [0x40984180]
Entered _MPCS_OS_open ()
procId [0x0]
name [0x237d0]
mpcsHandle [0x28e9c]
mpcsShObj [0x40984180]
Entered _MEM_USR_calloc ()
ptr [0x28e9c]
bytes [0x10]
_MEM_USR_calloc *ptr [0x290c8]
Leaving _MEM_USR_calloc () status [0x8000]
Entered _SYNC_USR_createCS ()
idKey [0x237d0]
csObj [0x290cc]
Entered _IDM_USR_acquireId ()
key [0x10080]
idKey [0x237d0]
id [0xbe862b70]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e057]
arg1 [0xbe862b44]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _IDM_USR_acquireId () status [0x8000]
Leaving _SYNC_USR_createCS () status [0x8000]
Leaving _MPCS_OS_open () status [0x8000]
Leaving MPCS_open () status [0x8000]
Leaving _MPCS_init () status [0x8000]
Entered _MPLIST_moduleInit ()
procId [0x0]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e051]
arg1 [0xbe862be0]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered MPCS_create ()
procId [0x0]
name [0x23dd0]
mpcsShObj [0x40021380]
attrs [0xbe862bde]
Entered MPCS_enter ()
mpcsHandle [0x290c8]
Entered _MPCS_OS_enter ()
procId [0x0]
mpcsHandle [0x290c8]
Entered _SYNC_USR_enterCS ()
csObj [0x290e0]
Leaving _SYNC_USR_enterCS () status [0x8000]
Leaving _MPCS_OS_enter () status [0x8000]
Leaving MPCS_enter () status [0x8000]
Entered MPCS_leave ()
mpcsHandle [0x290c8]
Entered _MPCS_OS_leave ()
procId [0x0]
mpcsHandle [0x290c8]
Entered _SYNC_USR_leaveCS ()
csObj [0x290e0]
Leaving _SYNC_USR_leaveCS () status [0x8000]
Leaving _MPCS_OS_leave () status [0x8000]
Leaving MPCS_leave () status [0x8000]
Leaving MPCS_create () status [0x8000]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e052]
arg1 [0xbe862be0]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _MPLIST_moduleInit () status [0x8000]
Entered _RingIO_moduleInit ()
procId [0x0]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e04f]
arg1 [0xbe862be0]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered MPCS_create ()
procId [0x0]
name [0x25710]
mpcsShObj [0x40021400]
attrs [0xbe862bde]
Entered MPCS_enter ()
mpcsHandle [0x290c8]
Entered _MPCS_OS_enter ()
procId [0x0]
mpcsHandle [0x290c8]
Entered _SYNC_USR_enterCS ()
csObj [0x290e0]
Leaving _SYNC_USR_enterCS () status [0x8000]
Leaving _MPCS_OS_enter () status [0x8000]
Leaving MPCS_enter () status [0x8000]
Entered MPCS_leave ()
mpcsHandle [0x290c8]
Entered _MPCS_OS_leave ()
procId [0x0]
mpcsHandle [0x290c8]
Entered _SYNC_USR_leaveCS ()
csObj [0x290e0]
Leaving _SYNC_USR_leaveCS () status [0x8000]
Leaving _MPCS_OS_leave () status [0x8000]
Leaving MPCS_leave () status [0x8000]
Leaving MPCS_create () status [0x8000]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e050]
arg1 [0xbe862be0]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _RingIO_moduleInit () status [0x8100]
Entered _MPLIST_init ()
procId [0x0]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e051]
arg1 [0xbe862bf8]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered _MPCS_open ()
procId [0x0]
name [0x23dd0]
mpcsHandle [0x28b2c]
mpcsShObj [0x40021380]
Entered _MPCS_OS_open ()
procId [0x0]
name [0x23dd0]
mpcsHandle [0x28b2c]
mpcsShObj [0x40021380]
Entered _MEM_USR_calloc ()
ptr [0x28b2c]
bytes [0x10]
_MEM_USR_calloc *ptr [0x290f8]
Leaving _MEM_USR_calloc () status [0x8000]
Entered _SYNC_USR_createCS ()
idKey [0x23dd0]
csObj [0x290fc]
Entered _IDM_USR_acquireId ()
key [0x10080]
idKey [0x23dd0]
id [0xbe862b70]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e057]
arg1 [0xbe862b44]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _IDM_USR_acquireId () status [0x8000]
Leaving _SYNC_USR_createCS () status [0x8000]
Leaving _MPCS_OS_open () status [0x8000]
Leaving MPCS_open () status [0x8000]
Leaving _MPLIST_init () status [0x8000]
Entered _RingIO_init ()
procId [0x0]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e04f]
arg1 [0xbe862bf8]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered _MPCS_open ()
procId [0x0]
name [0x25710]
mpcsHandle [0x28ebc]
mpcsShObj [0x4098d400]
Entered _MPCS_OS_open ()
procId [0x0]
name [0x25710]
mpcsHandle [0x28ebc]
mpcsShObj [0x4098d400]
Entered _MEM_USR_calloc ()
ptr [0x28ebc]
bytes [0x10]
_MEM_USR_calloc *ptr [0x29128]
Leaving _MEM_USR_calloc () status [0x8000]
Entered _SYNC_USR_createCS ()
idKey [0x25710]
csObj [0x2912c]
Entered _IDM_USR_acquireId ()
key [0x10080]
idKey [0x25710]
id [0xbe862b70]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e057]
arg1 [0xbe862b44]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving _IDM_USR_acquireId () status [0x8000]
Leaving _SYNC_USR_createCS () status [0x8000]
Leaving _MPCS_OS_open () status [0x8000]
Leaving MPCS_open () status [0x8000]
Leaving _RingIO_init () status [0x8100]
Entered _SYNC_USR_leaveCS ()
csObj [0x29020]
Leaving _SYNC_USR_leaveCS () status [0x8000]
Leaving PROC_attach () status [0x8000]
Entered POOL_open ()
poolId [0x0]
params [0xbe862c78]
Entered _SYNC_USR_enterCS ()
csObj [0x29020]
Leaving _SYNC_USR_enterCS () status [0x8000]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e03f]
arg1 [0xbe862c28]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered _SYNC_USR_leaveCS ()
csObj [0x29020]
Leaving _SYNC_USR_leaveCS () status [0x8000]
Leaving POOL_open () status [0x8000]
Entered PROC_load ()
procId [0x0]
imagePath [0xbe862f69]
argc [0x2]
argv [0xbe862c8c]
Entered _SYNC_USR_enterCS ()
csObj [0x29020]
Leaving _SYNC_USR_enterCS () status [0x8000]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e015]
arg1 [0xbe862c2c]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Entered _SYNC_USR_leaveCS ()
csObj [0x29020]
Leaving _SYNC_USR_leaveCS () status [0x8000]
Leaving PROC_load () status [0x8000]
Entered CHNL_create ()
procId [0x0]
chnlId [0x0]
attrs [0xbe862c94]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e024]
arg1 [0xbe862c3c]
arg2 [0x0]
Status: 8000
Leaving DRV_Invoke () status [0x8000]
Leaving CHNL_create () status [0x8000]
Entered CHNL_create ()
procId [0x0]
chnlId [0x1]
attrs [0xbe862ca0]
Entered DRV_Invoke ()
drvObj [0x29008]
cmdId [0xc018e024]
arg1 [0xbe862c3c]
arg2 [0x0]
Status: 800
It seem that the code hang in dsplink_linux_1_65_00_02\dsplink\gpp\src\ldrv\drv\Shm_drv.c -- SHMDRV_handshake function
while ( (ctrlPtr->handshakeDsp != dspHandshake)
&& DSP_SUCCEEDED (status)) {
i++ ;
if ( (linkDrv->hshkPollCount != (Uint32) -1)
&& (i == linkDrv->hshkPollCount)) {
status = DSP_ETIMEOUT ;
SET_FAILURE_REASON ;
}
}
I toggle a pin before i++, it success at first time, but stop after then.
Lei,
This looks like user side trace only, and unfortunately it doesn't tell me anything about why your app is hanging. Sorry if the instructions for enabling trace were not very clear. Here is what you need to do to enable kernel side trace in syslink:
1. Run the perl script, dsplink/config/bin/dsplinkcfg.pl, as you did before, but add the option --trace=1. Please see the DspLink User's Guide for usage of this script.
2. Edit the file dsplink/gpp/src/pmgr/Linux/2.6.18/drv_pmgr.c, and uncomment these lines:
/* TRC_ENABLE (ID_PMGR_PROC) ; */
/* TRC_ENABLE (ID_LDRV_PROC) ; */
/* TRC_SET_SEVERITY (TRC_ENTER) ; */
3. Rebuild and insmod the dsplinkk.ko
Hopefully that should give some more information into why you're hanging in PROC_start().
Best regards,
Janet
Janet
I use a debugger connect to dsp, and show memory c3f05100, the location include gpp and dsp handshake value.
gpp handshake value: c0c00000
dsp handshake value: baba01ff
Is that mean arm and dsp handshake successfully?
Lei,
It looks like there is a mismatch in DSPLink configuration between the GPP and the DSP. Check out this for more information:
http://processors.wiki.ti.com/index.php/Troubleshooting_DSPLink_configuration_issues
The DSP handshake value, baba01ff, indicates the DSP side is built with PROC, POOL, MPCS, MPLIST, MSGQ, CHNL, NOTIFY, and RINGIO. That is, when you configured dsplink with the perl script, dsplinkcfg.pl, you had
--comps=ponslrmc
The GPP side was probably built with at different configuration. The GPP handshake, 0xc0c00000 doesn't indicate what components the GPP was built with, but you should be able to find that somewhere in the trace.
Best regards,
Janet
janet
I check the code, GPP handshake does not be modified after change to 0xc0c00000.
And in real-time kernel, printk only send output to buffer, not to console.
I must use dmesg to display printk output.
The arm hang and Ctrl+C is not help, I can not see printk output .
janet
In document DSP/BIOS™ Link Installation Guide, at page 6, it mention
DSP/BIOS Link does not support Complete Preemption (Real-Time)
Is there any reason or technical difficulty?
Lei,
I imagine that this was one of the design tradeoffs in DspLink, but I don't know the details. Did you manage to get beyond the handshaking with the DSP in PROC_start()?
Best regards,
Janet
Janet
I load a led DSP program, and dsp is running correctly, arm is still hang in handshake.
I comment out the following code to skip handshake, but arm always hang, may be something else block the arm.
dsplink_linux_1_65_00_02\dsplink\dsp\src\base\drv\dspbios\Shm_drv.c
Void SHMDRV_handshake (IN Uint32 procId, IN Uint16 dspHandshake)
{
(Void) procId ; /* To avoid compiler warning. */
/* Read the value of token that GPP writes as part of synchronization */
/* do {
HAL_cacheInv ((Void *) SHMDRV_ctrlPtr, sizeof (SHMDRV_Ctrl)) ;
}
while (SHMDRV_ctrlPtr->handshakeGpp != GPP_HANDSHAKE) ;*/
/* Write the value on which GPP is waiting as part of synchronization
* procedure.
*/
/* SHMDRV_ctrlPtr->handshakeDsp |= (DSP_HANDSHAKE | dspHandshake) ;
HAL_cacheWbInv ((Void *) SHMDRV_ctrlPtr, sizeof (SHMDRV_Ctrl)) ;*/
}
dsplink_linux_1_65_00_02\dsplink\gpp\src\ldrv\drv\Shm_drv.c
NORMAL_API
DSP_STATUS
SHMDRV_handshake (IN ProcessorId dspId,
IN Uint32 linkDrvId,
IN DRV_Handshake hshkCtrl)
{
......
/* Wait for DSP to write its handshake value. */
/* while ( (ctrlPtr->handshakeDsp != dspHandshake)
&& DSP_SUCCEEDED (status)) {
i++ ;
if ( (linkDrv->hshkPollCount != (Uint32) -1)
&& (i == linkDrv->hshkPollCount)) {
status = DSP_ETIMEOUT ;
SET_FAILURE_REASON ;
}*/
......
}
Lei,
I will see if I can reproduce this here. It may take a little time to get a board set up, though.
Best regards,
Janet
Janet
I modified dsplink_linux_1_65_00_02\dsplink\gpp\src\osal\linux\2.6.18\Isr.c - EXPORT_API DSP_STATUS ISR_Install (IN Void * hostConfig, IN IsrObject * isrObj)
from
osStatus = request_irq (isrObj->irq,
(Void*)&ISR_Callback,
0,
"DSPLINK",
(void *)isrObj) ;
to
osStatus = request_irq (isrObj->irq,
(Void*)&ISR_Callback,
IRQF_NODELAY,
"DSPLINK",
(void *)isrObj) ;
And the sample can run successfully. Is this modification correct?
Lei,
Sorry for not getting back to you sooner on this. I did manage to get an OMAPL138 board booting with the 2.6.33-rt8 kernel, and I did see the hang occurring after Proc_start(). I believe you are correct in calling request_irq() with IRQF_NODELAY. I was also going to try and replace:
disable_irq (isrObj->irq) with local_irq_save (flags)
and
enable_irq (isrObj->irq) with local_irq_restore ((unsigned long) flags)
That is what we what we have in SysLink. Below is the code we have in SysLink. I believe OsalIsr_disable() corresponds to ISR_Disable(), and OsalIsr_restore() corresponds to ISR_enable().
UInt32 OsalIsr_disable (Void)
{
unsigned long flags = 0;
local_irq_save (flags);
/*! @retval flags State of the interrupts before disable was called. */
return flags;
}
Void OsalIsr_restore (UInt32 flags)
{
local_irq_restore ((unsigned long) flags);
}
You'd need to change the API a bit to save the flags that are possibly changed by local_irq_save(), in order to pass them to local_irq_restore(). I haven't had a chance to try this out, though, but it should be straight forward.
Best regards,
Janet
Lei,
Sorry, but I posted the wrong coded for OsalIsr_disable() and OsalIsr_enable() in my previous message. What I meant was to use raw_local_irq_save() and raw_local_irq_restore(). Here is what is done in SysLink:
UInt32 OsalIsr_disable (Void)
{
unsigned long flags = 0;
#if defined (RT_KERNEL)
raw_local_irq_save (flags);
#else
local_irq_save (flags);
#endif
/*! @retval flags State of the interrupts before disable was called. */
return flags;
}
Void OsalIsr_restore (UInt32 flags)
{
#if defined (RT_KERNEL)
raw_local_irq_restore ((unsigned long) flags);
#else
local_irq_restore ((unsigned long) flags);
#endif
}
We define RT_KERNEL for building with the real-time kernel. But maybe since DspLink is using disable_irq() and enable_irq() that is fine, and you don't need to switch to raw_local_irq_save() and raw_local_irq_restore().
Best regards,
Janet
Lei,
No, I don't think you should replace those calls. I was looking at SysLink support for the real-time kernel and saw that they use raw_local_irq_save() and raw_local_irq_restore() instead of local_irq_save() and local_irq_restore(). DspLink uses disable_irq() and enable_irq() instead. If your app is running fine now, I would say there is no need to replace those functions, but I don't know if there are any issues with these functions and the real-time kernel.
Best regards,
Janet