Setting C2000 CLA compiler warnings/errors for incompatible code generation/blocks
Show older comments
The C2000 CLA does not implement the full C language - math.h doesn’t work for example. When generating code via Simulink however, it is perfectly possible to compile and upload incompatible code that causes the CLA to fail to run. This wastes a lot of time as the compile/upload process isn’t quick on TI Launchpad boards. Are there any available settings that will cause Simulink or the TI compiler to throw an error when incompatible code is detected? This would save a lot of time hunting down which block has broken everything because it calls the wrong SQRT or MOD function.
Answers (1)
Purvaja
on 10 Jun 2025
0 votes
I understand that you're working with the Texas Instruments C2000 platform, specifically the CLA (Control Law Accelerator), and facing challenges where code containing unsupported functions like those from math.h (e.g., sqrt, mod) compiles and uploads successfully but fails at runtime on the CLA core.
You first need to ensure that you have appropriate Blockset installed for the same.
Refer to the following links for more information -
- C2000 Microcontroller Blockset : https://www.mathworks.com/products/ti-c2000-microcontroller.html
- Hardware Setup for C2000 Microcontroller Blockset : https://www.mathworks.com/help/ti-c2000/ug/install-support-for-c2000-processors.html
To avoid incompatibility issues, you should configure your Simulink model and code generation settings to explicitly catch and flag unsupported operations during build time. The steps below outline how to enforce CLA compatibility using MathWorks tools.
- Go to Hardware Implementation in Model Settings
- Select your board (e.g., TI F28004x LaunchPad or TI C2000 Delfino).

- Set Processing unit to CPU or CLA depending on target
- Under Device details, uncheck Support long long if targeting the CLA (not supported)

- If using a CLA subsystem, change the storage class, from the Embedded Coder Dictionary window, in Manage packages to "tic2000demospkg".

For more detailed configuration steps refer to the following documentation by MathWorks:
- Overview of CLA Configuration for C2000 Processors Using Subsystem : https://www.mathworks.com/help/ti-c2000/ug/CLA-Task-Subsystem.html
- Model Configuration Parameters for Texas Instruments C2000 Processors: https://www.mathworks.com/help/ti-c2000/ref/model-configuration-parameters-for-texas-instruments-c2000-processors.html
Hope this helps you!
Categories
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!