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.

TMS320F28069: Error While Build Project Operation

Part Number: TMS320F28069
Other Parts Discussed in Thread: C2000WARE

Hi, I am trying to configure CLA on TMS320F28069.

But,When I Perform Build Operation, It Shows Error of which i Have Shared Screenshot.

Please Help me to understand and rectify it.

Thank you

;//###########################################################################
;//
;// FILE:  F2806x_Cla.asm
;//
;// TITLE: CLA Assembly Code.
;//
;// This file contains the CLA assembly code.  When building the project
;// containing this file, use C28x codegen V5.2.0 or later with the switch
;// --cla_support=cla0
;//
;//###########################################################################
;// $TI Release: F2806x Support Library v2.04.00.00 $
;// $Release Date: Mon May 27 06:46:38 CDT 2019 $
;// $Copyright:
;// Copyright (C) 2009-2019 Texas Instruments Incorporated - http://www.ti.com/
;//
;// Redistribution and use in source and binary forms, with or without 
;// modification, are permitted provided that the following conditions 
;// are met:
;// 
;//   Redistributions of source code must retain the above copyright 
;//   notice, this list of conditions and the following disclaimer.
;// 
;//   Redistributions in binary form must reproduce the above copyright
;//   notice, this list of conditions and the following disclaimer in the 
;//   documentation and/or other materials provided with the   
;//   distribution.
;// 
;//   Neither the name of Texas Instruments Incorporated nor the names of
;//   its contributors may be used to endorse or promote products derived
;//   from this software without specific prior written permission.
;// 
;// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
;// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
;// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
;// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
;// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
;// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
;// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
;// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
;// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
;// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
;// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;// $
;//###########################################################################

;// Include variables and constants that will be shared in the
;// C28x C-code and CLA assembly code.  This is accomplished by
;// using .cdecls to include a C-code header file that contains
;// these variables and constants

      .cdecls   C,LIST,"CLAShared.h"

;// To include an MDEBUGSTOP (CLA breakpoint) as the first instruction
;// of each task, set CLA_DEBUG to 1.  Use any other value to leave out
;// the MDEBUGSTOP instruction.

CLA_DEBUG .set  1

;// CLA code must be within its own assembly section and must be
;// even aligned.  Note: since all CLA instructions are 32-bit
;// this alignment naturally occurs and the .align 2 is most likely
;// redundant

      .sect    "Cla1Prog"
      .align  2


_Cla1Prog_Start:

_Cla1Task1:
    MSTOP
    MNOP
    MNOP
    MNOP
_Cla1T1End:


_Cla1Task2:
    .if CLA_DEBUG == 1
        MDEBUGSTOP
    .endif
;==============================================
; This task logs the last NUM_DATA_POINTS
; ADCRESULT1 values in the array VoltageCLA
;
; When the last element in the array has been
; filled, the task will go back to the
; the first element.
;
; Before starting the ADC conversions, force
; Task 8 to initialize the ConversionCount to zero
;
;==============================================
    MMOVZ16    MR0,  @_ConversionCount        ;1 Current Conversion
    MMOV16     MAR1, MR0, #_VoltageCLA        ;2 Point to VoltageCLA[ConversionCount]
    MUI16TOF32 MR0,  MR0                      ;3 Convert count to float32
    MADDF32    MR0,  MR0, #1.0                ;4 Add 1 to conversion count
    MCMPF32    MR0,  #NUM_DATA_POINTS.0       ;5 Compare count to max
    MF32TOUI16 MR0,  MR0                      ;6 Convert count to Uint16
    MNOP                                      ;7 Wait till I8 to read result
    MMOVZ16    MR2,  @_AdcResult.ADCRESULT1   ;8 Read ADCRESULT1
    MMOV16     *MAR1, MR2                     ;  Store ADCRESULT1
    MBCNDD     _RestartCount, GEQ             ;  If count >= NUM_DATA_POINTS
    MMOVIZ     MR1,  #0.0                     ;  Always executed: load MR1 with 0
    MNOP
    MNOP
    MMOV16      @_ConversionCount, MR0        ;  If branch not taken, store current count
    MSTOP
_RestartCount
    MMOV16      @_ConversionCount, MR1        ;  If branch taken, restart count
    MSTOP
    MNOP
    MNOP
    MNOP
_Cla1T2End:


_Cla1Task3:
    MSTOP
    MNOP
    MNOP
    MNOP
