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.

TMS320F28377D-EP: TMS320F28377D-EP

Part Number: TMS320F28377D-EP
Other Parts Discussed in Thread: TMS320F28377D, C2000WARE

I am debuging the cla in the cpu2 of TMS320F28377d,I add the lib as the docment "CLA_MATH_LIB_UG".

It occurs a strange phenomenon that when I call the function of CLAcos_inline,the return result is always 0,but the function of CLAsqrt_inline works well.

When I call the function of CLAasin the functions in cla goes nowhere.

When debug in ccs the function of CLAcos_inline can work well too.

the map file shows tables is in the ram

00009280 24a (00009280) _CLAsinTable
00009280 24a (00009280) _CLAsincosTable
00009280 24a (00009280) _CLAsincosTable_Sin0

the cmd config is as below:

CLA1mathTables : LOAD = FLASHN,
RUN = RAMLS1_S2,
RUN_START(_CLA1mathTablesRunStart),
LOAD_START(_CLA1mathTablesLoadStart),
LOAD_SIZE(_CLA1mathTablesLoadSize),
PAGE = 0

Cla1Prog : LOAD = FLASHCTOM,
RUN = RAMLS3_S5,
RUN_START(_Cla1funcsRunStart),
LOAD_START(_Cla1funcsLoadStart),
//LOAD_SIZE(_Cla1funcsLoadSize),
//LOAD_END(_Cla1funcsLoadEnd),

//RUN_SIZE(_Cla1funcsRunSize),
//RUN_END(_Cla1funcsRunEnd),
LOAD_SIZE(_Cla1funcsLoadSize),
PAGE = 0//, ALIGN(8)

I just have no idea what is the problem,Thanks very much for reply!

  • Hi,

    Have you copied the sections the above section from Flash to the RAM locations?

    Eg:

        memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart, (uint32_t)&Cla1funcsLoadSize);
        memcpy((uint32_t *)&Cla1ConstRunStart, (uint32_t *)&Cla1ConstLoadStart, (uint32_t)&Cla1ConstLoadSize );
    Also, can you confirm that all the LSRAMs used for the CLA sections are assigned to CLA and is configured as Program/Data
    Eg:
        MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS0, MEMCFG_LSRAMMASTER_CPU_CLA1);
        MemCfg_setCLAMemType(MEMCFG_SECT_LS0, MEMCFG_CLA_MEM_PROGRAM);
    Regards,
    Veena
  • Hi,

      I copied section to ram as below:

      memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart,(uint32_t)&Cla1funcsLoadSize);
    memcpy((uint16_t *)&Cla1ConstRunStart, (uint16_t *)&Cla1ConstLoadStart,(uint16_t)&Cla1ConstLoadSize);
    memcpy((uint32_t *)&CLA1mathTablesRunStart, (uint32_t *)&CLA1mathTablesLoadStart,(uint32_t)&CLA1mathTablesLoadSize);

     LSRAMs used for the CLA sections:

    MemCfgRegs.MSGxINIT.bit.INIT_CLA1TOCPU = 1;
    while(MemCfgRegs.MSGxINITDONE.bit.INITDONE_CLA1TOCPU != 1){};
    // Initialize and wait for CPUToCLA1MsgRAM
    MemCfgRegs.MSGxINIT.bit.INIT_CPUTOCLA1 = 1;
    while(MemCfgRegs.MSGxINITDONE.bit.INITDONE_CPUTOCLA1 != 1){};
    // Select LS5RAM to be the programming space for the CLA
    // First configure the CLA to be the master for LS5 and then
    // set the space to be a program block
    MemCfgRegs.LSxMSEL.bit.MSEL_LS1 = 1;
    MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS1 = 0;

    MemCfgRegs.LSxMSEL.bit.MSEL_LS2 = 1;
    MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS2 = 0;

    MemCfgRegs.LSxMSEL.bit.MSEL_LS3 = 1;
    MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS3 = 1;

    MemCfgRegs.LSxMSEL.bit.MSEL_LS4 = 1;
    MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS4 = 1;

    MemCfgRegs.LSxMSEL.bit.MSEL_LS5 = 1;
    MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS5 = 1;
    // Next configure LS0RAM and LS1RAM as data spaces for the CLA
    // First configure the CLA to be the master for LS0(1) and then
    // set the spaces to be code blocks
    MemCfgRegs.LSxMSEL.bit.MSEL_LS0 = 1;
    MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS0 = 0;

    Regards,

    Hawk

      

  • Hi Hawk,

    I have forwarded your query to the CLAMath library expert. Please expect a response by Monday.

    Regards,

    Veena

  • Hi Hawk,

    I looked at the C2000Ware example for CLAcos and CLAcos_inline and don't see any issues with the implementation. Can you check that the variables used to pass parameter into CLAcos_inline and return result from CLAcos_inline are in memory that is writable by CLA?

    Thanks,

    Ashwini