9.1.2. CCS Integration Guide
This page covers the Code Composer Studio (CCS) side of deployment: importing an SDK example, building, flashing and debugging it. What to copy from the run folder, and which SDK example to pick, is described once in Deploying a ModelZoo Run to an SDK Example (Golden-Vector Check).
9.1.2.1. Prerequisites
Code Composer Studio 20.4.0 or later (the version used by the 1.5.0 deploy guide), with support for your device family.
The device SDK that holds the AI examples (see the SDK table in Deploying a ModelZoo Run to an SDK Example (Golden-Vector Check)), installed through CCS Resource Explorer or standalone.
A trained and compiled run (
compilation: enable: True). The files you need:compilation/artifacts/mod.a compilation/artifacts/tvmgen_default.h training/quantization/golden_vectors/test_vector.c training/quantization/golden_vectors/user_input_config.h
compilation/<date-time>_<model>_<device>.zipbundles the same set.
9.1.2.2. What You Get in the Run Folder
File |
Purpose |
|---|---|
|
Compiled model library for one device (instruction set and NPU or not). On AM13E2 the project
links |
|
Model API ( |
|
|
|
Raw input, expected model input and expected model output for a few samples. |
9.1.2.3. Import the Example
Open CCS and go to View -> Resource Explorer.
Resource Explorer in Code Composer Studio
Filter by your board (for example
LAUNCHXL-F28P55X) and search for the example name.
Board and keyword filters
Select the example and click Import; install any dependencies when prompted.
Importing the example
Installing required dependencies
The project spec copies artifacts/, test_vector.c, user_input_config.h and
application_main.c into your CCS workspace. Edit the workspace copy; the SDK install stays untouched.
If an example is not listed in Resource Explorer, use File -> Import Projects and browse to the example’s
device folder (see Non-NPU Deployment).
Replace the four files in the workspace project with the ones from your run. Do not change
application_main.c, the .syscfg or the linker command file unless you need to (see
Memory and Linker Problems).
9.1.2.4. Build, Flash and Run
Project -> Build Project(s) (
Ctrl+B) and check the Console for errors.
Building the project
Set the LaunchPad
.ccxml(for exampleTMS320F28P550SJ9_LaunchPad.ccxml) as the active target configuration: right-click it in Project Explorer.
Selecting the LaunchPad target configuration
Connect the board over USB and use Run -> Debug Project (or Flash Project). If a firmware-update dialog appears, click Update.
Flashing the application
Firmware update dialog
9.1.2.5. Check the Result
In the Debug perspective, add
test_resultto the Watch window and press Resume (F8).
CCS Debug perspective
Adding test_result to the Watch window
Read the CIO console. For classification, regression and forecasting:
Feature extraction mismatches 0 All tests have passed. Golden vectors matched: 2 not matched: 0
test_resultis 1 on PASS. Values may differ by at most 1 from the PC result (feature extraction and model output). The “matched” count equals the number of model outputs.
test_result after a passing run
For anomaly detection the tolerance on each output is 4, the example then computes the
reconstruction error and compares it with RECONSTRUCTION_ERROR_THRESHOLD from
user_input_config.h. There test_result means 1 = anomaly, 0 = normal.
To step through the inference yourself, place a breakpoint after the tvmgen_default_run call in
application_main.c and inspect model_output.
Breakpoint after the inference call
9.1.2.6. Memory and Linker Problems
If the linker reports that a section does not fit (for example FFT_buffer_1 or .bss),
your model or feature-extraction configuration is larger than the example’s. Start from an
example with a similar feature-extraction preset, or adjust the memory placement in
lnk.cmd. ModelMaker reports model memory (and, for supported devices, feature-extraction library
memory) after compilation; see Device Overview.
9.1.2.7. Common Issues
The full symptom table (FE mismatches, not matched counts, model_input_t build errors,
undefined tvmgen_default_run, hang at tvmgen_default_finished) is in the
troubleshooting section of Deploying a ModelZoo Run to an SDK Example (Golden-Vector Check). In short: all four files must
come from the same run, golden vectors from training/quantization/, and a stale build needs
Project -> Clean.
9.1.2.8. Next Steps
NPU Device Deployment for NPU devices
Non-NPU Deployment for CPU-only devices