I am trying to configure the Control Law Accelerator (CLA) for my LAUNCHXL-F28379D launchpad, based on the TMS320F28379D microcontroller. I am getting an error when trying to compile my model:
The "Main Routine - CPU1" works fine, as it was already tested. I included the "CLA Task Trigger", which is triggered by ePWM1. The variable that is passed from "Main Rotine - CPU1" to "Auxiliary Routine - CLA1" is only "theta_e" (for now), and it is defined in the main level by the "Data Store Memory" block. "System Initialize" only turns on two pullup resistors, and have no relevancy here. Excluding the right-side of the model (CLA Task Trigger, its subsystem and the global variable), the model works as intended.
By adding the CLA, even searching a lot, I could not find a solution to the problem caused. The section of the Diagnostic Viewer that describes the error is the one that follows:
"C:/Users/Gabriel/Documents/MATLAB/C2000_Programming/BOOSTXL_3PhGaNInv_Test/BOOSTXL_3PhGaNInv_Test_CPU1_L4_ert_rtw/cla_task.cla", line 1: fatal error: cannot open source file "cla_header.h"
1 catastrophic error detected in the compilation of "C:/Users/Gabriel/Documents/MATLAB/C2000_Programming/BOOSTXL_3PhGaNInv_Test/BOOSTXL_3PhGaNInv_Test_CPU1_L4_ert_rtw/cla_task.cla".
>> Compilation failure
gmake: *** [cla_task.obj] Error 1
gmake: *** Waiting for unfinished jobs...
"C:/ProgramData/MATLAB/SupportPackages/R2020b/toolbox/target/supportpackages/tic2000/src/MW_c28xIPC.c", line 1342: warning: variable "CheckSTSFlag" is used before its value is set
C:\Users\Gabriel\Documents\MATLAB\C2000_Programming\BOOSTXL_3PhGaNInv_Test\BOOSTXL_3PhGaNInv_Test_CPU1_L4_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2
### Build procedure for BOOSTXL_3PhGaNInv_Test_CPU1_L4 aborted due to an error.
It seems that the file "cla_header.h" could not be opened. I tried to debug it myself, and have some useful information that might be helpful:
- It seems that the block "CLA Task Trigger" needs something that is causing the problem. Without it, the model is buildable.
- In the "Using the Control Law Accelerator (CLA)" page (available at https://www.mathworks.com/help/supportpkg/texasinstrumentsc2000/ug/using-the-control-law-accelerator-cla.html), in the "Data Exchange between the CLA and the C28x CPU" section, I cannot set the custom memory sections. The tab "Signal Attributes" of the "DataStoreMemory" block does not contain the "Code Generation" area. The same happens to the "Signal Properties", even though I created said settings according to https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/943935
- By acessing the models available at the "Using the Control Law Accelerator (CLA)" page, especially the "c28379D_cpu1_blink_cla.slx", the model is buildable without any error, even though it contains a "CLA Task Trigger" block. This leads me to think that the "cla_header.h" issue is some configuration with my model/file that is missing/wrong. I still cannot set/view the custom memory sections in MATLAB's example, as mentioned above.
- I already set the CLA subsystem to run "Inline", as mentioned by the "Using the Control Law Accelerator (CLA)" page.
- If I copy all blocks from my model into the "c28379D_cpu1_blink_cla.slx" example and delete all the original blocks, I still get the same error.
- If I coppy all blocks from the "c28379D_cpu1_blink_cla.slx" example into my .slx file and delete all my blocks, I still get the same error.
- The solution provided by Brian McKay in the post "https://www.mathworks.com/matlabcentral/answers/294905-running-the-using-the-control-law-accelerator-cla-example-in-f28069-controlstick" did not work. I tried to change to all other paths in the "C:\ti\controlSUITE\libs\math\CLAmath" folder, but none have worked.
I have worked for several hours in this issue, but it is still persistent. Could anyone help me? How can I effectively implement the CLA in my F28379D launchpad?