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.

CodeFusion Studio’s plugin system is what makes the tool extensible across different firmware platforms, RTOSes, and HALs without modifying the base application. Plugins capture user-defined settings at various stages of development and generate configuration and source files based on customizable templates, tailored to internal HALs, middleware, and coding standards. Three distinct plugin types handle different stages of the development workflow — workspace creation, project setup, and source code generation — and all three are surfaced at the appropriate points in the Workspace Creation Wizard and System Planner.

Plugin types

CFS supports three types of plugins:

Workspace plugins

Provide single and multi-core workspace templates pre-populated with ADI-recommended configurations. Shown in the Workspace Creation Wizard when you choose Select a workspace template.

Project plugins

Define how a single-core project is structured and configured — including files, templates, and user-selectable options. Shown in the Workspace Creation Wizard when you choose Manually configure the workspace.

Code generation plugins

Define the templates used to produce source code from System Planner configuration settings (pin mux, memory, clocks, peripherals). Frequently bundled inside project plugins.

How plugins integrate with the CFS workflow

Workspace Creation Wizard

When you open the Workspace Creation Wizard and reach the Workspace Creation Options screen, your choice determines which plugin type drives the experience:
  • Select a workspace template — You are selecting a workspace plugin. The wizard is pre-populated with that plugin’s defaults and creates a complete, ready-to-use project structure.
  • Manually configure the workspace — You are selecting a project plugin for each enabled core. Each core can use a different plugin (for example, Zephyr for CM4 and MSDK for RISC-V on a MAX32690).

System Planner

Plugins define the configuration options that appear throughout the System Planner. These options are specified in two key sections of the plugin’s .cfsplugin file: supportedSocs and properties.

supportedSocs

This section declares which SoCs and boards the plugin supports. SoC data models are distributed through the Package Manager and provide the baseline hardware configuration used by the System Planner:
"supportedSocs": [
  {
    "name": "MAX32655",
    "board": "EvKit_V1",
    "package": "ctbga"
  }
]

properties

Built on top of the selected SoC hardware configuration, this section defines additional user-configurable fields that appear in the System Planner — for example, UART baud rate or Zephyr chosen role. These settings influence code generation but do not affect runtime behavior:
{
  "properties": {
    "project": [],
    "peripheral": {
      "UART0": {
        "supportedControls": [
          {
            "Id": "PARITY"
          }
        ],
        "addedControls": [
          {
            "Id": "CHOSEN",
            "Description": "Chosen. Multiple values can be separated by commas.",
            "Type": "identifier"
          },
          {
            "Id": "BAUD",
            "Description": "Baud Rate",
            "Hint": "115200",
            "Type": "integer"
          }
        ],
        "modifiedControls": []
      }
    }
  }
}
  • supportedControls — Lists SoC-level controls that this plugin exposes to the user (for example, PARITY for a UART peripheral).
  • addedControls — Platform-specific configuration fields that the plugin adds on top of the hardware defaults, such as CHOSEN (for Zephyr devicetree role) and BAUD (clock frequency for code generation).
  • modifiedControls — Overrides to existing SoC-level controls provided by the plugin.

Code generation

On the Generate Code tab in the System Planner, CFS uses the codegen section of the selected code generation plugin to generate source files based on the current configuration. The plugin receives the full pin, clock, peripheral, and memory configuration and returns a map of filenames to generated content lines.

List installed plugins with cfsutil

The cfsutil cfsplugins list command enumerates all plugins currently visible to the CLI. This is useful for verifying which plugins are available on a given machine and for diagnosing issues when a workspace or project type is not appearing in the wizard.
# List all available plugins
cfsutil cfsplugins list

# Filter plugins by SoC
cfsutil cfsplugins list --soc MAX32690

# Filter plugins by board
cfsutil cfsplugins list --board EvKit_V1

# Filter plugins by service type (workspace, project, or codegen)
cfsutil cfsplugins list --service workspace

# Combine multiple filters
cfsutil cfsplugins list --soc MAX32690 --board EvKit_V1 --service project

# Show configuration options (properties.project) in output
cfsutil cfsplugins list --config-options

# Search an additional plugin directory
cfsutil cfsplugins list -s /path/to/custom/plugins

# Multiple search paths with filtering
cfsutil cfsplugins list -s /path1 -s /path2 --soc MAX78000

Available flags

FlagDescription
-s, --search-pathSpecify an additional plugin search path. Can be used multiple times.
--socFilter results by supported SoC name.
--boardFilter results by supported board name.
--serviceFilter results by service type (workspace, project, or codegen).
--config-optionsInclude properties.project configuration options in the output.

