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.

CLA函数地址问题



我在使用F28377D的CLA1的时候,关于CLA任务函数的地址,总是有警告

代码如下:

    Cla1Regs.MVECT1 = (uint16_t)&Cla1Task1;
    Cla1Regs.MVECT2 = (uint16_t)&Cla1Task2;
    Cla1Regs.MVECT3 = (uint16_t)&Cla1Task3;
    Cla1Regs.MVECT4 = (uint16_t)&Cla1Task4;
    Cla1Regs.MVECT5 = (uint16_t)&Cla1Task5;
    Cla1Regs.MVECT6 = (uint16_t)&Cla1Task6;
    Cla1Regs.MVECT7 = (uint16_t)&Cla1Task7;
    Cla1Regs.MVECT8 = (uint16_t)&Cla1Task8;

警告如下:

#770-D conversion from pointer to smaller integer 

我在使用官方例程的时候,没有这样的警告。程序是可以正常运行的。

这个是哪里没有设置的原因吗?

  • 请您参考一下 e2e.ti.com/.../559092

    a pointer to a function is 32-bits wide but MVECT is a 16-bit address so there is a truncation that happens. Now the reason MVECT is 16-bits is that the CLA can only fetch code (and data) from the lower 64Kwords portion of memory. All cla tasks need to be in the "near" memory range. It is ok to ignore this warning as long as you manually (the tools wont do this for you) check that cla_task does indeed fall in the lower 64Kw.