_Cla1T3End:


_Cla1Task4:
    MSTOP
    MNOP
    MNOP
    MNOP
_Cla1T4End:


_Cla1Task5:
    MSTOP
    MNOP
    MNOP
    MNOP
_Cla1T5End:

_Cla1Task6:
    MSTOP
    MNOP
    MNOP
    MNOP
_Cla1T6End:

_Cla1Task7:
    MSTOP
    MNOP
    MNOP
    MNOP
_Cla1T7End:

_Cla1Task8:
;==============================================
; This task initializes the ConversionCount
; to zero
;==============================================
    MMOVIZ  MR0,  #0.0
    MMOV16  @_ConversionCount, MR0
    MSTOP
_Cla1T8End:



_Cla1Prog_End:


    .end
    .include "CLAShared.h"

;
; End of File
;


//###########################################################################
//
// FILE:   CLAShared.h
//
// TITLE:  CLA and CPU shared variables and constants
//
//###########################################################################
// $TI Release: F2806x Support Library v2.04.00.00 $
// $Release Date: Mon May 27 06:46:38 CDT 2019 $
// $Copyright:
// Copyright (C) 2009-2019 Texas Instruments Incorporated - http://www.ti.com/
//
// Redistribution and use in source and binary forms, with or without 
// modification, are permitted provided that the following conditions 
// are met:
// 
//   Redistributions of source code must retain the above copyright 
//   notice, this list of conditions and the following disclaimer.
// 
//   Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the 
//   documentation and/or other materials provided with the   
//   distribution.
// 
//   Neither the name of Texas Instruments Incorporated nor the names of
//   its contributors may be used to endorse or promote products derived
//   from this software without specific prior written permission.
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//###########################################################################

#ifndef CLA_SHARED_H
#define CLA_SHARED_H

#ifdef __cplusplus
extern "C" {
#endif

//
// Included Files
//
  #include "IQmathLib.h"
  #include "DSP28x_Project.h"

//
// Defines
//
  #define NUM_DATA_POINTS 20

  extern Uint16 ConversionCount;
  extern Uint16 VoltageCLA[NUM_DATA_POINTS];
//
// The following are symbols defined in the CLA assembly code
// Including them in the shared header file makes them
// .global and the main CPU can make use of them.
//
  extern Uint32 Cla1Task1;
  extern Uint32 Cla1Task2;
  extern Uint32 Cla1Task3;
  extern Uint32 Cla1Task4;
  extern Uint32 Cla1Task5;
  extern Uint32 Cla1Task6;
  extern Uint32 Cla1Task7;
  extern Uint32 Cla1Task8;
  extern Uint32 Cla1Prog_Start;
  extern Uint32 Cla1T1End;
  extern Uint32 Cla1T2End;
  extern Uint32 Cla1T3End;
  extern Uint32 Cla1T4End;
  extern Uint32 Cla1T5End;
  extern Uint32 Cla1T6End;
  extern Uint32 Cla1T7End;
  extern Uint32 Cla1T8End;

#ifdef __cplusplus
}
#endif /* extern "C" */


#endif  // end of CLA_SHARED definition

//
// End of File
//

