Hello,
We face a realtime problem in our product using DSPLINK on a OMAP L138 chip.
We only use DSPLINK MSGQ component to make both ARM/DSP applications communicate. Up to 5 MSGQs are used with a single pool to allocate messages (of various size). Within both applications, 1 task receive messages from all MSGQs and deliver it. At contrary, more tasks can directly use MSGQs for sending.
Under normal activity, several 1 second messages are exchanged from ARM application to DSP one. We noticed that after several hours running that periodic tasks (P=1ms) within DSP application are delayed for more than 2ms missing so their deadlines.
If i understood it well, DSPLINK/MSGQ use a task to process received messages (combined with an ISR), which priority is the highest one in DSP application. This task use MPCS to safely access shared data with ARM. MPCS_enter function implements a Petterson algorithm to guarantee exclusive access to these data. Here is peace of code within MPCS_enter i am taking about:
Uint32 timeout = MPCS_CONTENTION_POLLCOUNT;
...
/* Wait while other process is using the resource and has the turn. */ while ( (mpcsHandle->gppMpcsObj.flag == MPCS_BUSY) && (mpcsHandle->turn != SELF)) { HAL_cacheInv ((Ptr) mpcsHandle, sizeof (MPCS_ShObj)) ; #if defined (DDSP_PROFILE) conflictFlag = TRUE ; #endif /* if defined (DDSP_PROFILE) */ sleepcount++; if ((timeout != 0xFFFFFFFFl ) && (sleepcount == timeout)){ #if defined (DSP_TSK_MODE) TSK_sleep (1); #else /* if defined (DSP_TSK_MODE) */ #endif /* if defined (DSP_TSK_MODE) */ sleepcount = 0; timeout = timeout >> 1; } }
When probem is detected, we track down that the DSPLINK task in DSP application execute for more than 2ms spinsing in MPCS_enter before doing TSK_sleep (due to timeout value of MPCS_CONTENTION_POLLCOUNT). Because this task is the highest priority in application, it prevents other tasks execution.
I understand the goal of this algorithm but i'd like to know how MPCS_CONTENTION_POLLCOUNT was choosed ? Because it leads to 2ms spisning, i'm planning to lower its value and so reduce active wait time.
Do you think it's the right solution or is there other way to prevent DSPLINK task to execute for 2ms ? (We are currently tracking on ARM side what can block MPCS that long)
Here are versions of softwares we use:
DSPLINK 1.65.01.06
DSPBIOS 5.42.00.7
C6000 compiler 7.4.2
XDC tools 3.23.00.32
Benoît