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.

CCS/TMS320C5545: How can I program in ROM?

Part Number: TMS320C5545

Tool/software: Code Composer Studio

Hi I'm using C5545 DSP.

I want to program in ROM. But I couldn't.

This is original cmd file for C5545. and it is working fine. 

-------------------------------------

MEMORY
{
MMR: o = 0x000000 l = 0x0000c0 /* 192B Memory Mapped Registers */
DARAM0: o = 0x0000C0 l = 0x001F40 /* 8kB Dual Access RAM 0 */
DARAM1: o = 0x002000 l = 0x002000 /* 8kB Dual Access RAM 1 */
DARAM2: o = 0x004000 l = 0x002000 /* 8kB Dual Access RAM 2 */
DARAM3: o = 0x006000 l = 0x002000 /* 8kB Dual Access RAM 3 */
DARAM4: o = 0x008000 l = 0x002000 /* 8kB Dual Access RAM 4 */
DARAM5: o = 0x00A000 l = 0x004000 /* 8kB Dual Access RAM 5 */
// DARAM6: o = 0x00C000 l = 0x002000 /* 8kB Dual Access RAM 6 */
DARAM7: o = 0x00E000 l = 0x002000 /* 8kB Dual Access RAM 7 */

SARAM0: o = 0x010000 l = 0x002000 /* 8kB Single Access RAM 0 */
SARAM1: o = 0x012000 l = 0x002000 /* 8kB Single Access RAM 1 */
SARAM2: o = 0x014000 l = 0x002000 /* 8kB Single Access RAM 2 */
SARAM3: o = 0x016000 l = 0x002000 /* 8kB Single Access RAM 3 */
SARAM4: o = 0x018000 l = 0x002000 /* 8kB Single Access RAM 4 */
SARAM5: o = 0x01A000 l = 0x002000 /* 8kB Single Access RAM 5 */
SARAM6: o = 0x01C000 l = 0x002000 /* 8kB Single Access RAM 6 */
SARAM7: o = 0x01E000 l = 0x002000 /* 8kB Single Access RAM 7 */
SARAM8: o = 0x020000 l = 0x002000 /* 8kB Single Access RAM 8 */
SARAM9: o = 0x022000 l = 0x002000 /* 8kB Single Access RAM 9 */
SARAM10: o = 0x024000 l = 0x002000 /* 8kB Single Access RAM 10 */
SARAM11: o = 0x026000 l = 0x002000 /* 8kB Single Access RAM 11 */
SARAM12: o = 0x028000 l = 0x002000 /* 8kB Single Access RAM 12 */
SARAM13: o = 0x02A000 l = 0x002000 /* 8kB Single Access RAM 13 */
SARAM14: o = 0x02C000 l = 0x002000 /* 8kB Single Access RAM 14 */
SARAM15: o = 0x02E000 l = 0x002000 /* 8kB Single Access RAM 15 */
SARAM16: o = 0x030000 l = 0x002000 /* 8kB Single Access RAM 16 */
SARAM17: o = 0x032000 l = 0x002000 /* 8kB Single Access RAM 17 */
SARAM18: o = 0x034000 l = 0x002000 /* 8kB Single Access RAM 18 */
SARAM19: o = 0x036000 l = 0x002000 /* 8kB Single Access RAM 19 */
SARAM20: o = 0x038000 l = 0x002000 /* 8kB Single Access RAM 20 */
SARAM21: o = 0x03A000 l = 0x002000 /* 8kB Single Access RAM 21 */
SARAM22: o = 0x03C000 l = 0x002000 /* 8kB Single Access RAM 22 */
SARAM23: o = 0x03E000 l = 0x002000 /* 8kB Single Access RAM 23 */
SARAM24: o = 0x040000 l = 0x002000 /* 8kB Single Access RAM 24 */
SARAM25: o = 0x042000 l = 0x002000 /* 8kB Single Access RAM 25 */
SARAM26: o = 0x044000 l = 0x002000 /* 8kB Single Access RAM 26 */
SARAM27: o = 0x046000 l = 0x002000 /* 8kB Single Access RAM 27 */
SARAM28: o = 0x048000 l = 0x002000 /* 8kB Single Access RAM 28 */
SARAM29: o = 0x04A000 l = 0x002000 /* 8kB Single Access RAM 29 */
SARAM30: o = 0x04C000 l = 0x002000 /* 8kB Single Access RAM 30 */
SARAM31: o = 0x04E000 l = 0x002000 /* 8kB Single Access RAM 31 */

//ROM: o = 0xFE0000 l = 0x01FF00 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
SAROM0: o = 0xFE0000 l = 0x008000 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
SAROM1: o = 0xFE8000 l = 0x008000 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
SAROM2: o = 0xFF0000 l = 0x008000 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
SAROM3: o = 0xFF8000 l = 0x002000 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */

VECS: o = 0xFFFF00 l = 0x000100 /* reset vector */
}

