Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/analogdevicesinc/codefusion-studio/llms.txt

Use this file to discover all available pages before exploring further.

An AI workspace in CodeFusion Studio is a fully configured development project built around a specific AI model and target device. Unlike a standard workspace created from a code template, an AI workspace automatically integrates your model file, runs a compatibility check against the chosen SoC and core, generates the initial inference C/C++ source files, and opens the AI Hardware Profiling view ready for deployment. This workflow is optimized for ML engineers who want to move from a trained model to a running embedded application with minimal embedded systems knowledge required.

What gets created

When you create a workspace from an AI model, CodeFusion Studio produces a complete project structure that includes:
  • A .cfsconfig file recording the model configuration (backend, target SoC, core, and extension properties)
  • Generated C/C++ source and header files for the inference runtime
  • A .cfs/ai.cfsaiprof file that opens the AI Hardware Profiling view
  • An application source file that loads the model, runs inferences (using provided sample data or random input), and emits Zephelin profiling trace data over UART
The generated application runs (sizeof(dataset) / sizeof(model_input)) iterations if sample data is provided, or 10 inferences on random input data if no sample data is given.

Create a workspace from the GUI

1

Open the Workspace Creation Wizard

Click the CodeFusion Studio icon in the VS Code activity bar to open the CFS Home Page, then click New Workspace from AI model.
2

Configure the Files section

In the Files section, provide the following:
  • Model File (required): Click Browse and select your trained model file. For example, hello_world_f32.tflite. Supported formats include .tflite for TFLM and .pth.tar for MAX78002 PyTorch CNN models.
  • Sample Data (optional): Click Browse to select a binary input dataset file (.bin). Example data files are available in the cfs-ai/examples/ directory of the CodeFusion Studio repository — for example, use hello_world_f32.bin with hello_world_f32.tflite.
  • Workspace Name (optional): Enter a custom name, or leave blank to auto-generate a name based on the SoC and package selection (for example, MAX32690-TQFN).
3

Select a target SoC

In the SoCs section, use the search box to filter available devices and select the SoC that matches your hardware — for example, MAX32690, MAX78002, or an ADSP-SC5xx part. Compatibility checking runs automatically when you select a model file. Compatible SoCs display a Compatible badge.
Only SoCs with AI profiling support appear in this list. The catalog is filtered automatically to show compatible hardware.
4

Select a board

After selecting an SoC, choose your specific development board from the Board dropdown.
5

Select target cores

In the Cores section, enable the Run model on core toggle for each processor core you want to target. Supported cores show the toggle; unsupported cores display an Unsupported badge and cannot be selected.
6

Create the workspace

Click Create Workspace. The system validates your selections, generates the workspace, and automatically opens it in a new VS Code window. An initial build starts automatically and the AI Hardware Profiling view opens.

Wizard field reference

FieldRequiredDescription
Model FileYesThe AI model to deploy. Supported formats include .tflite (TFLM) and .pth.tar (PyTorch/izer).
Sample DataNoBinary input dataset file (.bin) matching the model’s input format. Example files are in cfs-ai/examples/.
Workspace NameNoCustom workspace directory name. If omitted, auto-generates as {SoC}-{Package} (e.g. MAX32690-TQFN).
SoCYesTarget microcontroller. Only SoCs with AI plugin support are shown.
BoardYesSpecific development board variant. Options depend on the selected SoC.
Run model on coreNoToggle to target a specific processor core for model deployment.

Create a workspace from the CLI

Use cfsutil ai workspace create to generate a complete AI workspace from the terminal. This command runs a compatibility check, creates the project structure, integrates the model, and performs an initial build automatically.
cfsutil ai workspace create \
    --output <output_directory> \
    --name <workspace_name> \
    --soc <soc> \
    --board <board> \
    --core <core> \
    --model <path/to/model_file>

Required flags

FlagDescription
--output / -oOutput directory path. The workspace is created as a subdirectory inside this path.
--nameName for the new workspace.
--socTarget SoC (e.g. MAX32690, MAX78002, ADSP-SC835).
--boardBoard name (e.g. EvKit_V1).
--coreTarget core (e.g. CM4, CM33, FX).
--model / -mPath or URL to the model file.

Example: create a workspace for MAX32690

cfsutil ai workspace create \
    -o ~/cfs-projects \
    --name my-tflm-app \
    --soc MAX32690 \
    --board EvKit_V1 \
    --core CM4 \
    --model ./models/hello_world_f32.tflite \
    --dataset ./models/hello_world_f32.bin

Example: create a workspace using a remote model

