-
Type:
Bug
-
Resolution: Fixed
-
Priority:
High
-
SITSW-5931
-
-
10.00.00
-
11.00.00
-
The MCASP_close() function does not complete and is stuck in a for loop for a very long time( tested it with mcasp_loopback and mcasp_chime examples ).
Steps to reproduce the issue -
1. Run the mcasp_loopback example.
2. Place a breakpoint at CSL_lcdma_ringaccDequeue() function [ line 808: csl_lcdma_ringacc.c ]
![]()
3. Run the example and halt at the breakpoint. Observe the variable (pRing->wrOcc).
4. The pRing->wrOcc is taking a very large value (4294967294). Due to which the loop continues for a very very long time before coming to an exit.
![]()
Identified source of bug
We went through the execution sequence of the program, and found out that pRing->wrOcc is modified inside the CSL_lcdma_ringaccAckReverseRing() function [ {{{}csl_lcdma_ringacc.h{}}}, line 602]. If we examine the function we can see that it subtracts the value cnt }}from {{pRing->wrOcc [ line 623: pRing->wrOcc = (uint32_t)cnt; ]. On analysis, we found out that pRing>wrOcc had an initial value of 0 and when cnt(=1) was subtracted from pRing->wrOcc, it got modified to 4294967294 due to wrap-around in uint_32t.
![]()
[ Note - The pRing->wrOcc needs to be incremented before DMA operation start. But found out that it was not incremented, before it got decremented by the CSL_lcdma_ringaccAckReverseRing() function (line 623: csl_lcdma_ringacc.h ).
I also inspected the Udma_ringSetDoorBellLcdma() function ( line 300 : udma_ring_lcdma.c ) and found out that the line 300 (pRing->wrOcc += (uint32_t)count_val; ) increments the pRing->wrOcc, but at the time of increment the count_val variable takes the value 0. ]
Udma_ringSetDoorBellLcdma