9.1.6. Deploying Regression Models from ModelMaker to Device
9.1.6.1. Abhijeet Pal, Adithya Thonse, Tushar Sharma, Fasna Sharaf, Jaswanth Kumar
9.1.6.2. Table of Contents
9.1.6.3. Overview
This guide walks you through the process of taking a timeseries regression model trained in TinyML Modelzoo and running it on a Texas Instruments (TI) microcontroller. Timeseries regression predicts target variable based on independent variables, and previous context.
To learn more about running timeseries regression examples on ModelMaker, refer to the Generic TimeSeries Regression Example, which demonstrates how to run regression examples using a synthetically generated dataset.
9.1.6.4. Prerequisites
Before starting, ensure you have the following:
9.1.6.4.1. Hardware
Ensure you have a TI LaunchPad for your target device. The following devices are currently supported:
Device Family |
Device |
|---|---|
C2000 (F28x) |
F28003x, F28004x, F280013x, F280015x, F28P55x, F28P65x, F2837x |
C2000 (F29x) |
F29H85x, F29P58x, F29P32x |
MSPM33 |
MSPM33C321Ax |
Sitara MCU |
AM263x, AM263P, AM261 |
9.1.6.4.2. Software
TinyML ModelMaker: Latest version from TinyML Tensorlab GitHub Repository Current version: 1.3.0.
After running a regression example, ModelMaker generates the following files required for deploying the model on MCUs (Refer to the Generic Timeseries Regression Example).
File |
Description |
|---|---|
mod.a |
Compiled model library |
tvmgen_default.h |
Header file for model inference APIs |
test_vector.c |
Test data to verify model correctness |
user_input_config.h |
Configuration parameters for the model |
These files are located in the following directory structure:
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
└── post_training_analysis/
| |── actual_vs_predicted.png
| └── residual_error_test.png
| └── results_on_test_set.csv
|
└── golden_vectors/
├── test_vector.c
└── user_input_config.h
Note: Choose the golden vectors based on the model type you compiled in ModelMaker:
Float model (non-quantized): Use golden vectors from
tinyml-modelmaker/data/projects/{dataset-name}/run/{date-time}/{model-name}/training/base/golden_vectors/Quantized model: Use golden vectors from
tinyml-modelmaker/data/projects/{dataset-name}/run/{date-time}/{model-name}/training/quantization/golden_vectors/
If quantization is not used i.e. set to 0, the post_training_analysis folder is present in tinyml-modelmaker/data/projects/{dataset-name}/run/{date-time}/{model-name}/training/base/
9.1.6.4.3. Exact File Locations
File |
Float Model Location |
Quantized Model Location |
|---|---|---|
mod.a |
|
|
tvmgen_default.h |
|
|
test_vector.c |
|
|
user_input_config.h |
|
|
Code Composer Studio (CCS): TI’s integrated development environment. Download CCS from TI’s website. Version used in this guide: 20.2.0.
Device-specific SDK: After installing CCS, install the appropriate SDK for your device.
9.1.6.4.3.1. Supported Devices and SDK Requirements
9.1.6.4.4. C2000 Family (F28x)
These devices use C2000Ware SDK.
Device |
LaunchPad/EVM |
Product Page |
SDK Download |
|---|---|---|---|
F280013x |
|||
F280015x |
|||
F28003x |
|||
F28004x |
|||
F28P55x |
|||
F28P65x |
|||
F2837x |
SDK Version: 6.1.0 (Release: 6_01_00_00)
9.1.6.4.5. C2000 Family (F29x)
These devices use F29H85x SDK.
Device |
LaunchPad/EVM |
Product Page |
SDK Download |
|---|---|---|---|
F29H85x |
|||
F29P58x |
- |
- |
|
F29P32x |
- |
- |
SDK Version: 1.4.0 (Release: 01_04_00_00)
9.1.6.4.6. MSPM33 Family
These devices use MSPM33 SDK.
Device |
LaunchPad/EVM |
Product Page |
SDK Download |
|---|---|---|---|
MSPM33C321Ax |
SDK Version: 1.03.00.00 (Release: 1_03_00_00)
9.1.6.4.7. Sitara MCU Family (AM26x)
These devices use MCU-PLUS-SDK.
Device |
LaunchPad/EVM |
Product Page |
SDK Download |
|---|---|---|---|
AM263 |
|||
AM263P |
|||
AM261 |
- |
SDK Version: 11.2.0 (Release: 11_02_00_00)
9.1.6.5. Deployment Steps
Once all prerequisites are met, follow these steps to deploy the model on your device.
1. Open Code Composer Studio
2. Import the Project
Go to File > Import Projects
A dialog box will appear. Click Browse to select the project folder.
Select the
generic_timeseries_regressionfolderThe project location depends on your target device:
3. Click Finish
4. Verify Project Import
After importing, the project should appear in the Project Explorer panel on the left side of CCS.
Project Explorer showing F28P55 project:
5. Copy Artifacts and Golden Vectors
Copy the following 4 files from ModelMaker to your CCS project:
Copy the artifacts (
mod.a,tvmgen_default.h) to{CCS_project}/artifacts/(replace existing files)Copy the golden vectors (
user_input_config.h,test_vector.c) to{CCS_project}/(replace existing files)
6. Select the Target Configuration
In the Project Explorer, expand your project
Find the targetConfigs folder
Right-click on the LaunchPad configuration file (e.g.,
TMS320F28P550SJ9_LaunchPad.ccxml)Select Set as Active Target Configuration
7. Build the Project
Right-click on the target configuration > Build Project
Wait for the build to complete. Check the Console panel for any errors.
8. Connect Your LaunchPad
Connect your TI LaunchPad to your computer using a USB cable.
10. Flash the Project
Right click on targte config > Flash Project
9.1.6.6. Verify Your Model
9.1.6.6.1. Start Debug Session
After flashing, the debug perspective should open automatically. If not, go to Run > Debug.
9.1.6.6.2. Run the Program
Click the Resume button (green play button).
9.1.6.6.3. Check the Results
9.1.6.6.4. Test Multiple Cases
The test_vector.c file contains multiple test cases. To test different cases:
Open
test_vector.cin the editorComment out the current test set (SET 0)
Uncomment another test set (e.g., SET 1)
Rebuild and reflash the project
Verify that the golden vector matches the model output
With this workflow, you can create your own generic time series regression applications using the same process.
9.1.6.6.4.1. Explore Other Regression Examples
To explore more regression examples refer to the following examples:
Washing Machine load weighing - Washing machine load weighing using current, voltage, speed data
Torque Measurement - Predicting torque of motor using current, voltage, collant temperature and other features.
Induction Motor Speed Prediction Induction motor speed prediction
Update History:
[29th Jan 2026]: Compatible with TinyML ModelMaker v1.3