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.

Questions about the operation of DMA and I2S

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).

3404.Screens.pdf

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

 

  • I will consult our expert after the holiday.

  • Dear Sr. Tsang,

    Have you got any news about these questions?

    Regards,

  • Hi Mr. Cruz,

    You are combining 2 test codes from TI & Spectrum Digital. I have not been able to duplicate it yet. One think I can tell is in DMA mode, the transaction cannot be halted by breakpoint. It will continue to finish.

    Regards.

  • Dear Mr. Tsang,

    After your last e-mail I still trying fix the problem without success.

    According your e-mail the problem is because I am mixing two codes (Texas and Spectrum Digital). Do you know why it happens? Have any explanation?

    Dear colleagues of forum,

    After that I passed to implement codes based only in Texas examples. I started with the example CSL_I2S_DMAExampale_Out because is similar that I need (I2S and DMA). I read the documents SPRUFX4 and SPRUFT2 but unfortunately the example does not work and the Console shows:

    CSL I2S DMA MODE TEST!

    I2S Module Instance opened successfully

    I2S Module Configured successfully

    I2S Reset Successful

    I2S Close Successful

    I2S Read & Write Buffers doesn't Match!!!

    CSL I2S DMA MODE TEST FAILED!!

     

    I investigated and I believe that despite the I2S is configured to I2S_LOOPBACK_ENABLE it does not happening. I put a breakpoint after DMA write on I2STXLT0 (0x2808) and observed that the correspondent I2SRXLT0 (0x2828) is filled with aleatory values. The I2S0 still actualizing the address 0x2828 so, during the DMA read the comparison of buffers will generated the error bellow. In my opinion this works is normal because the I2S0 is running. My question is, any day this example worked? What to do to it works?

    Other issue is, please, could anybody give tips to how configure the Codec on C5515 eZdsp using I2C codes supplied by CSL? I studied the examples that use I2C but none is similar the code supplied by Spectrum Digital.

    My time is expired and my tries did not work, please, anybody help me.

    Regards,

    Andrea

  • Andrea,

    What hardware are you using? The CSL_I2S_DMAExample_Out example in CSL is in loopback mode, which works for EVM.

    As for C5515 eZDSP, you can refer to http://code.google.com/p/c5505-ezdsp/ for the Audio Filter Demo under C5515 eZDSP.

    Also, the AIC3204 is wired to I2S2 in C5515 EVM but to I2S0 in eZDSP. So, be caution on the different.

    Regards.

  • Andrea,

    I am seeing you are still having problem. Why don't you tar your whole project folder and attached here. I will try duplicating on my end. What hardware are your using? C5515EVM, C5515EZDSP or sometimes else?

    Regards.

  • Thank you Mr. Tsang,

    Sorry for delay, unfortunately I can not focus exclusively on this project, please, do not interpret as indifference.

    After your e-mail (Jan 17) I insist to use DMA and test the example CSL_I2S_DMAExampale without success, and I posted a question on forum.

    After your e-mail (Feb 21) I studied (step by step) the example Audio Filter but in my opinion its interrupts probably will conflict with the SD card write (next steps). Because of this I returned to my studies on CSL_DMA_PingPongExample. Finally I believe that CSL_DMA_PingPongExample is working with aic3204 (by Spectrum Digital). Yesterday I applied a known signal (1 kHz sine with 114dB) in an electret microphone (polarized) and watch memory space defined as “DMA destination address”, so I concluded that it is working.

     

    But now, when I included files on example CSL_MMCSD_SdCardFSExtExample a strange thing happened. Detail, it was working correctly. I will try explain what I did:

    1 - I included the file csl_dma_PingPongExample.c (attached) on example CSL_MMCSD_SdCardFSExtExample and called the function Config_DMA_I2S() before my while(Run).

    2 - I do not have a .cmd file; I am using the memory configuration by DSP/BIOS VC5505_CSL_BIOS_cfg.tcf file (attached). I note that it is to evm5505 but it was working with CSL_MMCSD_SdCardFSExtExample before I include csl_dma_PingPongExample.c.

    3 - After debug and load the program (without errors), when I press “run” the console shows “Invalid CIO command (0) in the CIO buffer at address (0x61a4) was not recognized. Please check the device and program memory maps” and still running but without work (screen page 1 attached).

    4 - After that I excluded VC5505_CSL_BIOS_cfg.tcf file from build and included the VC5505_DMA.cmd used at CSL_DMA_PingPongExample that works correctly.

    5 - After debug and load the program (without errors), when I press “run” the stack pointer goes to abort() (screen page 2 attached).

    6 - After comment Config_DMA_I2S() using VC5505_DMA.cmd the problem still (abort()).

    7 - After comment Config_DMA_I2S(), return VC5505_CSL_BIOS_cfg.tcf and exclude VC5505_DMA.cmd the remainder of the program works.

     

    About item 3, I looked for a memory space called CIO on VC5505_CSL_BIOS_cfg.tcf file but I could not identify it. Do you have any suggestion?

    About item 5, if the memory map is not correct why the console did not show errors? Please, give me any direction to solve this problem because CCS does not display any message. It is important to mention that this application will works stand alone, so, a .cmd file will be essential.

    Answering your question I am usign C5515 eZDSP.

     

    Regards,

    8422.Screens.pdf

    0726.csl_dma_PingPongExample.pdf

  • Andrea,

    Can you tar you whole project folder and attached here so I can take a look?

    regards.

  • Dear Mr. Steve Tsang, to reproduce my actual code I suggest you star with CSL_MMCSD_SdCardFSExtExample. All the files used are attached. You will need include the atafs_bios_drv_lib.lib and I included on my project the usbstk5515bsl.lib because I am using switches and leds examples supplied by Spectrum Digital.

    CCS4 version 4.1.3.00038 and Code Generation Tools TI v4.3.7 

    on C/C++ Build, C5500 Compiler, All options:

    -v5505 -g --define="_DEBUG" --include_path="C:/Arquivos de programas/Texas Instruments/ccsv4/tools/compiler/C5500 Code Generation Tools 4.3.7/include" --include_path="C:/Arquivos de programas/TMS320C55XXCSL-LOWPWR/c55xx_csl/src" --include_path="C:/Arquivos de programas/TMS320C55XXCSL-LOWPWR/c55xx_csl/ccs_v4.0_examples/drv/atafs/src" --include_path="C:/Arquivos de programas/TMS320C55XXCSL-LOWPWR/c55xx_csl/ccs_v4.0_examples/drv/common" --include_path="C:/Arquivos de programas/TMS320C55XXCSL-LOWPWR/c55xx_csl/inc" --include_path="C:/Arquivos de programas/Texas Instruments/ccsv4/emulation/boards/usbstk5515_v1/include" --include_path="C:/Arquivos de programas/Texas Instruments/ccsv4/emulation/boards/usbstk5515_v1/tests/switch" --include_path="C:/Arquivos de programas/Texas Instruments/c55xx_csl/ccs_v4.0_examples/mmc_sd/CSL_MMCSD_SdCardFSExtExample_09032011/Debug" --include_path="C:/Arquivos de programas/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Arquivos de programas/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c5500" --include_path="/packages/ti/xdais" --include_path="C:/Arquivos de programas/Texas Instruments/c55xx_csl/inc" --include_path="C:/Arquivos de programas/Texas Instruments/c55xx_csl/src" --include_path="C:/Arquivos de programas/Texas Instruments/c55xx_csl/ccs_v4.0_examples/drv/atafs/src" --include_path="C:/Arquivos de programas/Texas Instruments/c55xx_csl/ccs_v4.0_examples/drv/common" --diag_warning=225 --large_memory_model --ptrdiff_size=16 --algebraic --memory_model=large --asm_source=algebraic

    How my old program works, according item 7 at last e-mail: after comment Config_DMA_I2S(), return VC5505_CSL_BIOS_cfg.tcf and exclude VC5505_DMA.cmd, after build and load the program, pressing run some configurations will be made (messages on console) and when press sw1 data will be write on SD card, when press sw2 the write is stopped and the program will be finished. 

    Thank you so much,

    Andrea

    8551.aic3204_test_c.pdf8267.ata_ext_func_c.pdf8741.ata_ext_func_h.pdf2783.chk_mmc_c.pdf6170.csl_dma_PingPongExample_c.pdf1351.csl_mmcsd_atafs_ext_example_c.pdf0045.macros_ini.pdf5810.sar_c.pdf1200.VC5505_CSL_BIOS_cfg_tcf.pdf8611.VC5505_DMA_cmd.pdf

  • Dear Mr. Tsang,

    You had time to check this issue?

    Sincerely I do not know how start, please, help me.

    Regards,

    Andrea

  • Andrea,

    This is a very intense support question. i have nothing to update.

    Regards.

  • Andrea,

    I have been able to get time to work on this. I copied all 5 pdf files you attached on last posting and created as .c and .h. files repectively. I read throught this posting thread to summary your steps to create your project in attach steps.txt file. Please cheeck and let me know if this is correct or what is missing. Then I can try repeating your steps.

    Also, what hardware are you using? C5515 eZDSP or C5515EVM.

    Which CSL version are you using? The latest version 2.10.

    1 - I included the file csl_dma_PingPongExample.c (attached) on example CSL_MMCSD_SdCardFSExtExample and called the function Config_DMA_I2S() before my while(Run).
    
    2 - I do not have a .cmd file; I am using the memory configuration by DSP/BIOS VC5505_CSL_BIOS_cfg.tcf file (attached). I note that it is to evm5505 but it was working with CSL_MMCSD_SdCardFSExtExample before I include csl_dma_PingPongExample.c.
    
    3 - After debug and load the program (without errors), when I press �run� the console shows �Invalid CIO command (0) in the CIO buffer at address (0x61a4) was not recognized. Please check the device and program memory maps� and still running but without work (screen page 1 attached).
    
    4 - After that I excluded VC5505_CSL_BIOS_cfg.tcf file from build and included the VC5505_DMA.cmd used at CSL_DMA_PingPongExample that works correctly.
    
    5 - After debug and load the program (without errors), when I press �run� the stack pointer goes to abort() (screen page 2 attached).
    
    6 - After comment Config_DMA_I2S() using VC5505_DMA.cmd the problem still (abort()).
    
    7 - After comment Config_DMA_I2S(), return VC5505_CSL_BIOS_cfg.tcf and exclude VC5505_DMA.cmd the remainder of the program works.
    
    after comment Config_DMA_I2S(), return VC5505_CSL_BIOS_cfg.tcf and exclude VC5505_DMA.cmd, after build and load the program, pressing run some configurations will be made (messages on console) and when press sw1 data will be write on SD card, when press sw2 the write is stopped and the program will be finished. 
    

    It is easier if you can tar your project folder and pass it over, if possible.

    Regards.

  • Hi Steve, I attached my project folder .zip because .tar presents the message "File Type Not Valid This type of file is not allowed." I revised the steps.txt file.

    I am using C5515 eZDSP and CSL 2.10.

    Thank you so much!!!

    Andrea

    1 - I included the file csl_dma_PingPongExample_c on example CSL_MMCSD_SdCardFSExtExample and called the function Config_DMA_I2S() before my while(Run) on csl_mmcsd_atafs_ext_example_c file.
    
    2 - I included the files aic3204_test_c and aic3204_test_c and lib usbstk5515bsl.lib (supplied by Spectrum Digital).
    
    3 - In your case, please, replace the files on project by ata_ext_func_c, ata_ext_func_h, ata_ext_func_h and csl_mmcsd_atafs_ext_example_c. The last file includes the step 1. Please, ignore the macros_ini because it is equal.
    
    4 - I do not have a .cmd file; I am using the memory configuration by DSP/BIOS VC5505_CSL_BIOS_cfg.tcf file (attached). I note that it is to evm5505 but it was working with CSL_MMCSD_SdCardFSExtExample before I include csl_dma_PingPongExample.c.
    
    5 - After debug and load the program (without errors), when I press �run� the console shows �Invalid CIO command (0) in the CIO buffer at address (0x61a4) was not recognized. Please check the device and program memory maps� and still running but without work (screen page 1 attached).
    
    6 - After that I excluded VC5505_CSL_BIOS_cfg.tcf file from build and included the VC5505_DMA.cmd used at CSL_DMA_PingPongExample that worked correctly on CSL_DMA_PingPongExample.
    
    7 - After debug and load the program (without errors), when I press �run� the stack pointer goes to abort() (screen page 2 attached).
    
    8 - After comment Config_DMA_I2S() using VC5505_DMA.cmd the problem still (abort()). So, at this point, in my oppinion the function Config_DMA_I2S() was not the problem.
    
    9 - After comment Config_DMA_I2S(), return VC5505_CSL_BIOS_cfg.tcf and exclude VC5505_DMA.cmd the remainder of the program works.
    
    What means "remainder of the program works": after build and load the program, pressing run some configurations will be made (messages on console) and when press sw1 data will be write on SD card, when press sw2 the write is stopped and the program will be finished. 
    

    2806.CSL_MMCSD_SdCardFSExtExample_09032011.zip