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.

C5515 DMA to I2S0 Stops when USB Data Transfer Begins


I am streaming audio samples to and from the I2S0 bus using DMA.  I have two audio channels in each direction, 32 bit samples, at 96 kHz.  This is a total data flow of 12.28 Mb/sec.

Each audio channel has it's own DMA channel.  I'm using ping-pong mode, with auto-reload.

I am also set up to stream the audio input out via the USB interface. 

When the data buffers from which the DMA controller loads or stores the samples are located in DARAM, the application works perfectly.  However, if I move the data buffers to their own blocks in SARAM, things work fine until I start to stream the samples out the USB interface.  Then the USB streaming fails, and the DMA halts.

I cannot find any reason for the halt.  As far as I can tell, no error conditions are raised.  All the DMA channels are still enabled, the I2S0 bus is still running and receiving samples.  But none of the DMA source or destination addresses are changing.

I can leave the buffers in DARAM and work around the problem, but still, it is frustrating not to know why the error is happening.

Anyone have any theories? 

 


  • Hello Bill,

    We have seen similar cases and is investigating. Please stay with DARAM to stream DMA data for now. Is it possible to send us your test case?

    My personal email is stsang@ti.com.

    Thanks,

    Steve

  • Hi Steve,

     

    I am also having trouble with the ping pong mode. I'm running I2S port 2 with rx data being DMA'd to memory. I appears to be working in the sense I have known levels tied to my external ADC which the I2S is talking to. I can get 8x 32-bit samples from the adc and they are correct and they do get DMA'd to internal memory. This is also auto reload mode, the I2S is in 'dsp' mode, with MONO sampling. The 32-bits is actually 2x 16-bit adc values from the adc. I can enable DMA ints and setup an int vector and field an interrupt, but it appears to only be 1 interrupt after the full 8x 32-bit xfer takes place. I don;t appear to get 1 interrupt have way thru (ping, after 4 32-bit samples) and then another after the last 4 samples (pong). I have pingpong enabled. i used the CSL example for pingpong, then added in the I2S code from another csl example. I don;t have I2S rx interrupts enabled. Does the ping pong support have known issues?? Please let me (us) know,. Thanks.

     

    Steve V

  • Steve V,

    I am not aware of ping-pong issue. It might be related to register setting.

    Are you using C5515EVM? Can you send me your test case? I will check.

    Regards,

    Steve 

  • Hello Bill & Stephen,

    We are working on hardware fix of this USB DMA to SARAM issue. How is the DARAM workaround with your application? Can you guys provide a status update? My email is stsang@ti.com.

    Thanks,

    Steve

  • Steve,

    I have some fairly large buffer requirements in the application, that exceed the available DARAM.  Rather than use DMA to stream to a small buffer in DARAM, then use the CPU to copy to SARAM, I switched over to an interrupt based solution.  It is not ideal.

    I imagine the hardware fix won't be available for some time?

  • Bill,

    Have you tried hooking the interrupt for the DMA Sync Drop flag?  I have a similar problem related to the EMIF and USB when combining DMA with both.  In my case, the DMA is stopping because of a Sync Drop.  Sounds like you say the DMA is still shown as running, which I suppose is not the same as my issue, but I still thought it worth mentioning the Sync Drop flag and interrupt enable.

    Brian

  • Hi Brian,

    I'm also having similar issues when USB CDMA is involved in this thread

    -> http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/72661/265448.aspx#265448

    in my case I'm trying even plain DMA (non peripheral synchronized) from DARAM to SARAM and when USB CDMA is active there is a lockdown.

     

    Brian, can you please point me where is that SYNC DROP Flag mentioned? I've searched and I could not spot it in the DMA guide (spruft2) or the User Guide (sprufx5)

     

    Christos

     

    PS.

    I ended up with a CPU copy instead of a DMA but that is a major bottleneck

  • Hi Christos,

    I am using the C5506, which has a more elaborate DMA implementation than the C5515.  It seems that my advice was misdirected, because what I am doing on the C5506 is not possible with the C5515.  I searched for "DROP" in the documents that you mentioned, and found the following on page 15 of SPRUFT2:

    The synchronization events are not buffered. Hence, if a synchronization event occurs when the DMA channel is still servicing the previous event, the overlapping (second) event is dropped. In this scenario, the DMA controller does not disable the affected channel nor does it signal an error to the CPU.  Therefore, care must be taken when programming the DSP to ensure that the DMA has enough clock cycles to transfer the required number of data bytes on each synchronization event.

  • Ok Brian,

     

    You had in mind the C5506 so thats explaining why I could not spot this flag in any of the C5515 regs either IRQ or DMA. specific

    You are right though since if it was existing in C5515 at least we could have an indication of what happened.

     

    Thanks anyway,

    Christos

     

     

  • Dear Bill,

    I am trying develop a application that record audio signal from codec to sd card. I sent two question (below) to this forum but the answers did not help me so much.

    http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/72435/275315.aspx#275315

    http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/84703/330574.aspx#330574

    According your e-mail your application is very similar mine, excepting that you send the audio signal to USB, so, I woul like to know if will be possible I send my code to you and you give me suggestions about what to do. My main difficult is acquiring signal with dma, because no ping and pong interrupt are occuring sequentially.

    Please, I am trying a lot of things but nothing works.

    Regards,

    Andrea