cfsutil CLI plugin extensions

The cfsutil CLI is built on oclif and exposes hook points that let external packages add new code generation engines and SoC data models without modifying the core CLI.

add-codegen — adding a code generation engine

The add-codegen plugin pattern implements two oclif hooks: get-engines and generate-code. The get-engines hook returns an array of engine descriptors to register with the CLI:
[
  {
    "name": "example-code-generation-engine",
    "label": "Example Code Generation",
    "description": "This is an example of a code generation engine implementation.",
    "version": "1.0.0",
    "socs": [],
    "features": ["Pin Config"]
  }
]
The generate-code hook performs the actual code generation. It receives three parameters:
  • engine — the engine name selected by the user.
  • soc — the SoC data model object (pins, features, registers).
  • configdata — an object containing the pin mux and pin configuration choices.
If the engine name does not match, the listener should return undefined. If it matches, the listener returns an object mapping filenames to arrays of generated lines (without line terminators):
{
  "filename1.c": [
    "generated code line 1",
    "generated code line 2"
  ],
  "filename2.h": [
    "/* header content */"
  ]
}
Link the plugin to the CLI for local development:
# Build the CLI
yarn ws:cli build

# Build the add-codegen plugin
yarn ws:add-engine build

# Link the plugin to the CLI
cfsutil plugins link ../cli-plugins/add-codegen

# Verify the new engine appears
cfsutil engines list

add-soc — adding SoC data models

The add-soc plugin pattern implements the get-data-models hook, which returns a simple object mapping SoC names to the paths of their data model JSON files:
{
  "soc1234": "/path/to/soc/data/model/file/soc1234.json",
  "soc5678": "/path/to/soc/data/model/file/soc5678.json"
}
Link and verify the plugin:
# Build the CLI
yarn ws:cli build

# Build the add-soc plugin
yarn ws:add-soc build

# Link the plugin to the CLI
cfsutil plugins link ../cli-plugins/add-soc

# Verify the new SoCs appear in the list
cfsutil socs list

Develop custom plugins

CFS supports fully custom plugins, allowing you to extend its capabilities without modifying the base application. You can develop plugins tailored to specific project needs — such as upgrading an RTOS, integrating middleware, or applying custom code templates. For full details including API reference, templating guide, and plugin structure, see the CFS Plugins SDK README.

Plugin discovery

The CfsPluginManager (part of the cfs-lib package) automatically detects and parses plugins at startup. When VS Code launches, it:
  1. Scans the directories listed in cfs.plugins.searchDirectories.
  2. Validates plugin metadata.
  3. Registers plugin features for the CFS UI and CLI (cfsutil).

Activate a custom plugin

After building and testing your plugin, make it available in CFS by adding the path to the plugin dist directory to your VS Code settings.json:
1

Open settings.json

Open the settings.json file in your CFS workspace.
2

Add the plugin path

Add the path to your plugin’s output directory under cfs.plugins.searchDirectories:
"cfs.plugins.searchDirectories": [
  "/path/to/your/plugins/dist"
]
The path must point directly to the plugin’s dist folder, not to its source directory.
3

Restart CFS

Restart CFS to detect the new plugin. Once discovered, it will appear in the Workspace Creation Wizard and the cfsutil cfsplugins list output.

FAQ

A project plugin defines the full project structure: which files and templates are needed to set up the project environment, and what configuration options appear in the Workspace Creation Wizard. A code generation plugin (often bundled inside a project plugin) defines the templates that produce source code from the System Planner configuration. It is possible to have a project plugin that does not include a code generation plugin (for example, if the project uses an external toolchain for code generation), and it is possible for a code generation plugin to be shipped independently of a project plugin.
Yes. In a multi-core workspace, each core can use a different plugin. For example, a MAX32690 workspace might use com.analog.project.zephyr.plugin for the CM4 core and com.analog.project.msdk.plugin for the RISC-V core. The System Planner and code generation engine handle each core’s plugin independently.
CFS scans the directories listed in cfs.plugins.searchDirectories in your VS Code settings. Plugins installed through the Package Manager are placed in a well-known location that is included in the default search path. You can add additional directories to cfs.plugins.searchDirectories to include custom or locally developed plugins.
Run cfsutil cfsplugins list to see all plugins discovered in the default and any configured search paths. Use the --soc, --board, and --service flags to narrow the results. If a plugin you expect to see is missing, run cfsutil cfsplugins list -s /path/to/plugins with the explicit path to confirm whether the plugin is being found.

Build docs developers (and LLMs) love