/*==================================================================================*/
/*	User specific Linker command file for running from FLASH						*/
/*==================================================================================*/
/*	FILE:			F2806x_FLASH_DeadBandPWM.CMD
/*                                                                                  */
/*	Description:	Linker command file for User custom sections targetted to run   */
/*					from FLASH.  			                                        */
/*                                                                                  */
/*  Target:  		TMS320F2806x					                                */
/*                                                                                  */
/*	Version: 		1.0                                 							*/
/*                                                                                  */
/*----------------------------------------------------------------------------------*/
/*  Copyright Texas Instruments © 2010                                			    */	
/*----------------------------------------------------------------------------------*/
/*  Revision History:                                                               */
/*----------------------------------------------------------------------------------*/
/*  Date	  | Description                                                         */
/*----------------------------------------------------------------------------------*/
/*  01/11/11  | Release 1.0  		 			                                    */
/*----------------------------------------------------------------------------------*/
 

 /* Define the memory block start/length for the F2806x  
   PAGE 0 will be used to organize program sections
   PAGE 1 will be used to organize data sections

   Notes: 
         Memory blocks on F2806x are uniform (ie same
         physical memory) in both PAGE 0 and PAGE 1.  
         That is the same memory region should not be
         defined for both PAGE 0 and PAGE 1.
         Doing so will result in corruption of program 
         and/or data. 
         
         The L0 memory block is mirrored - that is
         it can be accessed in high memory or low memory.
         For simplicity only one instance is used in this
         linker file. 
         
         Contiguous SARAM memory blocks or flash sectors can be
         be combined if required to create a larger memory block. 
*/
 
 MEMORY
{
PAGE 0:
   /* Program Memory */
   /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */

	BOOT_RSVD   : origin = 0x000000, length = 0x000050     /* Part of M0, BOOT rom will use this for stack */
	progRAM		: origin = 0x008000, length = 0x000C00
	CLAPROGRAM  : origin = 0x009000, length = 0x001000     /* on-chip RAM block L3 */
	OTP         : origin = 0x3D7800, length = 0x000400     /* on-chip OTP */
	FLASHH      : origin = 0x3D8000, length = 0x004000     /* on-chip FLASH */
   	FLASHG      : origin = 0x3DC000, length = 0x004000     /* on-chip FLASH */
   	FLASHF      : origin = 0x3E0000, length = 0x004000     /* on-chip FLASH */
   	FLASHE      : origin = 0x3E4000, length = 0x004000     /* on-chip FLASH */   
   	FLASHD      : origin = 0x3E8000, length = 0x004000     /* on-chip FLASH */
   	FLASHC      : origin = 0x3EC000, length = 0x004000     /* on-chip FLASH */
   	FLASHA      : origin = 0x3F4000, length = 0x003F80     /* on-chip FLASH */
	CSM_RSVD    : origin = 0x3F7F80, length = 0x000076     /* Part of FLASHA.  Program with all 0x0000 when CSM is in use. */
	BEGIN       : origin = 0x3F7FF6, length = 0x000002     /* Part of FLASHA.  Used for "boot to Flash" bootloader mode. */
	CSM_PWL     : origin = 0x3F7FF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA */
	
   	FPUTABLES   : origin = 0x3FD860, length = 0x0006A0	  /* FPU Tables in Boot ROM */
   	IQTABLES    : origin = 0x3FDF00, length = 0x000B50     /* IQ Math Tables in Boot ROM */
   	IQTABLES2   : origin = 0x3FEA50, length = 0x00008C     /* IQ Math Tables in Boot ROM */
   	IQTABLES3   : origin = 0x3FEADC, length = 0x0000AA	  /* IQ Math Tables in Boot ROM */

	BOOTROM     : origin = 0x3FF3B0, length = 0x000C10     /* Boot ROM */
	RESET       : origin = 0x3FFFC0, length = 0x000002     /* part of boot ROM  */
	VECTORS     : origin = 0x3FFFC2, length = 0x00003E     /* part of boot ROM  */

PAGE 1 : 

   /* Data Memory */
   /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
   /* Registers remain on PAGE1 */

	RAMM0       : origin = 0x000050, length = 0x0003B0     /* on-chip RAM block M0 */
   	RAMM1       : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
	dataRAM		: origin = 0x008C00, length = 0x001400
	CLA1_MSGRAMLOW    : origin = 0x001480, length = 0x000080
    CLA1_MSGRAMHIGH   : origin = 0x001500, length = 0x000080
   	RAML4       : origin = 0x00A000, length = 0x002000     /* on-chip RAM block L4 */
   	RAML5       : origin = 0x00C000, length = 0x002000     /* on-chip RAM block L5 */
   	RAML6       : origin = 0x00E000, length = 0x002000     /* on-chip RAM block L6 */
   	RAML7       : origin = 0x010000, length = 0x002000     /* on-chip RAM block L7 */
   	RAML8       : origin = 0x012000, length = 0x002000     /* on-chip RAM block L8 */ 
	FLASHB      : origin = 0x3F4000, length = 0x002000
}
 
 
SECTIONS
{


   /* Allocate program areas: */


   .cinit              	: > FLASHA,     PAGE = 0
   .pinit              	: > FLASHA,     PAGE = 0
   .text               	: > FLASHA | FLASHC | FLASHD,     PAGE = 0

   codestart           : > BEGIN       PAGE = 0
   ramfuncs            : LOAD = FLASHA, 
                         RUN = progRAM, 
                         LOAD_START(_RamfuncsLoadStart),
                         LOAD_END(_RamfuncsLoadEnd),
                         RUN_START(_RamfuncsRunStart),
                         PAGE = 0

   csmpasswds          : > CSM_PWL     PAGE = 0
   csm_rsvd            : > CSM_RSVD    PAGE = 0
   
   Cla1Prog          : LOAD = FLASHE,
                       RUN = CLAPROGRAM,
                       LOAD_START(_Cla1funcsLoadStart),
                       LOAD_SIZE(_Cla1funcsLoadSize),
                       RUN_START(_Cla1funcsRunStart),
                       PAGE = 0

   /* Allocate uninitalized data sections: */
   .stack           : > RAMM0,      PAGE = 1
   .ebss            : > dataRAM,    PAGE = 1
   .esysmem         : > dataRAM,      PAGE = 1
   Cla1ToCpuMsgRAM   : > CLA1_MSGRAMLOW,   PAGE = 1
   CpuToCla1MsgRAM   : > CLA1_MSGRAMHIGH,  PAGE = 1
   Cla1DataRam0      : > RAML4,          PAGE = 1
   Cla1DataRam1      : > RAML4,          PAGE = 1
   Cla1DataRam2      : > RAML4,          PAGE = 1
#ifdef CLA_C
   .scratchpad       : > RAML4,       PAGE = 1
   .bss_cla          : > RAML4,       PAGE = 1
   .const_cla        : > RAML4,       PAGE = 1
#endif

   /* Initalized sections go in Flash */
   /* For SDFlash to program these, they must be allocated to page 0 */
   .econst             : > FLASHA      PAGE = 0
   .switch             : > FLASHA      PAGE = 0      

   /* Allocate IQ math areas: */
   IQmath              : > FLASHA      PAGE = 0                  /* Math Code */
   IQmathTables        : > IQTABLES    PAGE = 0, TYPE = NOLOAD   /* Math Tables In ROM */

   /* Uncomment the section below if calling the IQNexp() or IQexp()
      functions from the IQMath.lib library in order to utilize the 
      relevant IQ Math table in Boot ROM (This saves space and Boot ROM 
      is 1 wait-state). If this section is not uncommented, IQmathTables2
      will be loaded into other memory (SARAM, Flash, etc.) and will take
      up space, but 0 wait-state is possible.
   */
   /*
   IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD 
   {
   
              IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)
   
   }
   */
   /* Uncomment the section below if calling the IQNasin() or IQasin()
      functions from the IQMath.lib library in order to utilize the 
      relevant IQ Math table in Boot ROM (This saves space and Boot ROM 
      is 1 wait-state). If this section is not uncommented, IQmathTables2
      will be loaded into other memory (SARAM, Flash, etc.) and will take
      up space, but 0 wait-state is possible.
   */
   /*
   IQmathTables3    : > IQTABLES3, PAGE = 0, TYPE = NOLOAD 
   {
   
              IQmath.lib<IQNasinTable.obj> (IQmathTablesRam)
   
   }   
   */
 
   .reset              : > RESET,      PAGE = 0, TYPE = DSECT
   vectors             : > VECTORS     PAGE = 0, TYPE = DSECT

}
    
    
SECTIONS
{
	Net_terminals:	> dataRAM,PAGE = 1
}



 

  • Mihir,

    What is the error? We do not see your error log.

  • Hi, 

    Basically, whenever I build Program it gives me error, 

    " [E0002] CLA instruction requires valid CLA.asm"

    And, In F2806X_CLA. asm all the Assembly Instructions are Highlighted by "x" sign in left side in red color.

    Thank you

  • Mihir,

    Is this new project you created or you have imported example from C2000ware SDK?

    Can you please check the CCS compiler option if you have CCS support is selected?

  • Hi,

    I Have imported tms320f28069 control sticks Deadband Example.file.

    No its blank compared to screenshot.

  • Hi,

    I Have imported tms320f28069 control sticks Deadband Example.file.

    Yes  Cla0 is selected.

  • Can you point me to the example you have imported from?

    Also, can you try one of the C2000ware CLA example and try building it?

    C:\ti\C2000\C2000Ware_3_02_00_00\device_support\f2806x\examples\cla

    What is CCS version and C2000ware sdk version you are using?

  • Hi,

    I am Using C:\ti\c2000\C2000Ware_2_00_00_02\libraries\math\CLAmath\c28\examples\sin  for Running CLA from Flash as a reference for Linker Command File.

    And,Used this Example for CLA Operating with ADC.(C:\ti\c2000\C2000Ware_2_00_00_02\device_support\f2806x\examples\c28\cla_adc)

    Hey,One Update , I rectified that Error now,

    When I Run Project I have Assigned one Testbit Variable in (_CLAISR2),  So that Whenever CLA2 Task Completes "TestBit "is Incremented by one.

    But ,Testbit is not Changing.

    Thank you.

    //----------------------------------------------------------------------------------
    //	FILE:	DeadBandPWM-Main.c
    //			(DeadBand is applied to Up, Single Edge Asymmetric Waveform, With Independent 
    //			Modulation on EPWM2A and EPWM2B)
    //
    //	Description:	This program sets up the EV TIMER2 to generate complimentary 
    //			PWM waveforms with certain amount of dead bands .Observe
    //			the waveforms comparatively using a scope from ePWM2A and ePWM2B pins.
    
    //			-In order to change the PWM frequency, the user should change 
    //			the value of"period". 
    //			-The PWM waveforms can be re-configured by registers under 'set actions'. 
    //			-To observe other PWM pins, the related PWM clocks and GPIO MUX configuration
    //			 settings (in ePWM_Sym-DevInit_F28xxx.c)should be set properly.
    //          For further details, please search for the SPRU791.PDF (TMS320x28xx,
    //			28xxx Enhanced Pulse Width Modulator Module) at ti.com.
    //
    //  Target:  		TMS320F2806x or TMS320F2803x families (F28069)
    //
    //----------------------------------------------------------------------------------
    //  $TI Release:$ 	V1.0
    //  $Release Date:$ 11 Jan 2010 - VSC
    //----------------------------------------------------------------------------------
    //
    // PLEASE READ - Useful notes about this Project
    
    // Although this project is made up of several files, the most important ones are:
    //	    - "DeadBandPWM.c",	this file
    //		- Application Initialization, Peripheral config
    //		- Application management
    //		- Slower background code loops and Task scheduling
    //	 "DeadBandPWM-DevInit_F28xxx.c"
    //		- Device Initialization, e.g. Clock, PLL, WD, GPIO mapping
    //		- Peripheral clock enables
    // The other files are generally used for support and defining the registers as C
    // structs. In general these files will not need to be changed.
    //   "F2806x_RAM_DeadBandPWM.CMD" or "F2806x_FLASH_DeadBandPWM.CMD"
    //		- Allocates the program and data spaces into the device's memory map.
    //   "F2806x_Headers_nonBIOS.cmd" and "F2806x_GlobalVariableDefs.c"
    //		- Allocate the register structs into data memory.  These register structs are
    //		  defined in the peripheral header includes (F2806x_Adc.h, ...) 
    //
    //----------------------------------------------------------------------------------
    
    #include "PeripheralHeaderIncludes.h"
    #include "F2806x_EPwm_defines.h" 	    // useful defines for initialization
    #include "F2806x_Examples.h"   // F2806x Examples Include File
    #include "F2806x_Device.h"     // F2806x Headerfile Include File
    #include "DSP28x_Project.h"     // Device Headerfile and Examples Include File
    #include "piccolo_lcd.h"
    
    //#include "cla_shared.h"
    //#include "cla_sin.cla"
    #include "CLAShared.h"
    //#include <stdint.h>
    #include "string.h"
    
    #define busvoltage 1240
    																		 
    
    //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // FUNCTION PROTOTYPES
    //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    
    void DeviceInit(void);
    void InitFlash(void);
    void MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr);
    //void initpwm34();
    unsigned int VVL=0;
    
    extern Uint16 Cla1funcsLoadStart;
    extern Uint16 Cla1funcsLoadEnd;
    extern Uint16 Cla1funcsRunStart;
    extern Uint16 Cla1funcsLoadSize;
    //__interrupt void cla1_isr2(void);
    
    // Global variables used in this example:
    __interrupt void cla1_isr2(void);
    
    // Global variables used in this example:
    #pragma DATA_SECTION(ConversionCount, "Cla1ToCpuMsgRAM");
    #pragma DATA_SECTION(VoltageCLA,      "Cla1ToCpuMsgRAM");
    
    Uint16 ConversionCount;
    Uint16 LoopCount;
    Uint16 VoltageCLA[NUM_DATA_POINTS];
    unsigned int testbit=0;
    
    // These are defined by the linker file
    //*******************************************************************************************
    
    //********************************************************************************************
    
    
    
    
    //#define DELAY_US(A)  DSP28x_usDelay(((((long double) A * 1000.0L) / (long double)CPU_RATE) - 9.0L) / 5.0L)
    
    //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    // MAIN CODE - starts here
    //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    void main(void) {
    
    //=================================
    //	INITIALISATION - General
    //=================================
    
    	DeviceInit();	// Device Life support & GPIO mux settings
        // Step 3. Clear all interrupts and initialize PIE vector table:
        // Disable CPU interrupts
           DINT;
    
        // Initialize the PIE control registers to their default state.
        // The default state is all PIE interrupts disabled and flags
        // are cleared.
        // This function is found in the F2806x_PieCtrl.c file.
           InitPieCtrl();
    
        // Disable CPU interrupts and clear all CPU interrupt flags:
           IER = 0x0000;
           IFR = 0x0000;
    
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        // This will populate the entire table, even if the interrupt
        // is not used in this example.  This is useful for debug purposes.
        // The shell ISR routines are found in F2806x_DefaultIsr.c.
        // This function is found in F2806x_PieVect.c.
           InitPieVectTable();
        EALLOW;  // This is needed to write to EALLOW protected register
           PieVectTable.CLA1_INT2 = &cla1_isr2;
        EDIS;
        InitAdc();         // For this example, init the ADC
        AdcOffsetSelfCal();
        PieCtrlRegs.PIEIER11.bit.INTx2 = 1;      // Enable INT 11.2 in the PIE (CLA Task2)
        IER |= M_INT11;                          // Enable CPU Interrupt 11
        EINT;                                    // Enable Global interrupt INTM
        ERTM;                                    // Enable Global realtime interrupt DBGM
    
    // Only used if running from FLASH
    // Note that the variable FLASH is defined by the compiler (-d FLASH)
    #ifdef FLASH		
    // Copy time critical code and Flash setup code to RAM
    // The  RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart
    // symbols are created by the linker. Refer to the linker files. 
        MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
    
    	//memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (uint32_t)&RamfuncsLoadSize);
        memcpy(&Cla1funcsRunStart, &Cla1funcsLoadStart, (Uint32)&Cla1funcsLoadSize);
    
    // Call Flash Initialization to setup flash wait states
    // This function must reside in RAM vcxz
    	InitFlash();	// Call the flash wrapper init function
    #endif //(FLASH)
    	// Initialize the CLA registers
    
    
    
    
    	      EALLOW;
    	        Cla1Regs.MVECT2 = (Uint16) (&Cla1Task2 - &Cla1Prog_Start)*sizeof(Uint32);
    	        Cla1Regs.MVECT8 = (Uint16) (&Cla1Task8 - &Cla1Prog_Start)*sizeof(Uint32);
    	        Cla1Regs.MPISRCSEL1.bit.PERINT2SEL = CLA_INT2_ADCINT2; // ADCINT2 starts Task 2
    	        Cla1Regs.MMEMCFG.bit.PROGE = 1;          // Map CLA program memory to the CLA
    	        Cla1Regs.MCTL.bit.IACKE = 1;             // Enable IACK to start tasks via software
    	        Cla1Regs.MIER.all = (M_INT8 | M_INT2);   // Enable Task 8 and Task 2
    	        Cla1ForceTask8andWait();                 // Force CLA task 8.
    	                                                 // This will initialize ConversionCount to zero
    
    	        AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1;   // Enable non-overlap mode
    	        AdcRegs.ADCCTL1.bit.INTPULSEPOS = 0;     // ADCINT trips when ADC begins conversion
    	        AdcRegs.INTSEL1N2.bit.INT2E     = 1;     // Enable ADCINT2
    	        AdcRegs.INTSEL1N2.bit.INT2CONT  = 0;     // Disable ADCINT2 Continuous mode
    	        AdcRegs.INTSEL1N2.bit.INT2SEL   = 1;     // setup EOC1 to trigger ADCINT2 to fire
    	        AdcRegs.ADCSOC1CTL.bit.CHSEL    = 2;     // set SOC1 channel select to ADCINA2
    	        AdcRegs.ADCSOC1CTL.bit.TRIGSEL  = 5;     // set SOC1 start trigger on EPWM1A
    	        AdcRegs.ADCSOC1CTL.bit.ACQPS    = 6;     // set SOC1 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
    	        EDIS;// Enable Global realtime interrupt DBGM
    	        // Assumes ePWM1 clock is already enabled in InitSysCtrl();
    	           EALLOW;
    	           SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0;
    	           EDIS;
    	           EPwm1Regs.ETSEL.bit.SOCAEN   = 1;        // Enable SOC on A group
    	           EPwm1Regs.ETSEL.bit.SOCASEL  = 4;        // Select SOC from from CPMA on upcount
    	           EPwm1Regs.ETPS.bit.SOCAPRD   = 1;        // Generate pulse on 1st event
    	           EPwm1Regs.CMPA.half.CMPA     = 0x0080;   // Set compare A value
    	           EPwm1Regs.TBPRD              = 0xFFFF;   // Set period for ePWM1 - this will determine the sampling frequency
    	           EPwm1Regs.TBCTL.bit.CTRMODE  = 0;        // count up and start
    
    	        EALLOW;
    	           SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1;
    	        EDIS;
    	  while(1)
    	      {
    	       /*VVL=EPwm1Regs.TBCTR;
    	       jooj=VVL;
    	       if(jooj<40000){
    
    
    	           GpioDataRegs.GPBSET.bit.GPIO58 = 1;
    
    
    
    	       }else{
    	           EALLOW;
    	           GpioDataRegs.GPBCLEAR.bit.GPIO58 = 1;
    
    
    	       }*/
    
    
    
    	      }
    
    
    
    
    
    }
    
    
    
    
    
    
    __interrupt void cla1_isr2()
    {
        testbit++;
        AdcRegs.ADCINTFLGCLR.bit.ADCINT2 = 1;    // Clear ADCINT2 flag reinitialize for next SOC
        PieCtrlRegs.PIEACK.all = 0xFFFF;
    }
    
    

  • Did you set the break-point in ISR?  ISR does not work?

  • Hi, 

    I didn't set the break-point in ISR.

    But, I have one Doubt that should I select "CLA0"   OR "CLA1" in specify cla support.

    Thank you

  • Hi, 

    I am Attaching Project File.

    2480.CLA_Test.zip

  • Hi, I have Attached my Entire Project file please suggest me solution to rectify this problem.

    My goal is just to run CLA with core.

    Thank you

  • You should use CLA0

  • Sure I will also do that.

    When you get time could you please inspect my project file which I have sent.

  • Hi,

    It is Showing "Break at address "0x9000" with no debug information available, or outside of program code." error when i try to debug CLA.

    I have Uploaded Image of same.

    Thank you

  • Mihir,

    I am assuming that you are able to compile it successfully now, is that correct?

    For CLA, you will need to load symbol  CCS menu Run -> Load -> Load Symbol and point to the same out file.

    If you want to stop, then you will need to add following statement in CLA task function.

    __mdebugstop();

  • Hi,

    I will try that.And what about That Error of which i have sent Screenshoot.

    And could you please sent me Linker command file which i can use for CLA and c28 combined project.

    which is suitable for Experimenter kit TMS320F28069.

    Thank you

  • Hi Mihir,

    mihir dave said:
    And could you please sent me Linker command file which i can use for CLA and c28 combined project.

    You can find linker command files at:

    C:\ti\C2000\C2000Ware_3_02_00_00\device_support\f2806x\common\cmd

  • Hi,

    My Last Project was not working even after successful Compilation.

    So, I Have to use one the available example of "CLA" Located named "CLA_SIN" in CLAMath Folder.

    This Example is working fine.

    But, I have some doubts,

    1-All the CLA Tasks are FORCED by CPU , So what changes i have to do in this particular Example to make "CLA Task" Interrupt Driven.

    2-As in "CLA_ADC" Example in which "INTERRUPT VOID CLA1_TASK_ISR(VOID)"  is executed after Completion of Particular CLA TASK.

    3-I Have to implement same Interrupt driven operation ("WHICH I HAVE MENTION IN POINT 2) after Completion of particular cla task which not used in "CLA_SIN" Example.

    Link  of  example project  : (C:\ti\c2000\C2000Ware_2_00_00_02\libraries\math\CLAmath\c28\examples\sin);

    Thank you

  • Mihir,

    Please refer to link below. It will answer your questions regarding CLA programming:

    https://software-dl.ti.com/C2000/docs/cla_software_dev_guide/index.html

  • Hi, 

    I have clicked on "resolved".

    So , now as per email I should receive "free shipping coupon".

    Please send me so that I can make use of it.

    Thank you

    Your Faithfully

    Mihir Dave