SECTIONS
{

vectors (NOLOAD) > VECS
.cinit > DARAM0
.text >> SARAM0|SARAM1|SARAM2|SARAM3|SARAM4
.stack > DARAM0
.sysstack > DARAM0
.sysmem > DARAM4
.data > DARAM4
.cio > DARAM0
.bss > DARAM5
.const > DARAM0
.switch > DARAM7

}

------------------------------------------------------------------------------------------

And this is the modified cmd file.

------------------------------------------------------------------

MEMORY
{
MMR: o = 0x000000 l = 0x0000c0 /* 192B Memory Mapped Registers */
DARAM0: o = 0x0000C0 l = 0x001F40 /* 8kB Dual Access RAM 0 */
DARAM1: o = 0x002000 l = 0x002000 /* 8kB Dual Access RAM 1 */
DARAM2: o = 0x004000 l = 0x002000 /* 8kB Dual Access RAM 2 */
DARAM3: o = 0x006000 l = 0x002000 /* 8kB Dual Access RAM 3 */
DARAM4: o = 0x008000 l = 0x002000 /* 8kB Dual Access RAM 4 */
DARAM5: o = 0x00A000 l = 0x004000 /* 8kB Dual Access RAM 5 */
// DARAM6: o = 0x00C000 l = 0x002000 /* 8kB Dual Access RAM 6 */
DARAM7: o = 0x00E000 l = 0x002000 /* 8kB Dual Access RAM 7 */

SARAM0: o = 0x010000 l = 0x002000 /* 8kB Single Access RAM 0 */
SARAM1: o = 0x012000 l = 0x002000 /* 8kB Single Access RAM 1 */
SARAM2: o = 0x014000 l = 0x002000 /* 8kB Single Access RAM 2 */
SARAM3: o = 0x016000 l = 0x002000 /* 8kB Single Access RAM 3 */
SARAM4: o = 0x018000 l = 0x002000 /* 8kB Single Access RAM 4 */
SARAM5: o = 0x01A000 l = 0x002000 /* 8kB Single Access RAM 5 */
SARAM6: o = 0x01C000 l = 0x002000 /* 8kB Single Access RAM 6 */
SARAM7: o = 0x01E000 l = 0x002000 /* 8kB Single Access RAM 7 */
SARAM8: o = 0x020000 l = 0x002000 /* 8kB Single Access RAM 8 */
SARAM9: o = 0x022000 l = 0x002000 /* 8kB Single Access RAM 9 */
SARAM10: o = 0x024000 l = 0x002000 /* 8kB Single Access RAM 10 */
SARAM11: o = 0x026000 l = 0x002000 /* 8kB Single Access RAM 11 */
SARAM12: o = 0x028000 l = 0x002000 /* 8kB Single Access RAM 12 */
SARAM13: o = 0x02A000 l = 0x002000 /* 8kB Single Access RAM 13 */
SARAM14: o = 0x02C000 l = 0x002000 /* 8kB Single Access RAM 14 */
SARAM15: o = 0x02E000 l = 0x002000 /* 8kB Single Access RAM 15 */
SARAM16: o = 0x030000 l = 0x002000 /* 8kB Single Access RAM 16 */
SARAM17: o = 0x032000 l = 0x002000 /* 8kB Single Access RAM 17 */
SARAM18: o = 0x034000 l = 0x002000 /* 8kB Single Access RAM 18 */
SARAM19: o = 0x036000 l = 0x002000 /* 8kB Single Access RAM 19 */
SARAM20: o = 0x038000 l = 0x002000 /* 8kB Single Access RAM 20 */
SARAM21: o = 0x03A000 l = 0x002000 /* 8kB Single Access RAM 21 */
SARAM22: o = 0x03C000 l = 0x002000 /* 8kB Single Access RAM 22 */
SARAM23: o = 0x03E000 l = 0x002000 /* 8kB Single Access RAM 23 */
SARAM24: o = 0x040000 l = 0x002000 /* 8kB Single Access RAM 24 */
SARAM25: o = 0x042000 l = 0x002000 /* 8kB Single Access RAM 25 */
SARAM26: o = 0x044000 l = 0x002000 /* 8kB Single Access RAM 26 */
SARAM27: o = 0x046000 l = 0x002000 /* 8kB Single Access RAM 27 */
SARAM28: o = 0x048000 l = 0x002000 /* 8kB Single Access RAM 28 */
SARAM29: o = 0x04A000 l = 0x002000 /* 8kB Single Access RAM 29 */
SARAM30: o = 0x04C000 l = 0x002000 /* 8kB Single Access RAM 30 */
SARAM31: o = 0x04E000 l = 0x002000 /* 8kB Single Access RAM 31 */

//ROM: o = 0xFE0000 l = 0x01FF00 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
SAROM0: o = 0xFE0000 l = 0x008000 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
SAROM1: o = 0xFE8000 l = 0x008000 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
SAROM2: o = 0xFF0000 l = 0x008000 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
SAROM3: o = 0xFF8000 l = 0x002000 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */

VECS: o = 0xFFFF00 l = 0x000100 /* reset vector */
}

