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 instance 1 CSL

Other Parts Discussed in Thread: TMS320C5535

C5515

CSL3.04

CCS 5.5

I need four I2S. So I am trying to open four instances. The problem is with I2S instance 1.  The I2S_open function always returns 0 for instance 1. However, the rest is fine. Is it a CSL bug?

My configuration:

CSL_I2sHandle HW_hI2s1;


status = SYS_setEBSR(CSL_EBSR_FIELD_PPMODE, CSL_EBSR_PPMODE_6);     // I2S2, GP 12-17, I2S3
status |= SYS_setEBSR(CSL_EBSR_FIELD_SP1MODE, CSL_EBSR_SP1MODE_1);  // I2S1, GP 10-11
status |= SYS_setEBSR(CSL_EBSR_FIELD_SP0MODE, CSL_EBSR_SP0MODE_1);  // I2S0, GP 4-5

	// Open the device with instance 1 (**I2S1**)
	HW_hI2s1 = I2S_open(I2S_INSTANCE1, DMA_INTERRUPT, I2S_CHAN_STEREO);
	if(NULL == HW_hI2s1)
	{
		LOG_printf(&trace, "I2S_open failed\n");
		return(FAIL);
	}

Where am I wrong?

  • Have you modified the CSL to run for C5515? CSL3.04 is defaulted to C5517 which does not support I2S1. Instructions to run CSL3.04 for C5515 are in Installation Guide.
    Regards.
  • Hi Steve,

    If you mean this 3.1   For Running the Projects on C5504/05/14/15 DSP: csl_general.h has been modified at the beginning.

  • Good. I need to look into the code then.Regards.
  • Something that I found in my library is:

    CSL_I2sHandle I2S_open(I2S_Instance		i2sInstNum,
    					   I2S_OpMode		opMode,
    					   I2S_ChanType 	chType)
    {
    	CSL_I2sHandle hI2s;
    	ioport volatile CSL_SysRegs		*sysRegs;
    	ioport volatile CSL_SysPGFlags	*sysFlags;
    	hI2s = NULL;
    	/* Check device is already in used*/
    #if (defined(CHIP_C5517)) //No I2S1 in CHIP 5517
    	if(i2sInstNum == I2S_INVALID || i2sInstNum == I2S_INSTANCE1)
    	{
    		return (NULL);
    	}
    #else
    	if(i2sInstNum == I2S_INVALID)
    	{
    		return (NULL);
    	}
    #endif
    
    	hI2s = &I2S_InstanceNum[i2sInstNum];
    
    	if((i2sInstNum >= 0) & (i2sInstNum <= 3))
    	{
    		hI2s->i2sNum    = i2sInstNum;
    		hI2s->chType    = chType;
    		hI2s->opMode    = opMode;
    		hI2s->firstRead = TRUE;
    
    		sysRegs = (CSL_SysRegs *)CSL_SYSCTRL_REGS;
    		/* Configure the Peripheral Reset Control Register in each instance */
        	//CSL_FINS(sysRegs->PRCR, SYS_PRCR_PG3_RST, CSL_SYS_PRCR_PG3_RST_RST);
    		//CSL_FINS(sysRegs->PRCR, SYS_PRCR_PG4_RST, CSL_SYS_PRCR_PG4_RST_RST);
    
    		/* Set Instance hardware registers*/
    		switch(i2sInstNum)
    		{
    			case I2S_INSTANCE0:
    				SYS_peripheralReset(CSL_SYS_PG3);
    				hI2s->hwRegs = (CSL_I2sRegs *)(CSL_I2S0_REGS);
    				CSL_FINS(sysRegs->PCGCR1, SYS_PCGCR1_I2S0CG,
    										CSL_SYS_PCGCR1_I2S0CG_ACTIVE);
    //				CSL_FINS(sysRegs->EBSR, SYS_EBSR_SP0MODE,
    //										CSL_SYS_EBSR_SP0MODE_MODE1);
    				break;
    #if (!(defined(CHIP_C5517)))
    			case I2S_INSTANCE1:
    				SYS_peripheralReset(CSL_SYS_PG3);
    				hI2s->hwRegs = (CSL_I2sRegs *)(CSL_I2S1_REGS);
    				CSL_FINS(sysRegs->PCGCR1, SYS_PCGCR1_I2S1CG,
    										CSL_SYS_PCGCR1_I2S1CG_ACTIVE);
    //				CSL_FINS(sysRegs->EBSR, SYS_EBSR_SP1MODE,
    //										CSL_SYS_EBSR_SP1MODE_MODE1);
    				break;
    #endif
    			case I2S_INSTANCE2:
    				SYS_peripheralReset(CSL_SYS_PG4);
    				hI2s->hwRegs = (CSL_I2sRegs *)(CSL_I2S2_REGS);
    				CSL_FINS(sysRegs->PCGCR1, SYS_PCGCR1_I2S2CG,
    										CSL_SYS_PCGCR1_I2S2CG_ACTIVE);
    //				CSL_FINS(sysRegs->EBSR, SYS_EBSR_PPMODE,
    //										CSL_SYS_EBSR_PPMODE_MODE6);
    				break;
    			case I2S_INSTANCE3:
    				SYS_peripheralReset(CSL_SYS_PG4);
    				hI2s->hwRegs = (CSL_I2sRegs *)(CSL_I2S3_REGS);
    				CSL_FINS(sysRegs->PCGCR1, SYS_PCGCR1_I2S3CG,
    										CSL_SYS_PCGCR1_I2S3CG_ACTIVE);
    //				CSL_FINS(sysRegs->EBSR, SYS_EBSR_PPMODE,
    //										CSL_SYS_EBSR_PPMODE_MODE6);
    				break;
    			default:
    				break;
    		}
    	}
    	hI2s->configured = FALSE;
    	return(hI2s);
    }

    Nice and simply. According to this code it initializes I2S1 if  CHIP_C5517 is none defined. However, it never goes to the case I2S_INSTANCE1. I do not know why, but suspect a bug is somewhere else.

  • Hi Steve,

    Any news?

  • Our CSL expert will be back on Monday.
  • Thank you, appreciate it.
  • Give a try with the CSL example 'CSL_I2S_DMA_MultipleInstanceExample' which exercises all the instances of I2S. Also post your csl_general.h

    - Pratap.
  • /* ============================================================================
     * Copyright (c) 2008-2012 Texas Instruments Incorporated.
     * Except for those rights granted to you in your license from TI, all rights
     * reserved.
     *
     * Software License Agreement
     * Texas Instruments (TI) is supplying this software for use solely and
     * exclusively on TI devices. The software is owned by TI and/or its suppliers,
     * and is protected under applicable patent and copyright laws.  You may not
     * combine this software with any open-source software if such combination would
     * cause this software to become subject to any of the license terms applicable
     * to such open source software.
     *
     * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
     * NO WARRANTIES APPLY TO THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY.
     * EXAMPLES OF EXCLUDED WARRANTIES ARE IMPLIED WARRANTIES OF MERCHANTABILITY
     * AND FITNESS FOR A PARTICULAR PURPOSE AND WARRANTIES OF NON-INFRINGEMENT,
     * BUT ALL OTHER WARRANTY EXCLUSIONS ALSO APPLY. FURTHERMORE, TI SHALL NOT,
     * UNDER ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, CONSEQUENTIAL
     * OR PUNITIVE DAMAGES, FOR ANY REASON WHATSOEVER.
     * ============================================================================
     */
    
    /** @file csl_general.h
     *
     *  @brief CSL general header file
     *
     *  This file contains the general CSL macros or definitions that are required
     *  to enable few functionalities specific to the chip revision. This file is
     *  included in all the cslr files. All the CSL applications should include
     *  this file.
     *
     *  Path: \(CSLPATH)\ inc
     */
    
    /* ============================================================================
     * Revision History
     * ================
     * 07-Jan-2009 Created
     * 28-Apr-2010 Added new macro definitions
     * 30-Jun-2010 Added new macro definitions for platforms
     * 13-Aug-2010 CSL v2.10 release
     * 06-Jul-2011 CSL v2.50 release
     * 20-Jun-2012 Removed VC5504/05 chip versions and added C5517 chip version
     * 13-Sep-2012 CSL v3.00 release
     * 20-Dec-2012 CSL v3.01 release
     * ============================================================================
     */
    
    #ifndef _CSL_GENERAL_H_
    #define _CSL_GENERAL_H_
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    /*
     ******************************************************
     * CAUTION: DEFINE EITHER THE MACROS IN PART1 OR PART2.
     * DO NOT DEFINE MACROS IN BOTH PARTS.
     ******************************************************
     */
    
    /** ***************************************************************************
     * --------------------------------------------------
     * PART1: CHIP VERSION MACRO DEFINITION FOR PG2.1 CSL
     * --------------------------------------------------
     *
     * Below macros are used to enable the source code specific to chip version
     * TMS320C5517C5504.
     *
     * 'CHIP_C5517' indicates TMS320C5517 DSP.
     *
     * Defining the macro below will enable the code for the DSP TMS320C5517.
     */
    
    /* TMS320C5517 */
    //#define CHIP_C5517
    
    
    /******************************* END OF PART1 *******************************/
    
    
    /** ***************************************************************************
     * --------------------------------------------------
     * PART2: CHIP VERSION MACRO DEFINITION FOR PG2.0 CSL
     * --------------------------------------------------
     *
     * Below macros are used to enable the source code specific to chip versions
     * TMS320C5505, TMS320C5515, TMS320C5504, and TMS320C5514.
     * Design revision(DesignRev) of the DIE ID regsiter(0x1C43 & 0x1C44) will have
     * the value '5' for this chip set.
     *
     * 'CHIP_C5505_C5515' indicates TMS320C5505 and TMS320C5515.
     * 'CHIP_C5504_C5514' indicates TMS320C5504 and TMS320C5514.
     *
     * DSPs TMS320C5505 and TMS320C5515 are similar but certain LDOs not bonded out
     * for TMS320C5505 DSP.
     * DSPs TMS320C5504 and TMS320C5514 are similar but certain LDOs not bonded out
     * for TMS320C5504 DSP.
     *
     * DSPs TMS320C55x5 and TMS320C55x4 are having the same peripherals but
     * they differ in the internal memory available. 'x' stands for 0 or 1.
     *
     * Defining any of the below macros will enable the code for all the DSPs
     * TMS320C5504, TMS320C5505, TMS320C5514 and TMS320C5515.
     * Current CSL software does not have the code that is specific to TMS320C5504
     * and TMS320C5514 DSPs.
     */
    
    //#ifndef CHIP_C5517
    
    /* TMS320C5505 and TMS320C5515 */
    #define CHIP_C5505_C5515
    
    /**
     * Below macro was the used to indicate TMS320C5505 and TMS320C5515 in old
     * CSL version. Here it is provided for backward compatibility
     */
    #define CHIP_5515
    
    /** Mapping of the old macros to the new macros */
    
    #ifdef CHIP_5515
    #define CHIP_C5505_C5515
    #endif
    
    /** TMS320C5504 and TMS320C5514 */
    #define CHIP_C5504_C5514
    
    /**
     * Below macro was the used to indicate TMS320C5504 and TMS320C5514 in old
     * CSL version. Here it is provided for backward compatibility
     */
    #define CHIP_5514
    
    /** Mapping of the old macros to the new macros */
    
    #ifdef CHIP_5514
    #define CHIP_C5504_C5514
    #endif
    
    #endif
    
    /******************************* END OF PART2 *******************************/
    
    
    /** ***************************************************************************
     * -----------------------------------------------------------
     * PART3: EVM VERSION MACRO DEFINITION FOR PG2.0 and PG2.1 CSL
     * -----------------------------------------------------------
     *
     * Below macros are used to enable the source code specific to EVM versions
     */
    
    #if (defined(CHIP_C5517))
    /** Macro to define platform as C5517 */
    #define C5517_EVM
    
    #else
    
    //#define C5515_EVM
    
    #if (!(defined(C5515_EVM)))
    /** Macro to define platform as C5515 eZdsp */
    #define C5515_EZDSP
    #endif
    
    #if ( !((defined(C5515_EVM)) | (defined(C5515_EZDSP))) )
    /** Macro to define platform as C5535 eZdsp */
    #define C5535_EZDSP
    #endif
    
    
    #endif
    /******************************* END OF PART3 *******************************/
    
    #ifdef __cplusplus
    }
    #endif
    
    //#endif    // _CSL_GENERAL_H_
    

  • First picture is I2S instance 0. It is an example of how structure should  look like:

    The second one is I2S instance 1:

    And the most interesting thing is that software thinks that Instance 1 is opened successfully. Strange. 

  • Hi Pratap,

    any comments?
  • I checked I2S examples in CSL 3.04 on C5515 EVM and found no issue in opening I2S 1 instance. Double check the changes you have made and make sure C5517 macros are not defined any where in your program.

    - Pratap.
  • Hi Pratap, thank you for reply.

    Once again, look at the picture:

    You can see grey block just above I2S_open function which means there is NO CHIP_5517 defined. I posted my csl_general.h and used CSL_I2S_DMA_MultipleInstanceExample to check the issue as was suggested.  I have 5515eZDSP and 5515EVM and I checked that on both. Result is the same. 

  • One more thing.  What this piece of code is going to check?

    		if (NULL == hI2s)
    		{
    			status = CSL_TEST_FAILED;
    			return (status);
    		}
    		else
    		{
    			printf ("I2S Module Instance %d opened successfully\n", looper);
    		}

    It is always pointing to the hI2s[0] which is I2S instance 0 and it is never changed during opening I2S instances. This code always checking  I2S instance 0.  So that is why you see in the console  "I2S Module Instance 1 opened successfully" however it is simply error. 

  • Hi, 

      Can you confirm your modification in general.h (commenting of C5517 defines) is saved (This doesn't get automatically saved). 

    Regards

     Vasanth

  • Yes, I confirm that I modified  and saved csl_general.h. Macros that enable are:  CHIP_5515 and C5515_EZDSP

  • Also make sure CSL library is re-built with modified csl_general.h.

    - Pratap.
  • Yes, that is it. I rebuilt library and now have no problem. Thank you
  • Hi, did anyone figure this out??
    I have same problem.
    Cannot open I2S1 on TMS320C5535

  • C55XXCSL_LP.lib - is a library file which contains all CSL functions. It has to be included in all projects where CSL is used.

     

    There are at least two reasons why you have to rebuild that library file:

    1. If you change csl_general.h. Here you can define chip and platform. For example CHIP_5515 and C5515_EZDSP
    2. If you need to customise CSL adding or deleting some code stuff.

     

    To rebuild  C55XXCSL_LP.lib follow this procedure:

    1. Import project C55XXCSL_LP to CCS. It is under c55_csl_3.04\c55xx_csl\ccs_v5.0_examples\
    2. Make changes in source code.
    1. Compile project.
    2. Copy C55XXCSL_LP.lib from \ccs_v5.0_examples\C55XXCSL_LP\Debug\ to c55_csl_3.04\c55xx_csl\build\

    C5000 Chip Support Library WIKI page

     

    http://processors.wiki.ti.com/index.php/C5000_Chip_Support_Library

  • Thanks Stan.
    I rebuild the library with CHIP_5515 and C5515_EZDSP defined.
    Now I can open I2S1 port. Thanks.

    Follow up question.
    Are the settings "CHIP_5515" and "C5515_EZDSP" correct for the TMS320C5535?
    There doesn't appear to be any settings for "CHIP_5535", so is "CHIP_5515" the recommended CSL setting for the C5535?