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的任务中,想调用其他.c文件里的函数,看了ti论文之前的回答应该是可运行的
只需要保证把函数放置在RAMLSx区间
于是我设置了函数的存储区间如下:
#pragma CODE_SECTION(INV_ClosedLoop, "Cla1Prog");
void INV_ClosedLoop(void)
将其存储到CLA默认编译的段落Cla1Prog中
cmd文件中的分配如下:
Cla1Prog : LOAD = FLASH_APP, PAGE = 0, ALIGN(4)
RUN = RAMLS0, PAGE = 0
LOAD_START(_Cla1ProgLoadStart),
LOAD_SIZE(_Cla1ProgLoadSize),
LOAD_END(_Cla1ProgLoadEnd),
RUN_START(_Cla1ProgRunStart),
RUN_SIZE(_Cla1ProunSize),
RUN_END(_Cla1ProgRunEnd)
但编译后报错:#10295 output section "Cla1Prog" has both CLA and non-CLA sections; such mixing in the same output section is illegal; could not link section "Cla1Prog:inverter.obj"‘
不明白这个是怎么出现的?
对应的map如下:
Cla1Prog 0 0009ae9c 0000003a RUN ADDR = 0000809c
0009ae9c 0000002c clatask.obj (Cla1Prog:_Cla1Task1)
0009aec8 0000000e clatask.obj (Cla1Prog:_Cla1Task2)
是cla文件不能调用c文件中的函数吗?
所有需要调用的函数都必须写在cla文件里吗?
比如我用A函数内部调用了B函数,那我需要同时把A和B两个函数存放到cla文件中吗?
是的,这些特性都是与编译器有关的。
具体请看zhcu876y_TMS320C28x 优化 C/C++ 编译器 v22.6.0.LTS 用户指南 (Rev. Y)章节 10 CLA 编译器
你提出的这篇参考文档中并没有给这个问题有用的帮助,而且你的回答也是错误的。楼主的说法"
在CLA的任务中,想调用其他.c文件里的函数,只需要保证把函数放置在RAMLSx区间"是正确的,只是PAGE = 0应改成1.
所以Yale Li你的回答很不靠谱,很不负责任的表现。