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.

RTOS/TMS320C5534: I2S / DMA transfer in ping pong mode issue

Part Number: TMS320C5534

Tool/software: TI-RTOS


I am trying to setup a DMA transfer from an incoming I2S stream (I2S1) into a buffer for processing. I would like to use the ping-pong mode, but unfortunately i am unable to do so.

Normal DMA transfer is working correctly, data are correctly appearing on my buffer. However, whatever the various combinations I tried, only half of a buffer is used.

This is my settings for DMA (I am using CSL 3.0.8)

    // I2S0 (Codec I2S port)
    // Channel 0: From I2S to PP_CodecUL
    // (allowed channels 0..3 - DMA0)

    dmaConfig.pingPongMode  = CSL_DMA_PING_PONG_ENABLE;
    dmaConfig.autoMode      = CSL_DMA_AUTORELOAD_ENABLE;
    dmaConfig.burstLen      = CSL_DMA_TXBURST_1WORD;
    dmaConfig.trigger       = CSL_DMA_EVENT_TRIGGER;
    dmaConfig.dmaInt        = CSL_DMA_INTERRUPT_ENABLE;
    dmaConfig.dataLen       = PP_SIZE;
    dmaConfig.trfType       = CSL_DMA_TRANSFER_IO_MEMORY;

    dmaConfig.chanDir       = CSL_DMA_READ;
    dmaConfig.dmaEvt        = CSL_DMA_EVT_I2S0_RX;              // Microphone on I2S1 (CSL_DMA_EVT_I2S0_RX)
    dmaConfig.srcAddr       = (Uint32)(0x2828);// I2S0 Receive left Data 0 Register
    dmaConfig.destAddr      = (Uint32)PP_codecUL;

    hDMA_CodecUL = DMA_open(CSL_DMA_CHAN0, &dmaCodecUL_Obj, &status);
    DMA_config(hDMA_CodecUL, &dmaConfig);

the lengh PP_SIZE is equal to the total length in bytes of the PING+PONG buffers, nevertheless only the first half of my buffer seem to be used.

When breaking at the first DMA interrupt, i clearly see the first half of the buffer to be earsed, so i was expecting to see the 2nd half filled at the second

DMA interrupt, nope. Only the first half is constantly re-used.

Any idea ?