Setting C2000 CLA compiler warnings/errors for incompatible code generation/blocks

15 visualizzazioni (ultimi 30 giorni)

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.

Risposte (1)

Purvaja
Purvaja il 10 Giu 2025
Hi @Finlay,
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 -
  1. C2000 Microcontroller Blockset : https://www.mathworks.com/products/ti-c2000-microcontroller.html
  2. 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:
  1. Overview of CLA Configuration for C2000 Processors Using Subsystem : https://www.mathworks.com/help/ti-c2000/ug/CLA-Task-Subsystem.html
  2. 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!
  1 Commento
Finlay
Finlay il 8 Set 2025
Hi Purvaja, thanks for your comment. To clarify, I'd already been following all of the points you mentioned, however even then there's plenty of cases where the compiler doesn't flag an error, but the CLA still doesn't run. Additionally if an error is thrown in compilation, the stack trace is often fairly useless - just mentioning that certain files are not found when linking, rather than printing the actual compiler failure.

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by