9. Device Deployment

This section guides you through deploying trained models on TI microcontrollers using Code Composer Studio (CCS).

Contents

9.4. Supported Devices

Device-Specific SDKs

Device Family

Devices

SDK

SDK Version

Download

C2000 (F28x)

F28003x, F28004x, F28P55x, F28P65x

C2000Ware

6.01.00.00

C2000Ware

C2000 (F29x)

F29H85x, F29P58x, F29P32x

F29H85X SDK

01.04.00.00

F29H85X-SDK

MSPM33

MSPM33C321Ax

MSPM33 SDK

1.03.00.00

MSPM33-SDK

Sitara MCU (AM13x)

AM13E2x

MCU SDK

1.00.00.00

MCU-SDK-AM13E2X

Sitara MCU (AM26x)

AM263, AM263P, AM261

MCU-PLUS-SDK

11.03.00.00

MCU-PLUS-SDK-AM263X

Connectivity

CC2755, CC1352, CC1354, CC35X1

SimpleLink SDK

SimpleLink

Supported LaunchPads/EVMs

Device

LaunchPad/EVM

Product Page

NPU

F28003x

LAUNCHXL-F280039C

TMS320F280039C

No

F28004x

LAUNCHXL-F280049C

TMS320F280049C

No

F28P55x

LAUNCHXL-F28P55X

TMS320F28P550SJ

Yes

F28P65x

LAUNCHXL-F28P65X

TMS320F28P650DK

No

F29H85x

F29H85X-SOM-EVM

F29H850TU

No

MSPM33C321Ax

LP-MSPM33C321A

MSPM33C321A

No

AM13E2x

AM13E2

Yes

AM263x

LP-AM263

AM2634

No

CC2755

CC2755

No

CC1352

CC1352

No

CC1354

CC1354

No

CC35X1

CC35X1

No

9.5. Deployment Overview

After training and compilation, Tiny ML Tensorlab produces artifacts that you can integrate into your CCS project:

Output Artifacts

File

Description

mod.a

Compiled model library (ONNX model compiled by TI MCU NNC into C code, packaged as a static library)

tvmgen_default.h

Header file with model inference API exposed by mod.a

test_vector.c

Golden test vectors (input + expected output) for on-device validation

user_input_config.h

Feature extraction configuration (preprocessing flags and parameters)

Deployment Steps

  1. Train and compile your model using Tiny ML Tensorlab

  2. Open Code Composer Studio

  3. Import the SDK example project for your target device and task type

  4. Copy the four output files from ModelMaker to the CCS project

  5. Build, flash, and debug

The specific steps vary depending on whether your device has an NPU:

9.6. Prerequisites

Code Composer Studio (CCS)

Download from https://www.ti.com/tool/CCSTUDIO. Version 20.2.0 or later is recommended.

Install support for your target device family during CCS setup, and then install the appropriate SDK listed in the Supported Devices table above.

9.7. Output File Locations

After ModelMaker runs, the four deployment files are located in:

tinyml-modelmaker/data/projects/{dataset_name}/run/{date-time}/{model_name}/
├── compilation/
│   └── artifacts/
│       ├── mod.a                     <-- Compiled model
│       └── tvmgen_default.h          <-- Model API header
│
└── training/
    ├── base/                         <-- For float (non-quantized) models
    │   └── golden_vectors/
    │       ├── test_vector.c
    │       └── user_input_config.h
    │
    └── quantization/                 <-- For quantized models
        └── golden_vectors/
            ├── test_vector.c
            └── user_input_config.h

Important

Choose the golden vectors based on the model type you compiled:

  • Float model (non-quantized): Use golden vectors from training/base/golden_vectors/

  • Quantized model: Use golden vectors from training/quantization/golden_vectors/

The mod.a and tvmgen_default.h are always from compilation/artifacts/ regardless of quantization setting.

9.8. CCS Example Project Locations

TI provides ready-to-use CCS example projects for each task type. The example project location depends on your device family:

C2000Ware (F28x devices):

{C2000WARE_INSTALL_PATH}/libraries/ai/examples/
├── generic_timeseries_classification/
├── generic_timeseries_regression/
├── generic_timeseries_forecasting/
└── generic_timeseries_anomalydetection/

F29H85X SDK (F29x devices):

{F29H85X_SDK_INSTALL_PATH}/examples/rtlibs/ai/examples/
├── generic_timeseries_classification/
├── generic_timeseries_regression/
├── generic_timeseries_forecasting/
└── generic_timeseries_anomalydetection/

Inside each task-type folder, select the subfolder matching your target device (e.g., f28p55x/, f28004x/, f29h85x/).

9.9. Task-Type-Specific Deployment Notes

The deployment workflow is the same for all task types, but the CCS example project names and verification differ:

Classification

  • CCS example: generic_timeseries_classification

  • Verification: Check test_result variable (1 = pass, 0 = fail)

  • The model outputs class scores; argmax gives the predicted class

Regression

  • CCS example: generic_timeseries_regression

  • Verification: Check test_result variable (1 = pass, 0 = fail)

  • The model outputs a continuous value

Forecasting

  • CCS example: generic_timeseries_forecasting

  • Verification: Check test_result variable (1 = pass, 0 = fail)

  • The model predicts future values from historical data

Anomaly Detection

  • CCS example: generic_timeseries_anomalydetection

  • Verification: The application computes reconstruction error (MSE between input and autoencoder output) and compares to a threshold

  • In user_input_config.h, the anomaly threshold is defined:

    #define RECONSTRUCTION_ERROR_THRESHOLD 0.014  // Threshold for k=4.5
    

    This was calculated during training as: threshold = mean_normal_error + k * std_normal_error

  • Adjusting the threshold:

    • Increase threshold (higher k): fewer false alarms, may miss subtle anomalies

    • Decrease threshold (lower k): catches more anomalies, more false alarms

    Refer to the threshold_performance.csv file from ModelMaker to choose the optimal k value for your application.

9.10. Testing Multiple Cases

The test_vector.c file contains multiple test cases (SET 0, SET 1, etc.). To test different cases:

  1. Open test_vector.c in the CCS editor

  2. Comment out the current test set (SET 0)

  3. Uncomment another test set (e.g., SET 1)

  4. Rebuild and reflash the project

  5. Verify that test_result matches expected output

9.11. Model Compilation Details

The ONNX model produced by training is compiled using TI MCU NNC to generate mod.a and tvmgen_default.h. The compilation command used internally is:

tvmc compile \
  --target="c, ti-npu type=hard skip_normalize=true output_int=true" \
  --target-c-mcpu=c28 \
  ./model.onnx \
  -o artifacts_c28/mod.a \
  --cross-compiler="cl2000" \
  --cross-compiler-options="$CL2000_OPTIONS"

Different task types use different compilation flags:

  • Classification: skip_normalize=true output_int=true

  • Regression/Forecasting: Output is float (no output_int)

  • Anomaly Detection: Output is reconstruction error

See the TI MCU NNC documentation for all compilation options.