ModelZoo · Deploying to an SDK Example
The 4 Files and Where They Go
Copy them from one run folder (data/projects/<dataset>/run/<date-time>/<model>/) into the imported SDK project, keeping the same names
| File | From the run folder | Into the CCS project | What it does |
mod.a | compilation/artifacts/mod.a | artifacts/mod.a | Compiled model library, built for one device |
tvmgen_default.h | compilation/artifacts/tvmgen_default.h | artifacts/tvmgen_default.h | Model API (tvmgen_default_run) and input bias/scale/shift |
user_input_config.h | training/quantization/golden_vectors/ | user_input_config.h | Configures the SDK feature-extraction library to match training |
test_vector.c | training/quantization/golden_vectors/ | test_vector.c | Raw input, expected features and expected output (golden_output) for a few samples |
Shortcut: compilation/<date-time>_<model>_<device>.zip already bundles the matching set: artifacts/, golden_vectors/, plus model_aux.h (class names). Unzip and copy from there.
Use the quantized golden vectors. mod.a is compiled from training/quantization/model.onnx. The training/base/ golden vectors are float outputs of the float model and will not match.
Adithya Thonse · October 2026
ModelZoo · Deploying to an SDK Example
The One Rule: All Four From the Same Run
Golden outputs and normalization parameters are tied to the trained weights. Two runs of the same config still differ
SDK arc_fault example vs. a fresh dc_arc_fault/config_dsk.yaml run (CLS_1k_NPU, F28P55)
| File | SDK example | Fresh run | |
user_input_config.h | identical #defines (same config) | same |
golden_output | { 43, -52 } | { 61, -73 } | differs |
tvmgen_default_bias_data | 20.710558 | 20.517256 | differs |
mod.a weights | retrained, so different | differs |
Replacing only mod.a (or only test_vector.c) gives a project that builds fine but fails the check.
Do
Copy all four files from one <date-time>/<model>/ folder, or from its compilation zip.
Quick check
The header of tvmgen_default.h names its source model: input model file: .../<model>/training/quantization/model.onnx. That path should be the same run as your golden vectors.
Leave the rest of the example alone
application_main.c, .syscfg and lnk.cmd are generic. What makes an example "arc fault" lives in the four files.
Adithya Thonse · October 2026
ModelZoo · Deploying to an SDK Example
Step 1: Pick the SDK and the Example
The SDK follows common.target_device; the example follows common.task_type
SDK by target_device
| target_device | SDK | Examples under | Device folder |
| F28P55, F28P65, F28004, F28003 | C2000Ware 6.01 | libraries/ai/examples/ | f28p55x/ … |
| F29H85 | F29H85x SDK 1.04 | examples/ai/ | f29h85x/ |
| MSPM33C32 | MSPM33 SDK 1.03 | examples/ai/ | mspm33c321a/ |
| AM13E2 | MCU-SDK 1.00 | examples/ai/ | (single) |
| AM263 | MCU-PLUS-SDK 11.03 | examples/ai/ | am263x_lp/ |
mod.a is compiled for one device (instruction set, NPU or not). Use the device folder that matches the run's target_device.
Example by task_type (any one works)
| Task | Examples |
| Classification | generic_timeseries_classification, arc_fault, motor_fault, blower_imbalance |
| Regression | generic_timeseries_regression, torque_measurement, washing_machine_load_weighing |
| Forecasting | generic_timeseries_forecasting, forecasting_pmsm_rotor_temp, hvac_indoor_temp_forecast |
| Anomaly detection | generic_timeseries_anomalydetection, fan_blade_anomalydetection |
Within a task, the examples share the same application_main.c. Pick the one named after your application, or the generic_* one.
Adithya Thonse · October 2026
ModelZoo · Deploying to an SDK Example
Steps 2–3: Import the Example, Replace the Files
The project spec copies the example files into your CCS workspace, so you edit the workspace copy and the SDK install stays untouched
Import in Code Composer Studio
- View → Resource Explorer
- Filter by board (e.g. LAUNCHXL-F28P55X), search the example (e.g.
f28p55x_arc_fault)
- Import, and install the dependencies it asks for
f28p55x_arc_fault/ # imported project
├── application_main.c # leave as is
├── artifacts/
│ ├── mod.a <- replace
│ └── tvmgen_default.h <- replace
├── test_vector.c <- replace
├── user_input_config.h <- replace
├── c2000.syscfg # board + NPU init
└── lnk.cmd # memory map
Copy the 4 files over the originals
RUN=data/projects/<dataset>/run/<date-time>/<model>
PRJ=<ccs_workspace>/f28p55x_arc_fault
cp $RUN/compilation/artifacts/mod.a $PRJ/artifacts/
cp $RUN/compilation/artifacts/tvmgen_default.h $PRJ/artifacts/
cp $RUN/training/quantization/golden_vectors/test_vector.c $PRJ/
cp $RUN/training/quantization/golden_vectors/user_input_config.h $PRJ/
# Windows: drag and drop in Explorer or the CCS Project Explorer
AM13E2: the project links artifacts/mod_m33_ti_arm_clang.a. Copy mod.a in under that name.
Adithya Thonse · October 2026
ModelZoo · Deploying to an SDK Example
Step 4: Build, Flash and Read the Result
The example runs two checks on the active SET of test_vector.c, each within ±1
- Project → Build Project
- Set the active target to the LaunchPad config, e.g.
TMS320F28P550SJ9_LaunchPad.ccxml
- Run → Debug Project (flashes the board), watch
test_result, press Continue
Expected console (CIO)
Feature extraction mismatches 0
All tests have passed.
Golden vectors matched: 2 not matched: 0
test_result = 1 (PASS). The matched count equals the number of model outputs (FE_NN_OUT_SIZE).
More sets: wrap SET 0 in /* */, unwrap another SET (one at a time), rebuild, flash. Each array is commented with its class and sample index.
raw_input_test ─► FE_runFeatureExtract ─► model_input ─► tvmgen_default_run ─► model_output
│ │
check 1: vs model_test_input check 2: vs golden_output
Check 1 · feature extraction
The SDK library, set up by user_input_config.h, must reproduce the PC features. Non-zero count: look at user_input_config.h / test_vector.c.
Check 2 · model
The compiled model must reproduce the PC output. Mismatch with check 1 at 0: look at mod.a / tvmgen_default.h. On NPU devices the app first waits for tvmgen_default_finished.
Anomaly detection is different
Outputs may deviate by up to 4; the reconstruction error is compared with RECONSTRUCTION_ERROR_THRESHOLD from user_input_config.h. Here test_result means 1 = anomaly, 0 = normal.
Adithya Thonse · October 2026
ModelZoo · Deploying to an SDK Example
When It Does Not Match
Read the two console counts first: they tell you which files to look at
| Symptom | Likely cause | Fix |
Feature extraction mismatches > 0 | user_input_config.h and test_vector.c from different runs, or an older SDK | Copy both from one golden_vectors/; use the recommended SDK version |
FE mismatches 0, not matched > 0 | mod.a from another run, or base/ golden vectors with the quantized mod.a | All four from one run; golden vectors from training/quantization/ (or the zip) |
Type errors on model_input_t / model_output_t | SKIP_NORMALIZE / OUTPUT_INT in user_input_config.h switch them to int8_t | Use the user_input_config.h that matches mod.a |
Undefined tvmgen_default_run, incompatible object | mod.a built for another device; AM13 file name | Re-run with the right target_device; AM13: mod_m33_ti_arm_clang.a |
RECONSTRUCTION_ERROR_THRESHOLD undeclared | Anomaly-detection user_input_config.h is missing its defines | Check the file has the FE defines and the threshold; regenerate the run if it is empty |
Hangs at while (!tvmgen_default_finished) | NPU model, but the NPU is not initialized | Keep the NPU module in the .syscfg (C2000) or TI_NPU_init() (F29H85) |
| Linker: section does not fit | Model or feature extraction larger than the example's | Start from an example with a similar FE preset; adjust lnk.cmd |
After it passes: keep the feature-extraction and tvmgen_default_run calls, and feed fe_handle->input_buffer from your ADC/sensor instead of raw_input_test. Full walkthrough: docs/DEPLOYING_TO_SDK_EXAMPLE.md.
Adithya Thonse · October 2026