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: CLA task adress size

Part Number: TMS320F28377D


Tool/software:

Hi,

I'm trying to use the CLA to perform some calculations and offload the CPU. However, when I initialize the CLA, CCS gives me a warning on this line:

CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_1, (uint16_t)(&Cla1Task1));

The warning is:

#770-D: conversion from pointer to smaller integer

It seems this is due to the fact that &Cla1Task1 is a 32-bit pointer, and casting it to uint16_t causes truncation.
What I don’t understand is why the address of Cla1Task1 is 32 bits and not 16 bits as expected.

And of course how to get rid of this warning Grin

Thank you for your support Slight smile

  • Hi Louis,

    Do you have the .cla file included in your project? That's where the Cla1Task1() functions are defined.

    Please note that the CLA has a 16-bit address bus, and can therefore, access the lower 64 KW space. Each CLA Task (1 to 8) has its own MVECTx register. When a task is triggered, the CLA loads the MVECTx register of the task in question to the MPC (CLA program counter) and begins execution from that point.

    You can find more details about the data types on the respective cores at this link: https://software-dl.ti.com/C2000/docs/cla_software_dev_guide/faq.html#how-are-data-types-different-on-c28x-and-cla

    Regards,

    Ozino

  • Thank you for your response. I have included the .cla file, but the problem persists. I believe that as long as this warning appears, the CLA tasks cannot execute properly because they may be incorrectly referenced.

    How can I correctly initialize the MVECT register with the 16-bit address of a task declared in the .cla file?

    Here is some information to help clarify the issue:

    -> In cmd file :

       CpuToCla1MsgRAM : > RAMLS1, PAGE = 0
       Cla1ToCpuMsgRAM : > RAMLS2, PAGE = 0
       Cla1Prog :
       {
          *(Cla1Prog)
       } LOAD = FLASHJ, RUN = RAMLS3 | RAMLS4,
       LOAD_START(Cla1funcsLoadStart),
       RUN_START(Cla1funcsRunStart),
       SIZE(Cla1funcsLoadSize)
    in 320_cla.c :
    #include <stdint.h>
    #include "cla_320.h"

    #pragma DATA_SECTION(a,"CpuToCla1MsgRAM");
    #pragma DATA_SECTION(b,"CpuToCla1MsgRAM");
    #pragma DATA_SECTION(c,"Cla1ToCpuMsgRAM");
    float a = 0;
    float b = 0;
    float c = 0;
    -> In 320_cla.h :
    __interrupt void Cla1Task1();
    __interrupt void Cla1Task2();
    __interrupt void Cla1Task3();
    __interrupt void Cla1Task4();
    __interrupt void Cla1Task5();
    __interrupt void Cla1Task6();
    __interrupt void Cla1Task7();
    __interrupt void Cla1Task8();

    extern float a, b, c;
    -> In calcul.cla :
    #include "cla_320.h"
    __interrupt void Cla1Task1 ( void )
    {
    b = 0.0000001;
    c = a + b;
    }
    When i run in debug mode, i watch the content of :
    Cla1Task1: 0x009800
    Cla1Task3: 0x009822
    This the value that are put in the  MVECT. I would like to do the same operation that the example : 
    Cla1Regs.MVECT1 = (uint16_t)(&Cla1Task1);
    Whitout having suspicious warning.
    Thank you for your help
  • Hi,

    It seems like your project isn't configuring the CLA correctly. Please check out this document that walk through the steps to enable the CLA. Let me know once you've reviewed and updated your setup routine.

    /cfs-file/__key/communityserver-discussions-components-files/171/CLAProjectStructureUG.pdf 

    Regards,

    Ozino