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/TMS320F28027: TMS320F28027 processing speed

Part Number: TMS320F28027


Tool/software: Code Composer Studio

Hi All,

I am currently working on a project with Piccolo TMS320F28027 and trying to interface a 10 Axis IMU (GY-86) breakout board, the board has MPU6050+ HMC5883LC+MS5611 sensors that be connected via the I2C bus. I am able to talk to the sensor and get the sensor :)  i am also able to run a data fusion on Accelerometer and Gyroscope to calculate the roll and pitch angles. I am also able to run a tilt compensation algorithm on the magnetometer to calculate the heading...

All this is in inside a cpu timer every 2 msec. I am invoking the timer every 2 msec which fetches the sensor data using I2C at 400 kHz the running intensive mathematical operations lke bunch of divisions, multiplications and some trigonometric operations...so I was curious about the execution time so i set a GPIO high at the start of the operation and set it low at the end....Using an oscilloscope i measured the pulse width and to my surprise the pulse width is just 20-40 us. Is this true ? 

Or am i making a mistake ?

I also cross checked using break points and tried measuring the clock cycles using CCS and the clock display showed around 450,000 clock cycles so i am really confused on which is true...

All the operations are done using fixed point library based on IQ math and the code is running on flash memory...

Could someone please give me some suggestions about this ? void A1 does the data handling and calculation of the angles.....

Please find below the code:

