Configure MATLAB coder for Ti C2000 compiler
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have trying to use Ti functions based on driverlib library and running into the saqme issue as the one answered in this post: https://www.mathworks.com/matlabcentral/answers/2035869-how-to-compile-c2000-driverlib-calls-into-an-s-function
After separating the build process between 'MATLAB' and codegen the code generation still uses MinGW to compile the code:
>> mex -setup c
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
How can I add the TI compiler to the available compilers and change to default to the one for C2000 products?
Thanks.
0 Commenti
Risposte (2)
Maneet Kaur Bagga
il 4 Apr 2025
Hi,
As per my understanding, you are trying to compile C2000 "driverlib" functions into an S-Function in MATLAB. To use the TI compiler for C2000, please refer to the steps below:
Locate the TI Compiler path, which is generally found under the following path:
C:\ti\ccs\ccs_base\tools\compiler\ti-cgt-c2000_xx.x.x
Register the TI compiler in MATLAB using the following command:
mex -setup C
Use the "coder.updateBuildInfo" by referring to the following MathWorks documentation to explicitly set the TI Compiler inside S-function.
Invoke the "mex" function with the TI compiler using the following command and ensure that the environment variables are set before running it in MATLAB :
mex -v -f path_to_TI_compiler_cfg my_s_function.c
Hope this helps!
Vanita
il 14 Ago 2025
Hi Valeriy,
To avoid resource conflicts between Simulink-generated code and custom “driverlib/ControlSuite” code, make sure that only one approach configures each hardware resource. Use S-Functions or the Custom Code feature to integrate your code, but coordinate resource usage to prevent collisions.
For more details you can refer to the following documentations:
Hope this helps!
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!