Configure MATLAB coder for Ti C2000 compiler
Show older comments
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.
Accepted Answer
More Answers (1)
Maneet Kaur Bagga
on 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!
Categories
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!