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.

I2S DMA problem

Guru 15580 points

I am having trouble getting DMA to work on the ezdsp board. Since the AIC3204 is configured as a Master device, I have set up the I2S0 as follows:

/* I2S settings */
I2S0_SRGR = 0x0; // sample rate generator, not active in slave mode
I2S0_CR = 0x8010; // 16-bit word, slave, enable I2C
I2S0_ICMR = 0x3F; // Enable interrupts (I2SINTMASK)

I have configured DMA0 for "manual" ping-pong operation (not using the PP bits in DMA) using DMA0 ch0, 1, 2, &3.

And I have configured the DMA0 controller channels 0 & 1 to trigger on I2S0 tx events, and channels 2 & 3 to trigger on I2S0 rx events. 

I have set the DMA0 ch 0 & 1 destination addresses to the I2S L & R data registers, and source addresses to the output buffer in RAM . 

I have set the DMA0 ch 2 & 3 destination addresses to the input buffer in RAM,and the source addresses to the I2S0 L & R input data registers.

I can monitor the I2S events via my DMA ISR. Each event is triggering an interrupt, which I service. I then clear the interrupt flags for the triggered event.

HOWEVER, NO DATA IS TRANSFERRED on either the input or output DMA transfer.

Does anyone have any suggestions what could be going wrong?

  • Hi Mike,

    You should make sure that your codec is generating I2S waveforms by probing it.

    Perhaps the EBSR register SP0MODE is not routing your I2S0 signals out of Serial Port 0 pins.

    There is C5505 code on code.google.com that supports I2S0 slave and master, with and without DMA (in manual ping-pong mode). The code is a little ugly (not using CSL), but it might give you good insight.

    http://c5505-ezdsp.googlecode.com/files/USB_Stick_AudioFilter1.zip

    Refer also to SPRUFX4A - 1.2.14 Steps for I2S Configuration and I2S Interrupt Service Routine (ISR)

    Hope this helps,
    Mark

  • Mike,

    Just realized...

    Your I2SSCTRL register settings look good, but I2SINTMASK has all bits set, which wont work with DMA events.

    Do not enable stereo/mono TX or RX interrupts if DMA is used for data transfers.

    Regards,
    Mark

  • Mark,

    Mark Mckeown said:
    You should make sure that your codec is generating I2S waveforms by probing it.

    Have done this. BKLK=OK, WCLK=OK, data out from 3204=OK, data out of C5515=NONE.

    Mark Mckeown said:
    Perhaps the EBSR register SP0MODE is not routing your I2S0 signals out of Serial Port 0 pins.

    EBSR = 0x5900.

    Mark Mckeown said:
    There is C5505 code on code.google.com that supports I2S0 slave and master, with and without DMA (in manual ping-pong mode). The code is a little ugly (not using CSL), but it might give you good insight.

    This is where I got the code.

    Mark Mckeown said:
    Refer also to SPRUFX4A - 1.2.14 Steps for I2S Configuration and I2S Interrupt Service Routine (ISR)

    Been there, done that.

    This has to be something simple. It worked before I "broke" it. FYI I don't see DMACHOTCR2-EN being cleared after a DMA transfer. I also don't understand the meaning of "DISABLE" in the register view window.

  • Mark,

    Mark Mckeown said:
    Your I2SSCTRL register settings look good, but I2SINTMASK has all bits set, which wont work with DMA events.

    Sorry, I originally had them set to 0x00, but set them to 0x3f as a test to see if that was the problem. Unfortunately, changing them back to 0x00 does not help. Do I need to enable synch events for them to become active? Or are the always active by default?

  • ...and the answer is......

    During a reshuffling of my memory allocation I had inadvertently switched my DMA ram buffers from DRAM to SRAM and failed to change the memory offset. All is working properly now.

  • Hi Mike,


    Do you have source code for this you are willing to share? I am trying ot set up DMA ping pong buffering with I2S in the C5535, but I am having one heck of a time getting it working.

    It would be much appreciated!!

    Regards,
    Nate 

  • Nathan,

    My DMA source code comes from the example code in http://c5505-ezdsp.googlecode.com/files/USB_Stick_AudioFilter1.zip

    Mike

  • MikeH said:

    My DMA source code comes from the example code in http://c5505-ezdsp.googlecode.com/files/USB_Stick_AudioFilter1.zip

    Mike



    Thanks for the timely response Mike -
    Did you use this code unmodified with the 5535 (or did you modify it to work with the 5535)? If so, what portions of the code needed to be modified - and is it possible to share the modified project code?

    Thanks!

    Nate