C2000 CLA _DWork Variable Creation
显示 更早的评论
Hello,
I am trying to use the CLA on a F28035 using nearly identical examples from provided example scripts. I am attaching the model to this thread. I keep getting CLA compiler errors despite using 'inlining variables' under the optimization tab for the model and 'inlining' the function. I am not sure what else to do at this point as the CLA comiler seems to be very tempermental. The errors I keep getting are below in reference to my model.
IC:/ti/CONTRO~1/libs/math/CLAmath/V4_00_~1/include --output_file="cla_task.obj" "C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla"
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 160: warning: function "rt_hypotf_snf" declared implicitly
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 203: error: identifier "c28035_CAN_CLA_FOC_B" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 259: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 292: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 321: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 332: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 338: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 375: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 408: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 414: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 439: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 445: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
"C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla", line 501: error: identifier "c28035_CAN_CLA_FOC_DWork" is undefined
12 errors detected in the compilation of "C:/Users/ZCampbell/Desktop/c28035_CAN_CLA_FOC_ert_rtw/cla_task.cla".
>> Compilation failure
gmake: *** [cla_task.obj] Error 1
C:\Users\ZCampbell\Desktop\c28035_CAN_CLA_FOC_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2
C:\Users\ZCampbell\Desktop\c28035_CAN_CLA_FOC_ert_rtw>exit 1
Error(s) encountered while building "c28035_CAN_CLA_FOC":
### Failed to generate all binary outputs.
采纳的回答
更多回答(1 个)
Ismail Mussed
2020-2-10
0 个投票
You need to make sure the inputs have storage class "CpuToCla1MsgRam" and the outputs have storage class "Cla1ToCPUMsgRam". Also make sure that your blocks with state such as delays have state attribute set to ClaDataRam.
See this document for more specifics on how to set it up: https://www.mathworks.com/help/supportpkg/texasinstrumentsc2000/ug/using-the-control-law-accelerator-cla.html
Here's an excerpt:
"Discrete State Variables
All discrete state variables used inside CLA function-call subsystems must be stored in Cla1DataRam. For example, delay blocks and integrators must be set to use the Cla1DataRam storage class for state variables. See the 'State Attributes' of the Delay block inside cla_subsystem for an example. "
类别
在 帮助中心 和 File Exchange 中查找有关 Get Started with C2000 Microcontroller Blockset 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