void A0(void)
{
// loop rate synchronizer for A-tasks
if(CpuTimer2Regs.TCR.bit.TIF == 1)
{
CpuTimer2Regs.TCR.bit.TIF = 1; // clear flag
//-----------------------------------------------------------
(*A_Task_Ptr)(); // jump to an A Task (A1,A2,A3,...)
//-----------------------------------------------------------
}
}
void A1(void) 
//--------------------------------------------------------
{
_iq roll,pitch, cosRoll, sinRoll, cosPitch, sinPitch, Xh, Yh;
interruptCount++;
GPIO_setLow(myGpio, GPIO_Number_0); //start of the code 
accel_x=I2CA_Read2Bytes(MPU6050_RA_ACCEL_XOUT_L,MPU6050_RA_ACCEL_XOUT_H, MPU6050_ADD); //reading raw accelerometer x axis
accel_y=I2CA_Read2Bytes(MPU6050_RA_ACCEL_YOUT_L,MPU6050_RA_ACCEL_YOUT_H, MPU6050_ADD);//reading raw accelerometer y axis
accel_z=I2CA_Read2Bytes(MPU6050_RA_ACCEL_ZOUT_L,MPU6050_RA_ACCEL_ZOUT_H, MPU6050_ADD);//reading raw accelerometer z axis
gyro_x=I2CA_Read2Bytes(MPU6050_RA_GYRO_XOUT_L,MPU6050_RA_GYRO_XOUT_H, MPU6050_ADD);//reading raw gyro x axis
gyro_y=I2CA_Read2Bytes(MPU6050_RA_GYRO_YOUT_L,MPU6050_RA_GYRO_YOUT_H, MPU6050_ADD);//reading raw gyro y axis
gyro_z=I2CA_Read2Bytes(MPU6050_RA_GYRO_ZOUT_L,MPU6050_RA_GYRO_ZOUT_H, MPU6050_ADD);//reading raw gyro z axis
ax=_IQdiv(_IQ((int)accel_x),_IQ(16384)); // converting raw data x to g

ay=_IQdiv(_IQ((int)accel_y),_IQ(16384)); // converting raw  data y to g

az=_IQdiv(_IQ((int)accel_z),_IQ(16384)); // converting raw data z to g

gx=_IQdiv(_IQ((int)gyro_x),_IQ(65.5)); // converting raw gyro x to dps
gy=_IQdiv(_IQ((int)gyro_y),_IQ(65.5));// converting raw gyro y to dps
gz=_IQdiv(_IQ((int)gyro_z),_IQ(65.5));// converting raw gyro z to dps

roll = _IQatan2(ax,az);// roll angle
roll = _IQmpy(_IQ(180/3.14),roll); //converting to deg.
pitch = _IQatan2(ay,az);//_IQmpy(_IQ(180/3.14),_IQatan(1.0)); // pitch angle
pitch = _IQmpy(_IQ(180/3.14),pitch); // converting to deg
pitch_angle = _IQmpy(_IQ(0.96),(pitch_angle+_IQmpy(gy,_IQ(0.005))))+_IQmpy(_IQ(0.04),pitch); // data fusion gyro accelerometer 
roll_angle = _IQmpy(_IQ(0.96),(roll_angle+_IQmpy(gx,_IQ(0.005))))+_IQmpy(_IQ(0.04),roll); // data fusion gyro acelerometer

cosRoll = _IQcos(_IQdiv(pitch_angle,_IQ(57.29582))); //cosine of roll angle calculations for tilt compensation in rad
sinRoll = _IQsin(_IQdiv(pitch_angle,_IQ(57.29582))); // sine of roll angle calculations for tilt compensation in rad
cosPitch = _IQcos(_IQdiv(roll_angle,_IQ(57.29582)));// cosine of pitch angle calculations for tilt compensation in rad
sinPitch = _IQsin(_IQdiv(roll_angle,_IQ(57.29582)));// sine of pitch angle calculations for tilt compensation in rad
mag_x=I2CA_Read2Bytes(HMC5883L_RA_DATAX_L,HMC5883L_RA_DATAX_H, HMC5883L_ADDRESS); 
mag_y=I2CA_Read2Bytes(HMC5883L_RA_DATAY_L,HMC5883L_RA_DATAY_H, HMC5883L_ADDRESS);
mag_z=I2CA_Read2Bytes(HMC5883L_RA_DATAZ_L,HMC5883L_RA_DATAZ_H, HMC5883L_ADDRESS);
magx = _IQmpy(_IQ((int)mag_x),_IQ(0.73));
magy = _IQmpy(_IQ((int)mag_y),_IQ(0.73));
magz = _IQmpy(_IQ((int)mag_z),_IQ(0.73));
heading = _IQatan2(magy,magx);

Xh = _IQmpy(magx,cosPitch) + _IQmpy(magz,sinPitch);

Yh = _IQmpy(_IQmpy(magx,sinRoll), sinPitch) + _IQmpy(magy,cosRoll) - _IQmpy(_IQmpy(magz,sinRoll), cosPitch);

if(heading_tilt<0)
{
heading_tilt=heading_tilt+_IQ(6.28);
}
if (heading > _IQ(6.2918))
{
heading_tilt=heading_tilt-_IQ(6.2918);
}

heading_tilt = _IQmpy(heading_tilt,_IQ(57.29582));
GPIO_GPIO_setHigh(myGpio, GPIO_Number_0); // end of the code

}


  • hi all sorry having issues posting on this thread....some reason the page just keeps loading !!!! 

  • Setting and clearing a GPIO pin is a reliable way to measure the execution time while the code is running. The timing will be influenced by memory (flash vs. RAM) and if other ISRs etc. are running. Looking at the code, I would expect about 1,000 cycles for the IQmath functions. I don't know what your expectation is for the I2C read function cycles, but if they're small functions the 20-40us number seems about right.

    If you set break-points at the start and end of the A1 function, run to the first one and zero the clock, then run to the second one, you should be seeing a number like this. Again, if there are other functions pre-empting this one you will get a different number. I can't account for the 450,000 cycles you're seeing.

    Depending on available memory, what you can try is to move the A1 code into RAM and measure the cycle count again there. It should go down. Anyway, your GPIO method is valid and seems realistic.

    Regards,

    Richard
  • Hello Richard,

    Thanks for your reply. I was able to measure the execution of function using toggling GPIO with an oscilloscope, it take 1.3 ms ! not 20 us. This was my mistake i set the GPIO high at the start and low after the execution, I got confused with the blinking of the LED0 connected to GPIO0.
    The complete execution of the math operations are about 500 us. I have some issues fetching data with I2C.

    I tried executing A1 from RAM by using

    #pragma CODE_SECTION(A1,"ramfunc");

    but this causes CCS to create a warning

    Description Resource Path Location Type
    creating output section "ramfunc" without a SECTIONS specification Example_F2802xLaunchPadDemo C/C++ Problem

    and on execution the DSP enters into an illegal ISR. Could you please tell me how to do this ???

    also CCS does not let me put in break points in the code, i get the following error:
    "There is no AET resource to support this job"

    I can only add one breakpoint at a time. So what i did was
    1.upload the code
    2. go the line "GPIO_setLow(myGpio, GPIO_Number_0);"( //start of the code) insert break point
    3. CCS->Run->Clock->Enable
    4. when the code reached 2...i reset the clock to 0
    5. I have now remove the break point from 2 and reinsert it again at GPIO_GPIO_setHigh(myGpio, GPIO_Number_0); // end of the code
    6. The value displayed on the clock is around 450,000

    I dont know if its correct or something else is going on....
  • You first problem sounds like you have not told the linker where to place the "ramfunc" section.  You have created that name with the pragma, so the linker needs to know where it goes.  Take a look in the SECTIONS part of your linker command file to make sure it's there.

    Your second problem sounds like you are trying to set break-points in flash.  There is no practical limit to the number of RAM break-points you can set, but if your code is in flash you can only set two (one of which may be reserved by CCS).  If you are expecting your code to be executing out or RAM, check you have copied it over correctly (from the linker error above I suspect this hasn't been done). You can tell by opening a disassembly window and checking the program memory address when the break-point is reached. 

    It doesn't explain the profile clock result, but keep in mind if you are running from flash the execution speed will be slower.  Assuming you have initialized the flash correctly, you may see only about 30 MIPS or so.  I think there must be some other explanation for that number but I can't see what it is from the description.

    Regards,

    Richard

  • Hello Richard,


    thanks a lot for your quick reply. Please find below the part of the linker file. "Ramfunc" are defined in the linker file under sections.

    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 = 0x000800
    //PRAML0 : origin = 0x008000, length = 0x000800 /* on-chip RAM block L0 */
    FLASHD : origin = 0x3F0000, length = 0x002000 /* on-chip FLASH */
    FLASHC : origin = 0x3F2000, length = 0x002000 /* on-chip FLASH */

    FLASHA : origin = 0x3F6000, length = 0x001F80 /* on-chip FLASH */

    OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
    //FLASHD : origin = 0x3F0000, length = 0x002000 /* on-chip FLASH */
    // FLASHC : origin = 0x3F2000, length = 0x002000 /* on-chip FLASH */
    // FLASHA : origin = 0x3F6000, length = 0x001F80 /* 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 */

    //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_P0 : origin = 0x3F7FF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */


    IQTABLES : origin = 0x3FE000, length = 0x000B50 /* IQ Math Tables in Boot ROM */
    IQTABLES2 : origin = 0x3FEB50, length = 0x00008C /* IQ Math Tables in Boot ROM */
    IQTABLES3 : origin = 0x3FEBDC, length = 0x0000AA /* IQ Math Tables in Boot ROM */

    ROM : origin = 0x3FF27C, length = 0x000D44 /* 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 */

    // BOOT_RSVD : origin = 0x000000, length = 0x000050 /* Part of M0, BOOT rom will use this for stack */
    RAMM0 : origin = 0x000050, length = 0x0003B0 /* on-chip RAM block M0 */
    RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
    dataRAM : origin = 0x008800, length = 0x000800 /* on-chip RAM block L0 */
    FLASHB : origin = 0x3F4000, length = 0x002000 /* on-chip FLASH */

    }


    /* Allocate sections to memory blocks.
    Note:
    codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code
    execution when booting to flash
    ramfuncs user defined section to store functions that will be copied from Flash into RAM
    */

    SECTIONS
    {

    /* Allocate program areas: */
    .cinit : > FLASHA | FLASHC | FLASHD, PAGE = 0
    .pinit : > FLASHA | FLASHC | FLASHD, PAGE = 0
    .text : >> FLASHA | FLASHC | FLASHD, PAGE = 0
    codestart : > BEGIN PAGE = 0
    ramfuncs : LOAD = FLASHA,
    RUN = progRAM,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    RUN_START(_RamfuncsRunStart),
    PAGE = 0

    csmpasswds : > CSM_PWL PAGE = 0
    csm_rsvd : > CSM_RSVD PAGE = 0

    /* Allocate uninitalized data sections: */
    .stack : > RAMM0 PAGE = 1
    .ebss : > dataRAM PAGE = 1
    .esysmem : > dataRAM PAGE = 1
    // .sysmem : > dataRAM PAGE = 1
    // .cio : >> RAMM0 | RAMM1 | dataRAM PAGE = 1

    /* 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

    /* 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 is a standard section used by the compiler. It contains the */
    /* the address of the start of _c_int00 for C Code. /*
    /* When using the boot ROM this section and the CPU vector */
    /* table is not needed. Thus the default type is set here to */
    /* DSECT */
    .reset : > RESET, PAGE = 0, TYPE = DSECT
    vectors : > VECTORS PAGE = 0, TYPE = DSECT

    }

    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    *

    Please kindly correct me if i am wrong ! Thanks in advance.
    Srinivasan

    /*
    //###########################################################################
    //
    // FILE:    F28027.cmd
    //
    // TITLE:    Linker Command File For F28027 Device
    //
    //###########################################################################
    // $TI Release: F2802x Support Library v230 $
    // $Release Date: Fri May  8 07:43:05 CDT 2015 $
    // $Copyright: Copyright (C) 2008-2015 Texas Instruments Incorporated -
    //             http://www.ti.com/ ALL RIGHTS RESERVED $
    //###########################################################################
    */
    
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    // add the header linker command file directly to the project.
    // The header linker command file is required to link the
    // peripheral structures to the proper locations within
    // the memory map.
    //
    // The header linker files are found in <base>\f2802xX_Headers\cmd
    //
    // For BIOS applications add:      F2802xX_Headers_BIOS.cmd
    // For nonBIOS applications add:   F2802xX_Headers_nonBIOS.cmd
    ========================================================= */
    
    /* ======================================================
    // For Code Composer Studio prior to V2.2
    // --------------------------------------
    // 1) Use one of the following -l statements to include the
    // header linker command file in the project. The header linker
    // file is required to link the peripheral structures to the proper
    // locations within the memory map                                    */
    
    /* Uncomment this line to include file only for non-BIOS applications */
    /* -l F2802xX_Headers_nonBIOS.cmd */
    
    /* Uncomment this line to include file only for BIOS applications */
    /* -l F2802xX_Headers_BIOS.cmd */
    
    /* 2) In your project add the path to <base>\f2802xX_headers\cmd to the
       library search path under project->build options, linker tab,
       library search path (-i).
    /*========================================================= */
    
    /* Define the memory block start/length for the F28027
       PAGE 0 will be used to organize program sections
       PAGE 1 will be used to organize data sections
    
       Notes:
             Memory blocks on F2802x 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 = 0x000800
       //PRAML0      : origin = 0x008000, length = 0x000800     /* on-chip RAM block L0 */
       FLASHD      : origin = 0x3F0000, length = 0x002000     /* on-chip FLASH */
       FLASHC      : origin = 0x3F2000, length = 0x002000     /* on-chip FLASH */
    
       FLASHA      : origin = 0x3F6000, length = 0x001F80     /* on-chip FLASH */
    
       OTP         : origin = 0x3D7800, length = 0x000400     /* on-chip OTP */
       //FLASHD      : origin = 0x3F0000, length = 0x002000     /* on-chip FLASH */
      // FLASHC      : origin = 0x3F2000, length = 0x002000     /* on-chip FLASH */
     //  FLASHA      : origin = 0x3F6000, length = 0x001F80     /* 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 */
    
       //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_P0  : origin = 0x3F7FF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA */
    
    
       IQTABLES    : origin = 0x3FE000, length = 0x000B50     /* IQ Math Tables in Boot ROM */
       IQTABLES2   : origin = 0x3FEB50, length = 0x00008C     /* IQ Math Tables in Boot ROM */
       IQTABLES3   : origin = 0x3FEBDC, length = 0x0000AA      /* IQ Math Tables in Boot ROM */
    
       ROM         : origin = 0x3FF27C, length = 0x000D44     /* 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                                                  */
    
    //   BOOT_RSVD   : origin = 0x000000, length = 0x000050     /* Part of M0, BOOT rom will use this for stack */
       RAMM0       : origin = 0x000050, length = 0x0003B0     /* on-chip RAM block M0 */
       RAMM1       : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
       dataRAM      : origin = 0x008800, length = 0x000800     /* on-chip RAM block L0 */
       FLASHB      : origin = 0x3F4000, length = 0x002000     /* on-chip FLASH */
    
    }
    
    
    /* Allocate sections to memory blocks.
       Note:
             codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code
                       execution when booting to flash
             ramfuncs  user defined section to store functions that will be copied from Flash into RAM
    */
    
    SECTIONS
    {
    
       /* Allocate program areas: */
       .cinit              : > FLASHA | FLASHC | FLASHD,       PAGE = 0
       .pinit              : > FLASHA | FLASHC | FLASHD,      PAGE = 0
       .text               : >> FLASHA | FLASHC | FLASHD,       PAGE = 0
       codestart           : > BEGIN        PAGE = 0
       /*ramfuncs            : LOAD = FLASHA,
                             RUN = progRAM,
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_SIZE(_RamfuncsLoadSize),
                             RUN_START(_RamfuncsRunStart),
                             PAGE = 0*/
    
       csmpasswds          : > CSM_PWL     PAGE = 0
       csm_rsvd            : > CSM_RSVD     PAGE = 0
    
       /* Allocate uninitalized data sections: */
       .stack              : > RAMM0        PAGE = 1
       .ebss               : > dataRAM       PAGE = 1
       .esysmem            : > dataRAM       PAGE = 1
     //  .sysmem             : > dataRAM       PAGE = 1
     //  .cio                : >> RAMM0 | RAMM1 | dataRAM       PAGE = 1
    
       /* 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
    
       /* 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 is a standard section used by the compiler.  It contains the */
       /* the address of the start of _c_int00 for C Code.   /*
       /* When using the boot ROM this section and the CPU vector */
       /* table is not needed.  Thus the default type is set here to  */
       /* DSECT  */
       .reset              : > RESET,      PAGE = 0, TYPE = DSECT
       vectors             : > VECTORS     PAGE = 0, TYPE = DSECT
    
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    SECTIONS
    {
    	/*************       DPLIB Sections C28x      ************************/
    	/* ADCDRV_1ch section */
    	ADCDRV_1ch_Section				: > dataRAM				PAGE = 1
        /* ADCDRV_4ch section */
    	ADCDRV_4ch_Section				: > dataRAM				PAGE = 1
    	/* CNTL_2P2Z section */
    	CNTL_2P2Z_Section				: > dataRAM				PAGE = 1
    	CNTL_2P2Z_InternalData			: > dataRAM				PAGE = 1
    	CNTL_2P2Z_Coef					: > dataRAM				PAGE = 1
        /* CNTL_3P3Z section */
    	CNTL_3P3Z_Section				: > dataRAM				PAGE = 1
    	CNTL_3P3Z_InternalData			: > dataRAM				PAGE = 1
    	CNTL_3P3Z_Coef					: > dataRAM				PAGE = 1
    	/*DLOG_4CH section */
    	DLOG_4CH_Section				: > dataRAM				PAGE = 1
    	DLOG_BUFF						: > dataRAM				PAGE = 1
    
    	/*MATH_EMAVG section */
    	MATH_EMAVG_Section				: > dataRAM				PAGE = 1
        /*PFC_ICMD section*/
    	PFC_ICMD_Section				: > dataRAM				PAGE = 1
        /*PFC_INVSQR section*/
    	PFC_INVSQR_Section				: > dataRAM				PAGE = 1
    	/* PWMDRV_1ch driver section */
    	PWMDRV_1ch_Section				: > dataRAM				PAGE = 1
    	/* PWMDRV_PFC2PhiL driver section */
    	PWMDRV_PFC2PhiL_Section			: > dataRAM				PAGE = 1
     	/* PWMDRV_PSFB driver section */
    	PWMDRV_PSFB_Section				: > dataRAM				PAGE = 1
    
    	/* PWMDRV_DualUpDwnCnt driver section */
    	PWMDRV_DualUpDwnCnt_Section		: > dataRAM				PAGE = 1
    
    	/* PWMDRV_ComplPairDB driver section */
    	PWMDRV_ComplPairDB_Section		: > dataRAM				PAGE = 1
    	/* ZeroNet_Section  */
    	ZeroNet_Section					: > dataRAM				PAGE = 1
    
    	/* PWMDRV_2ch_UpCnt driver section */
    	PWMDRV_2ch_UpCnt_Section		: > dataRAM				PAGE = 1
    
    	/* ISR _Section  */
    	ISR_Section						: > dataRAM				PAGE = 1
    
    }
    
    

  • Srinivasan,

    Your CODE_SECTION pragma uses the string "ramfunc", which appears nowhere in your linker command file.  The string have to match.

    Regards,

    Richard

  • Hello,

    Thanks for your reply. I apologize my background is more hardware and i am still learning about using TI CCS. Oh this is so embarrassing...!!!! I am terribly sorry i was copy pasting and i called it "ramfunc" instead of "ramfuncs" :(
    Sorry for the inconvenience....
  • No problem, Srinivasan. Hopefully it all worked out.

    Regards,

    Richard
  • Yes it work out now :) i can see a improvement in performance i am able to measure the clock cycles using CCS i can see it takes 19.400 clock cycles to process the math part (~ 300 us) compared to previous which took around 500 us.
    This is really amazin !!!
    Thanks a lot again Richard !!!

    Cheers,

    Srini