Hi everybody,
Since I do not have answer to my last question posted in this forum at:
http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/72435/264688.aspx#264688
I am trying use DMA to transfer audio signals from Codec via I2S to internal memory. I suppose that it will prevent loss of sample during my SD writing. To test my theory I mixed the example CSL_DMA_PingPongExample and aic3204 (by Spectrum Digital).
I did the follow:
1. Included the csl_dma_PingPongExample.c file on the example aic3204 (by Spectrum Digital).
2. Changed the csl_dma_PingPongExample.c file (attached) using the file supply at example CSL_DMA_PingPongExample and the Literature Number: SPRUFT2.
5460.csl_dma_PingPongExample.pdf
3. Declared the prototype extern void Config_DMA_I2S()on the file where is my main function.
4. Changed the aic3204_loop_stereo_in1.c file (attached) including Config_DMA_I2S()using the file supply at example aic3204 (by Spectrum Digital).
7026.aic3204_loop_stereo_in1.pdf
5. Watch variables / memory (screens are attached).
Observations/Doubts:
1. Putting a breakpoint before the function DMA_start(dmaHandleI2s) in csl_dma_PingPongExample.c file I noticed that all registers and values are correct according Literature Number: SPRUFT2.
2. After the function DMA_start(dmaHandleI2s) the DMACH1TCR2 and DMACH1DSAL were changed.
3. Using F6 (step over) in function DMA_start I noticed that the line 1270 on csl_dma.c file causes the changes, but the DMACH1DSAL should not be changed. Why?
4. Putting a breakpoint at the end of interrupt void dma_isr(void) and watch the register DMACH1TCR2 I noticed that after one ping interrupt not necessarily the interruption pong occurs. Why? According Literature Number: SPRUFT2 after a ping interrupt a pong interrupt must occur. I noticed that the DMACH1DSAL address varies randomly. Why? According Literature Number: SPRUFT2 when the interrupt occurs the buffer is full, so, the DMACH1DSAL should be incremented by buffer size.
5. Including memory observation I noticed that after the source address 0x2828 (I2S0 RX) is update but the destination address 0xExxx continues with a default value. According Literature Number: SPRUFT2 the memory address starting in 0x000CE000 will be full with the values from address 0x2828 (I2S0 RX). How can I associate these values with a vector? For example, the vector DataVector[n_sample] from I2S0 will be write on a SD card.
6. Removing all breakpoints and run the program the audio works (I am using a microphone and a hear phone), but after a Halt all registers of dmaHandleI2S are reset, the IFR1 shows BUS ERROR and the interrupt still is called. However I cannot rely more on the run. Why the registers are reset? Why BUS ERROR?
Please, could anybody help me? I am completely lost because my two attempts are not working and I do not have more ideas/options.
Regards,
Andrea