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.

McASP & EDMA, loosing audio samples

Hello,

We use a custom board based on DSP TMS320DM642AGNZ (A5, 2003, CC-28C5FFW) and we have an issue in production - around 10-30% of boards do not pass audio quality test. After investigation we discovered that samples are dropped occasionally at a rate around 1-3 samples per 10000 inside of the DSP. For those boards which pass the test the problem is never reproducible.

We have checked signals integrity and everything seems o.k. The DSP temperature has no effect.
We also checked that McASP does not report Frame or EDMA errors.

We found a workaround which seems to be working, but we need your help to understand what is happening. And eventually we have to decide weather we should allow these cards in production.

In our configuration we use McASP to communicate with two codecs AIC23. In further tests we will be using digital loopback at DSP level, so codecs are not required to reproduce the issue.

McASP configuration:
- external clock 12.288MHz is taken from AHCLKX0
- ACLKR0, AHCLKR0,AMUTE,AMUTEIN are not used and not connected
- AFSR0, AFSX0 pins are connected together on the board.
- Master mode, Frame Sync and BCLK are generated by DSP
- TDM mode, 32KHz frame rate, 3072MHz BCLK, 6 time slots from which only 2 are active
- 16 bit sample size

EDMA configuration:
- Four channels are configured to serve two serializers: EDMA_CHA_AXEVTO0, EDMA_CHA_AXEVTE0, EDMA_CHA_AREVTO0, EDMA_CHA_AREVTE0.
- Linking is used to alternate two (ping-pong) buffers for each channel.
- Buffers are located in internal SRAM.
- The interrupt is set for each 512 samples.

We found several case which makes the issue disappear:
- TDM mode, FS 32kHz, 1024MHz BCLK (instead of 3072MHz), 2 time slots
or
- Using internal clock instead of external AHCLKX0 (external signal quality has been certified by our expert). 

To help investigate the issue I stripped the production code to make a minimal test application, which you can find in the attachment. It does not depend on any external hardware (except for external clock 12.288MHz on AHCLKX0 pin).


Software tools description
- Code Composer version 3.1.23
- Code Generation Tools 5.1.10

Thank you

Best regards,
Dzmitry

mcasp-test.zip
  • Hello,

    We narrowed down the problem a bit.
    As I mentioned, in our setup two EDMA channels serve events AREVTO and AREVTE (odd and even), generated by McASP. The events are supposed to alternate, but occasionally McASP sends AXEVTE instead of AXEVTO.
    As the result, wrong EDMA channel steals a sample from RBUF and places it in wrong buffer.
    This is an assumption, but so far it is the only explanation, which can expain the result.

    I will summarize the facts:
    - The issue is not reproduced when single codec (serializer) is used, it appears when second serializer is added.
    - Only even EDMA channel steals data (AXEVTE event)
    - The issue is not reproduced if we have single EMDA channel to serve AREVT event (scenario 1, described in SPRU041J).
    - The issue is reproduced when external clock is used (12.288MHz at AHCLKX0) and never with internal clock
    - The issue is reproduced for McASP configuration "FS 32kHz, 3072MHz BCLK, 2 timeslots active out of 6" and never for the configuration "FS 32kHz, 1024MHz BCLK, 2 timeslots active out of 2"

    At this point, we need your help to qualify the issue. If there is a chance to step on a bug in DSP? Damaged DSP? Or something wrong with the assembly?
    Under which conditions McASP can generate wrong event?

    Thank you.

    Best regards,
    Dzmitry