The --model and --dataset flags accept raw remote URLs in addition to local file paths. Remote files are cached for offline reuse and refreshed after one hour.
cfsutil ai workspace create \
    -o ~/cfs-projects \
    --name hello-world-remote \
    --soc MAX32690 \
    --board EvKit_V1 \
    --core CM4 \
    --model https://raw.githubusercontent.com/analogdevicesinc/codefusion-studio/main/cfs-ai/examples/hello_world_f32.tflite \
    --dataset https://raw.githubusercontent.com/analogdevicesinc/codefusion-studio/main/cfs-ai/examples/hello_world_f32.bin
Use raw download URLs, not repository page URLs. For example, use https://raw.githubusercontent.com/org/repo/branch/file.tflite, not https://github.com/org/repo/blob/branch/file.tflite.

Skip the compatibility check

By default, cfsutil ai workspace create runs cfsutil ai compat before generating the workspace. Use --skip-compat (-f) to bypass this step.
cfsutil ai workspace create \
    -o ~/cfs-projects \
    --name quick-test \
    --soc MAX32690 \
    --board EvKit_V1 \
    --core CM4 \
    --model ./model.tflite \
    --skip-compat
Skipping the compatibility check may result in build errors or runtime failures if the model is not compatible with the target hardware. Use this option only when you are certain the model will work on the target.

What happens during workspace creation

1

Compatibility check

cfsutil ai compat is run to verify the model is compatible with the target hardware. Use --skip-compat to bypass this step.
2

Workspace generation

A new workspace is created at the specified location using the appropriate template for the target SoC and board.
3

Model integration

The model is added to the workspace configuration using cfsutil ai model update, writing an entry to the AIModels array in the .cfsconfig file.
4

Initial build

The model is compiled into C/C++ source code using cfsutil ai build. The resulting workspace is ready to open in the IDE or build from the command line.

The .cfsconfig AI section

Model configurations are stored in the AIModels array inside the workspace .cfsconfig file. Each entry describes the backend, target, and backend-specific properties. An example TFLM model entry looks like this:
{
  "Name": "hello_world_f32",
  "Files": {
    "Model": "path/to/hello_world_f32.tflite"
  },
  "Target": {
    "Core": "CM4"
  },
  "Backend": {
    "Name": "tflm",
    "Extensions": {
      "Symbol": "hello_world_model_f32",
      "Section": ".data"
    }
  },
  "Enabled": true
}

Managing models in an existing workspace

Once a workspace exists, use the cfsutil ai model subcommands to add, inspect, update, or remove model configurations without re-running the full workspace wizard.
# Add a TFLM model to a MAX32690 workspace
cfsutil ai model add \
    --config .cfs/max32690-tqfn.cfsconfig \
    --core CM4 \
    --model path/to/model.tflite \
    -e Symbol=my_model \
    -e Section=.data

# Add a MAX78002 CNN model (izer backend)
cfsutil ai model add \
    --config .cfs/max78002.cfsconfig \
    --core CM4 \
    --acc CNN \
    --model path/to/model.pth.tar \
    --network-config path/to/network.yaml \
    -e Softmax=true
A model with the same name cannot be added twice. The name is derived from the model filename (without extension). If --acc CNN is omitted, the model is treated as a TFLM model and --network-config is silently ignored.

End-to-end CLI workflow example

The following sequence shows a complete embedded AI workflow from the command line — adding a model, checking compatibility, generating code, and listing configured models.
# 1. Create a workspace for MAX32690
cfsutil ai workspace create \
    -o ~/projects \
    --name tflm-demo \
    --soc MAX32690 \
    --board EvKit_V1 \
    --core CM4 \
    --model ./hello_world_f32.tflite

# 2. Add a second model to the same workspace
cd ~/projects/tflm-demo
cfsutil ai model add \
    --config .cfs/max32690-evkit.cfsconfig \
    --core CM4 \
    --model ./models/resnet.tflite \
    -e Symbol=resnet_model

# 3. Check compatibility of the new model
cfsutil ai compat \
    --soc MAX32690 \
    --core CM4 \
    --model ./models/resnet.tflite

# 4. Generate C/C++ source for all configured models
cfsutil ai build --config .cfs/max32690-evkit.cfsconfig

# 5. Verify what models are now configured
cfsutil ai model list --config .cfs/max32690-evkit.cfsconfig --verbose

Next steps

Check Compatibility

Validate operator support, memory constraints, and data types before generating code.

Profile Resources

Estimate inference latency, memory usage, and per-layer performance before deployment.

Build docs developers (and LLMs) love