2.6. Environment Variables
This guide explains the environment variables needed for model compilation targeting TI microcontrollers.
Note
Environment variables are only required if you want to compile models for device deployment. Training and testing work without them.
2.6.1. Required Variables by Device Family
2.6.1.1. C2000 Devices (F28P55, F28P65, F2837, etc.)
Variable |
Description |
|---|---|
|
Path to TI C2000 Code Generation Tools installation |
|
Path to C2000Ware SDK installation |
Example Values (Linux):
export C2000_CG_ROOT="$HOME/ti/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS"
export C2000WARE_ROOT="$HOME/ti/c2000/C2000Ware_5_03_00_00"
Example Values (Windows):
$env:C2000_CG_ROOT = "C:\ti\ccs\tools\compiler\ti-cgt-c2000_22.6.1.LTS"
$env:C2000WARE_ROOT = "C:\ti\c2000\C2000Ware_5_03_00_00"
2.6.1.2. MSPM0 Devices (MSPM0G3507, MSPM0G5187, etc.)
Variable |
Description |
|---|---|
|
Path to TI Arm Clang Compiler installation |
|
Path to MSPM0 SDK installation (optional) |
Example Values (Linux):
export ARM_LLVM_CGT_PATH="$HOME/ti/arm-clang/4.0.0.LTS"
export MSPM0_SDK_ROOT="$HOME/ti/mspm0_sdk_2_01_00_03"
2.6.1.3. AM26x Devices (AM263, AM261, etc.)
Variable |
Description |
|---|---|
|
Path to TI Arm Clang Compiler installation |
|
Path to MCU+ SDK installation (optional) |
2.6.2. Setting Environment Variables
Linux (Permanent)
Add to ~/.bashrc or ~/.profile:
# TI Toolchain Paths
export C2000_CG_ROOT="$HOME/ti/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS"
export C2000WARE_ROOT="$HOME/ti/c2000/C2000Ware_5_03_00_00"
export ARM_LLVM_CGT_PATH="$HOME/ti/arm-clang/4.0.0.LTS"
# Add to PATH
export PATH="$C2000_CG_ROOT/bin:$PATH"
Then reload:
source ~/.bashrc
Windows (Permanent)
Open System Properties → Advanced → Environment Variables
Under “User variables”, click “New”
Add each variable name and value
Or use PowerShell:
# Set for current user (permanent)
[Environment]::SetEnvironmentVariable("C2000_CG_ROOT", "C:\ti\ccs\tools\compiler\ti-cgt-c2000_22.6.1.LTS", "User")
[Environment]::SetEnvironmentVariable("C2000WARE_ROOT", "C:\ti\c2000\C2000Ware_5_03_00_00", "User")
Per-Session (Temporary)
export C2000_CG_ROOT="/path/to/compiler"
set C2000_CG_ROOT=C:\path\to\compiler
$env:C2000_CG_ROOT = "C:\path\to\compiler"
2.6.3. Installing TI Tools
C2000 Code Generation Tools
Download from https://www.ti.com/tool/C2000-CGT
Run installer and note installation path
Set
C2000_CG_ROOTto the installation directory
C2000Ware SDK
Download from https://www.ti.com/tool/C2000WARE
Run installer and note installation path
Set
C2000WARE_ROOTto the installation directory
TI Arm Clang Compiler
Download from https://www.ti.com/tool/ARM-CGT
Extract to your preferred location
Set
ARM_LLVM_CGT_PATHto the extracted directory
Code Composer Studio (CCS)
When you install CCS, it can automatically install compilers:
Download CCS from https://www.ti.com/tool/CCSTUDIO
During installation, select the device families you need
CCS installs compilers to
<CCS_INSTALL>/tools/compiler/
2.6.4. Verifying Configuration
Check that environment variables are set:
echo $C2000_CG_ROOT
echo $C2000WARE_ROOT
echo $ARM_LLVM_CGT_PATH
# Verify compiler is accessible
$C2000_CG_ROOT/bin/cl2000 --version
echo $env:C2000_CG_ROOT
echo $env:C2000WARE_ROOT
# Verify compiler
& "$env:C2000_CG_ROOT\bin\cl2000" --version
2.6.5. Troubleshooting
“Compiler not found” during compilation
Check the environment variable points to the correct directory:
ls $C2000_CG_ROOT/bin/ # Should contain cl2000
“SDK not found” errors
Verify the SDK path contains expected subdirectories:
ls $C2000WARE_ROOT/ # Should contain device/, libraries/, etc.
Compilation works in terminal but not in IDE
IDE may not inherit shell environment variables. Set them in the IDE’s run configuration or use absolute paths in your config.
Different compiler versions
The toolchain is tested with specific compiler versions. Using different versions may cause compatibility issues. Recommended versions:
C2000 CGT: 22.6.x
Arm Clang: 4.0.x
2.6.6. Next Steps
Quickstart - Train and compile your first model
CCS Integration Guide - Deploy to your device