SECTIONS
{

vectors (NOLOAD) > VECS 
.cinit > SAROM0
.text > SAROM1
.stack > DARAM0
.sysstack > DARAM0
.sysmem > DARAM4
.data > DARAM4
.cio > DARAM0
.bss > DARAM5

.const > SAROM2
.switch > DARAM7 

}

----------------------------------------

and this make the error.

I want to know how to program in ROM

Please give me some tips

Thanks 

  • Hi,

    I've notified the RTOS team. They will post their feedback directly here.

    Best Regards,
    Yordan
  • Minkyo,

    You can't program the ROM on the device, its read only.

    Lali
  • How can I save the code data?

    I want to program the code in flash

  • Minkyo,

    Please see this document on flashing your image onto SPI flash.
    processors.wiki.ti.com/.../C5535_Boot-Image_Programmer

    Lali
  • Hi

    Actually, I have an I2C EEPROM.

    I want to program the code in the I2C EEPROM

    and I found example code "programmer" (c55_lp/c55_csl3.08/ccs_v6.x_examples)

    * This utility allows a user-specified binary file to be programmed into
    * one of the following supported devices...
    * @li NAND FLASH
    * @li NOR FLASH
    * @li SPI EEPROM
    * @li IIC EEPROM
    * @li MMC
    * @li SD
    * @li SPI Flash
    * @li MCSPI Flash

    I made Hex file from hex utility.


    But I don't know how to make binary file.

    Can I make a binary file for code?

    Thank you

  • Hi


    **** Build of configuration Debug for project I2S-DMA_PCM_MASTER ****

    "C:\\ti\\ccsv7\\utils\\bin\\gmake" -k all
    'Invoking: C5500 Hex Utility'
    "C:/ti/ccsv7/tools/compiler/c5500_4.4.1/bin/hex55" --boot --binary -o "CSL_I2S_DMAExampale_Out.hex" "CSL_I2S_DMAExampale_Out.out"
    Translating to Binary format...
    "CSL_I2S_DMAExampale_Out.out" ==> .cinit (BOOT LOAD)
    "CSL_I2S_DMAExampale_Out.out" ==> .switch (BOOT LOAD)
    "CSL_I2S_DMAExampale_Out.out" ==> .text.1 (BOOT LOAD)
    "CSL_I2S_DMAExampale_Out.out" ==> .text.2 (BOOT LOAD)
    "CSL_I2S_DMAExampale_Out.out" ==> .text.3 (BOOT LOAD)
    'Finished building: CSL_I2S_DMAExampale_Out.hex'
    ' '

    **** Build Finished ****


    I get this and I got Hex file.

    Can I get a binary file?
  • Hi minkyo seo,

    The hex55 program does generate the binary file - you have named it .hex.

    Use these parameter flags with hex55: hex55 -boot -v5505 -serial8 -b -i Bootloader.out -o Bootloader.bin

    I find it helpful to put the command with flags inside of a .bat file that I execute.

    Then to flash the I2C EEPROM, use c55_csl\ccs_v6.x_examples\programmer project. (http://www.ti.com/tool/sprc133)

    When running the programmer, there will be a prompt in the CCS console. Type 4 for IIC EEPROM, 1 to program, and then pass the path to the .bin file generated by hex55. Note that there must not be any white spaces in the path, so move it somewhere like c:\ti\bins before programming.

    What I2C EEPROM are you trying to program? We can confirm that the I2C address matches that which is used by the programmer (0x50).

    Hope this helps,
    Mark

  • Hi

    I did it. but it is not working.

    This is my setting.

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    and I changed file name hex to bin. and this is build result

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Next I executed programmer example. this is result.

    I think Programming complete is it is done. But DSP is not working. 

    What is my mistake? 

    I'm using AT24C512C  I2C EEPROM. 

    Thank you 

  • Hi,

    Try to Edit Flags: instead of -mcbsp8 , use -v5505 -serial8

    You need to Specify the silicon boot table version. -v5505 works for C5505, C5515, C5535, C5545, and C5517.

    To learn more about “hex55.exe”, see the TMS320C55x Assembly Language Tools Users Guide (www-s.ti.com/.../spru280) in section 13.

    If your binary program still does not run with the bootloader, then you need to confirm that the program performs all initialization steps. The best way to check this is to connect to the target in CCS without using a GEL file. The GEL file performs initialization for you, but the bootloader does not perform this initialization. So you need to do it in your application program: Initialize PLL, unidle all the ports, unclock gate peripherals, and reset peripherals before configuring them.

    The AT24C512C I2C EEPROM has 2 or 3 address pins that define its I2C address. The programmer assumes the address is 0x50. This means all 2 or 3 address pins are shorted to GND. If the address is something else, then you should rebuild the programmer after modifying #define IIC_EEPROM_SLAVE_ADDR 0x50 inside of <path>\c55_csl\ccs_v6.x_examples\programmer\include\iic_eeprom.h

    Hope this helps,
    Mark
  • Hi Mark.

    I have some problem.

    Could you help me?

    Actually I programed in I2C eeprom.

    But it is not working well.

    When I program in Ram, it's working well.

    But in I2C eeprom, it is not working DMA. i'm not sure that I2S is working as well.

    I think it is initialization problem you said above.

    I read some datasheet and I made initialization for PLL and Port and reset peripherals.

    this is my code . please check for me

    ----------------------------------------------------------------------------------------------------------------------------------

    #include "csl_dma.h"

    #include "csl_i2s.h"

    #include <csl_general.h>

    #include <stdio.h>

    #include "csl_sysctrl.h"

    #include "csl_intc.h"

    #include "DAC_PCM5142.h"

    #include "csl_pll.h"

    #include "csl_general.h"

    #include "csl_pllAux.h"

    #define CSL_TEST_FAILED         (1)

    #define CSL_TEST_PASSED         (0)

    #define CSL_DMA0_CH0            (0)

    #define CSL_I2S_DMA_BUF_LEN (88)

    #define DMA_DATA_LENGTH         CSL_I2S_DMA_BUF_LEN*4;

    CSL_DMA_ChannelObj dmaObj0,dmaObj1,dmaObj2,dmaObj3;

    CSL_DMA_Handle dmaLeftTxHandle;

    CSL_DMA_Handle dmaRightTxHandle;

    CSL_DMA_Handle dmaLeftRxHandle;

    CSL_DMA_Handle dmaRightRxHandle;

    CSL_DMA_Config dmaConfig;

    CSL_I2sHandle   hI2s, hI2s_2;

    CSL_IRQ_Dispatch     dispatchTable;

    PLL_Obj pllObj;

    PLL_Config pllCfg1;

    PLL_Handle hPll;

    PLL_Config *pConfigInfo;

    PLL_Config pllCfg_12p288MHz = {0x8173, 0x8000, 0x0806, 0x0000};

    PLL_Config pllCfg_40MHz     = {0x8988, 0x8000, 0x0806, 0x0201};

    PLL_Config pllCfg_60MHz     = {0x8724, 0x8000, 0x0806, 0x0000};

    PLL_Config pllCfg_75MHz     = {0x88ED, 0x8000, 0x0806, 0x0000};

    PLL_Config pllCfg_100MHz    = {0x8BE8, 0x8000, 0x0806, 0x0000};

    PLL_Config pllCfg_120MHz    = {0x8E4A, 0x8000, 0x0806, 0x0000};

    volatile Uint16 dmaTxFrameCount = 0, dmaRxFrameCount=0, dmaIntCount,toggle;

    #pragma DATA_ALIGN(i2sDmaWriteLeftBuff, 32);

    Uint32 i2sDmaWriteLeftBuff[CSL_I2S_DMA_BUF_LEN];

    #pragma DATA_ALIGN(i2sDmaWriteRightBuff, 32);

    Uint32 i2sDmaWriteRightBuff[CSL_I2S_DMA_BUF_LEN];

    #pragma DATA_ALIGN(i2sDmaReadLeftBuff, 32);

    Uint32 i2sDmaReadLeftBuff[CSL_I2S_DMA_BUF_LEN];

    #pragma DATA_ALIGN(i2sDmaReadRightBuff, 32);

    Uint32 i2sDmaReadRightBuff[CSL_I2S_DMA_BUF_LEN];

    interrupt void DmaIsr(void);

    void UserAlgorithm(void);

    void pll_sample()

    {

        CSL_Status status;

       PLL_init(&pllObj, CSL_PLL_INST_0);

        hPll = (PLL_Handle)(&pllObj);

        PLL_reset(hPll);

       /* Configure the PLL for 100MHz */

       pConfigInfo = &pllCfg_100MHz;

      PLL_config (hPll, pConfigInfo);

    //PLL configuration complete

    //The below code is for demonstrating additional CSL PLL APIs

        PLL_getConfig(hPll, &pllCfg1); //demonstrates geting the PLL configuration

       PLL_bypass(hPll); //demonstrates the PLL bypass and power down

       PLL_enable(hPll); //demonstrates PLL power up & enabling with the previous configuration

    /////////////////////////////////////////////////////////////////////////

    }

    void I2S_set(void)

    {

    I2S_Config hwConfig;

    ////////////////////////////////////////////////////////////////////////////////////////////////////  I2S_0

    hI2s = I2S_open(I2S_INSTANCE0, DMA_POLLED, I2S_CHAN_STEREO);

    SYS_setEBSR(CSL_EBSR_FIELD_SP0MODE, CSL_EBSR_SP0MODE_1);  // i2s0 port set

    /** Set the value for the configure structure */

    hwConfig.dataType = I2S_STEREO_ENABLE;            // 0 stereo  1mono

    //hwConfig.loopBackMode = I2S_LOOPBACK_ENABLE;          // 1 enable 0disable

    hwConfig.loopBackMode       = I2S_LOOPBACK_DISABLE;          // 1 enable 0disable

    hwConfig.fsPol = I2S_FSPOL_LOW;                // ws low = left ch

    hwConfig.clkPol = I2S_FALLING_EDGE;             //Receive data is sampled on the falling edge and transmit data shifted on

                                                                // the rising edge of the bit clock.

    hwConfig.datadelay = I2S_DATADELAY_ONEBIT;        //0 -> 1bit delay 1-> 2bit delay

    hwConfig.datapack = I2S_DATAPACK_DISABLE;        //

    hwConfig.signext = I2S_SIGNEXT_DISABLE;        //extension of words

    hwConfig.wordLen = I2S_WORDLEN_16;             // 0-8, 1-10, 2-12, 3-14, 4-16, 5-18, 6-20, 7-22,8-24

    //hwConfig.i2sMode = I2S_MASTER;                 // 0-slave, 1-master

    hwConfig.i2sMode            = I2S_SLAVE;                 // 0-slave, 1-master

    hwConfig.FError = I2S_FSERROR_DISABLE;

    hwConfig.OuError = I2S_OUERROR_DISABLE;

    I2S_setup(hI2s, &hwConfig);

    ///////////////////////////////////////////////////////////////////////////////////////////////  I2S_2

    hI2s_2 = I2S_open(I2S_INSTANCE2, DMA_POLLED, I2S_CHAN_STEREO);

        SYS_setEBSR(CSL_EBSR_FIELD_PPMODE, CSL_EBSR_PPMODE_6);    //  i2s2 mode setup

        /** Set the value for the configure structure               */

        hwConfig.dataType           = I2S_STEREO_ENABLE;            // 0 stereo  1mono

        //hwConfig.loopBackMode         = I2S_LOOPBACK_ENABLE;          // 1 enable 0disable

        hwConfig.loopBackMode       = I2S_LOOPBACK_DISABLE;          // 1 enable 0disable

        hwConfig.fsPol              = I2S_FSPOL_LOW;                //

        hwConfig.clkPol             = I2S_FALLING_EDGE;             //Receive data is sampled on the falling edge and transmit data shifted on

                                                                    // the rising edge of the bit clock.

        hwConfig.datadelay          = I2S_DATADELAY_ONEBIT;        //0 -> 1bit delay 1-> 2bit delay

        hwConfig.datapack           = I2S_DATAPACK_DISABLE;        //

        hwConfig.signext            = I2S_SIGNEXT_DISABLE;        //extension of words

        hwConfig.wordLen            = I2S_WORDLEN_16;             // 0-8, 1-10, 2-12, 3-14, 4-16, 5-18, 6-20, 7-22,8-24

    //    hwConfig.i2sMode            = I2S_MASTER;                 // 0-slave, 1-master

        hwConfig.i2sMode            = I2S_SLAVE;                 // 0-slave, 1-master

        //hwConfig.clkDiv             = I2S_CLKDIV8;                //I2Sn_CLK = SystemClock / (2CLKDIV+1)

        //hwConfig.fsDiv              = I2S_FSDIV256;                //I2Sn_FS = I2Sn_CLK / (2FSDIV+3)

        hwConfig.FError             = I2S_FSERROR_DISABLE;

        hwConfig.OuError            = I2S_OUERROR_DISABLE;

        I2S_setup(hI2s_2, &hwConfig);

    }

    void DMA_set(void)

    {

        Int16           status = CSL_TEST_FAILED, ifrValue;

        IRQ_disable(DMA_EVENT);

        IRQ_clear(DMA_EVENT);

        CSL_SYSCTRL_REGS->DMAIER = 0x0000;

        ifrValue = CSL_SYSCTRL_REGS->DMAIFR;

        CSL_SYSCTRL_REGS->DMAIFR |= ifrValue;

        IRQ_plug(DMA_EVENT, &DmaIsr); // dma interrupt set

    DMA_init();  //dma clock enable

        IRQ_enable(DMA_EVENT); // dma interrupt enable

    ////////////////////////////////////////////////////////////// I2S0_RX_Left Channel DMA ch1

    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.dmaEvt       = CSL_DMA_EVT_I2S0_RX;

    dmaConfig.dmaInt       = CSL_DMA_INTERRUPT_ENABLE;

    dmaConfig.chanDir      = CSL_DMA_READ;

    dmaConfig.trfType      = CSL_DMA_TRANSFER_IO_MEMORY;

    dmaConfig.dataLen      = DMA_DATA_LENGTH;

    dmaConfig.srcAddr      = (Uint32)&CSL_I2S0_REGS->I2SRXLT0;// I2S0_I2SRXLT0

    dmaConfig.destAddr     = (Uint32)i2sDmaReadLeftBuff;

    dmaLeftRxHandle = DMA_open(CSL_DMA_CHAN1, &dmaObj0,&status);

        DMA_config(dmaLeftRxHandle, &dmaConfig);

    ////////////////////////////////////////////////////////////////// I2S0_RX_Right Channel DMA ch2

    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.dmaEvt       = CSL_DMA_EVT_I2S0_RX;

    dmaConfig.dmaInt       = CSL_DMA_INTERRUPT_ENABLE;

    dmaConfig.chanDir      = CSL_DMA_READ;

    dmaConfig.trfType      = CSL_DMA_TRANSFER_IO_MEMORY;

    dmaConfig.dataLen      = DMA_DATA_LENGTH;

    dmaConfig.srcAddr      = (Uint32)&CSL_I2S0_REGS->I2SRXRT0; //I2S0_I2SRXRT0

    dmaConfig.destAddr     = (Uint32)i2sDmaReadRightBuff;

    dmaRightRxHandle = DMA_open(CSL_DMA_CHAN2, &dmaObj1,&status);

        DMA_config(dmaRightRxHandle, &dmaConfig);

    ////////////////////////////////////////////////////////////////// I2S2_TX_LEFT Channel DMA ch4

        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.dmaEvt       = CSL_DMA_EVT_I2S2_TX;

        dmaConfig.dmaInt       = CSL_DMA_INTERRUPT_ENABLE;

        dmaConfig.chanDir      = CSL_DMA_WRITE;

        dmaConfig.trfType      = CSL_DMA_TRANSFER_IO_MEMORY;

        dmaConfig.dataLen      = DMA_DATA_LENGTH;

        dmaConfig.srcAddr      = (Uint32)i2sDmaWriteLeftBuff;

    //    dmaConfig.srcAddr      = (Uint32)i2sDmaReadLeftBuff;

        dmaConfig.destAddr     = (Uint32)(0x2A08);

        dmaLeftTxHandle = DMA_open(CSL_DMA_CHAN4, &dmaObj2,&status);

        DMA_config(dmaLeftTxHandle, &dmaConfig);

        ////////////////////////////////////////////////////////////////// I2S2_TX_Right Channel DMA ch5

        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.dmaEvt       = CSL_DMA_EVT_I2S2_TX;

        dmaConfig.dmaInt       = CSL_DMA_INTERRUPT_ENABLE;

        dmaConfig.chanDir      = CSL_DMA_WRITE;

        dmaConfig.trfType      = CSL_DMA_TRANSFER_IO_MEMORY;

        dmaConfig.dataLen      = DMA_DATA_LENGTH;

        dmaConfig.srcAddr      = (Uint32)i2sDmaWriteRightBuff;

    //    dmaConfig.srcAddr      = (Uint32)i2sDmaReadRightBuff;

        dmaConfig.destAddr     = (Uint32)(0x2A0C);

        dmaRightTxHandle = DMA_open(CSL_DMA_CHAN5, &dmaObj3,&status);

        DMA_config(dmaRightTxHandle, &dmaConfig);

    }

    interrupt void DmaIsr(void)

    {

        volatile Uint16 ifrValue;

        ifrValue = CSL_SYSCTRL_REGS->DMAIFR;

        CSL_SYSCTRL_REGS->DMAIFR |= ifrValue;

        if (ifrValue & 4)                 // DMA ch 4,5 Tx

        {

            dmaTxFrameCount++;

        }

        if (ifrValue & 5)

        {

            dmaTxFrameCount++;

        }

        if (ifrValue & 1)               // DMA ch 1,2 Rx

        {

            dmaRxFrameCount++;

        }

        if (ifrValue & 2)

        {

            dmaRxFrameCount++;

        }

        dmaIntCount++;

    }

    void waitloop(unsigned long loopval)

    {

        //volatile unsigned short counter = loopval;

        volatile unsigned long counter = loopval;

        while (counter)

        {

            counter--;

        }

    }

    void main(void)

    {

    Int16    looper;

    Uint32 check_buff=0;

    //////////////////////////////////////////////////////initialize

    waitloop(0xfffff); //150ms delay

        //---------------------------

        // PLL initialize

        asm("    *port(#0x1C1F) = #0x0 "); //Clock Configuration MSW reg

        //  program PLL to 100MHz with CLK_SEL = 0

        asm("    *port(#0x1c20) = #0x8BE8 "); //PLL Control 1 reg

        asm("    *port(#0x1c21) = #0x8000 "); //PLL Control 2 reg

        asm("    *port(#0x1c22) = #0x0806 "); //PLL Control 3 reg

        asm("    *port(#0x1C23) = #0x0000 "); //PLL Control 4 reg

        // wait at least 4 milli sec for PLL to lock

        asm("    repeat(0xC350)  ");

        asm("        nop     ");

        asm("    *port(#0x1c1F) = #0x0001 "); // Clock configuration MSW reg

        //---------------------------

        // PLL initialize

        *(volatile ioport Uint16 *)0x0001 = 0x020E;

        asm("   idle");

        // Reset all peripherals

        CSL_SYSCTRL_REGS->PSRCR = 0x0020;

        CSL_SYSCTRL_REGS->PRCR = 0x00BF;

        waitloop(0xfffff); //150ms delay

        //---------------------------

        // all gpio input set

        CSL_GPIO_REGS->IODIR1 = 0xffff;

        CSL_GPIO_REGS->IODIR2 = 0xffff;

        //---------------------------------

        // IRQ initialize

        IRQ_globalDisable();

        IRQ_disableAll();

        IRQ_clearAll();

        //---------------------------------

        // DAC XSMIT HIGH set

        CSL_GPIO_REGS->IODIR2 = 0x0001;  //gpio 16 output set (DAC XSMT)

        CSL_GPIO_REGS->IOOUTDATA2=0x0000; // 1 output

        for(looper=0; looper < CSL_I2S_DMA_BUF_LEN; looper++)

        {

            i2sDmaWriteLeftBuff[looper] = 0;

            i2sDmaReadLeftBuff[looper]  = 0;

            i2sDmaWriteRightBuff[looper] = 0;

            i2sDmaReadRightBuff[looper]  = 0;

        }

    /////////////////////////////////////////////////////////////////////////

        PCM5142_init();// DAC set (i2c)

    I2S_set(); //I2S set

    DMA_set(); // DMA set

        IRQ_globalEnable();

    I2S_transEnable(hI2s, TRUE); // I2S_0 Start

        I2S_transEnable(hI2s_2, TRUE); // I2S_2 Start

        while(1)

        {

            UserAlgorithm(); //receive and transmit

        }

    }

    void UserAlgorithm(void)

    {

        int i;

        if(!dmaRxFrameCount)

        {

            /* Start left Rx DMA */

            DMA_start(dmaLeftRxHandle);

            /* Start right Rx DMA */

            DMA_start(dmaRightRxHandle);

        }

        if (dmaRxFrameCount >= 2)

        {

            dmaRxFrameCount=0;

            for (i=0; i<CSL_I2S_DMA_BUF_LEN; i++)

            {

                i2sDmaWriteLeftBuff[i]  = i2sDmaReadLeftBuff[i];

                i2sDmaWriteRightBuff[i] = i2sDmaReadRightBuff[i];

            }

            /* --- Insert algorithm here --- */

        }

        if(!dmaTxFrameCount)

        {

            /* Start left Tx DMA */

            DMA_start(dmaLeftTxHandle);

            /* Start right Tx DMA */

           DMA_start(dmaRightTxHandle);

        }

        /* Clear DMA frame count */

        if(dmaTxFrameCount>=2)

        {

            dmaTxFrameCount = 0;

        }

    }

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


    Thanks

  • In addition, when I checked DMA interrupt function is working, it is now working.

    but when I program in RAM, it is working well..

    please check it.

    Thanks