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 integrates the full build-and-flash workflow into Visual Studio Code through a set of pre-configured tasks. Whether you are targeting an Arm Cortex-M device with the MSDK toolchain or a Zephyr RTOS project with west, CFS automatically generates the correct task configuration when you create a workspace. From there, a single keystroke compiles your firmware, links the output binary, and programs it to your connected hardware through the configured debug adapter.

Build tasks overview

CFS adds dedicated entries to the VS Code Tasks system for every workspace. These tasks are backed by the workspace .vscode/tasks.json file and read their configuration — target device, board, toolchain, and debugger type — directly from .vscode/settings.json. All tasks are equivalent regardless of which mechanism you use to invoke them.

CFS: build

Compiles project sources. Uses make for MSDK projects and west build for Zephyr. Outputs the binary and all object files to the ./build directory.

CFS: pristine build

Zephyr only. Runs west build --pristine=always to delete cached artifacts before recompiling from scratch.

CFS: clean

Removes the ./build directory and all of its contents without recompiling.

CFS: clean-periph

Runs CFS: clean and also removes MSDK peripheral driver build output, forcing a full peripheral recompilation on the next build.

CFS: flash

Builds the project, then flashes the output binary via the configured debugger. The task name includes the adapter type, for example CFS: flash (OpenOCD) or CFS: flash (JLink).

CFS: flash & run

Builds, flashes, and immediately resumes execution on the target after programming completes.

CFS: erase

Erases all application flash without reflashing. Useful for recovering from LP lockouts or bad firmware.

CFS: debug

Launches the most recently used debug session, optionally reflashing first, then halts at main().

Running build and flash tasks

1

Open your CFS workspace

Open the workspace folder in VS Code. The CFS extension detects the workspace configuration and populates the task list automatically.
2

Choose a task access method

You can invoke any task through four entry points:
  • Command Palette — press Ctrl+Shift+P (or Cmd+Shift+P on macOS), search for Tasks: Run Build Task or Tasks: Run Task, and select from the list.
  • Actions view — click the CFS icon in the Activity Bar, then choose a task from the Actions panel.
  • Status Bar — click the build, clean, flash, or debug shortcut icons on the left side of the status bar.
  • Terminal menu — select Terminal → Run Build Task from the menu bar.
3

Build the firmware

Run CFS: build (or press Ctrl+Shift+B / Cmd+Shift+B). The integrated terminal shows compiler output. A successful build produces the ELF binary in ./build.
4

Connect your hardware

Attach your evaluation board’s debug probe to your computer via USB. Ensure the board is powered on. Refer to your board’s data sheet for the correct SWD/JTAG header and cable.
5

Flash the firmware

Run CFS: flash (or CFS: flash & run if you want execution to resume automatically). The task first rebuilds if necessary, then programs the binary. The task name in the picker reflects the active debugger, for example CFS: flash (OpenOCD).
6

Verify

After flashing, the microcontroller state (halted vs. running) depends on the debugger. Reset or power-cycle the board, or use your debugger to resume execution.
The build task keyboard shortcut is Ctrl+Shift+B on Windows/Linux and Cmd+Shift+B on macOS. The status bar icons for build, clean, flash, and debug provide one-click access to the most common tasks without opening any menu.

CFS settings

CodeFusion Studio adds its own settings namespace inside VS Code to configure toolchain paths, debugger selection, and build options. These settings determine how CFS locates SDKs, compilers, and debug adapters at build and flash time. Settings are applied in a hierarchy: Folder overrides Workspace, which overrides User. When you create a new workspace, CFS automatically writes workspace-scoped settings to .vscode/settings.json.

Accessing settings

  • VS Code Settings UI — go to File → Preferences → Settings (macOS: Code → Settings → Settings), or press Ctrl+, / Cmd+,.
  • Command Palette — search for Preferences: Open Settings (UI).
  • Directly edit .vscode/settings.json in your workspace folder for workspace or folder-level overrides.

Viewing all CFS settings

1

Open the Extensions tab

Press Ctrl+Shift+X (or Cmd+Shift+X on macOS) to open the Extensions view.
2

Select the CodeFusion Studio extension

Find and click CodeFusion Studio in your installed extensions list.
3

Navigate to Settings

On the extension detail page, go to Features → Settings to view a complete list of all available CFS configuration keys.
Common settings you may need to adjust include:
  • cfs.sdk.path — override the path to the MSDK or Zephyr SDK root.
  • cfs.openocd.interface — select the OpenOCD interface config file, for example interface/ice1000.cfg for ICE-1000 emulators.
  • cfs.coreDump.address / cfs.coreDump.size — configure the flash partition used for Zephyr core dumps.

The CFS Terminal

CFS ships a custom terminal profile called the CFS Terminal. When you open it, CFS automatically prepends the SDK’s tools directory to your PATH so that utilities like cfsutil and Zephyr’s west are available immediately — no manual environment setup required. The underlying shell is cmd on Windows, zsh on macOS, and bash on Linux.
1

Open a new terminal

Press Ctrl+Shift+` (all platforms) or go to Terminal → New Terminal (macOS/Linux) or View → Terminal (Windows).
2

Select CFS Terminal

In the terminal panel, click the dropdown arrow next to the + icon (top-right corner) and choose CFS Terminal.
3

Confirm the environment

Run cfsutil in the new terminal to verify that the SDK tools are on the PATH and the environment is correctly configured.
Most IDE tasks (build, flash, workspace management) have equivalent cfsutil commands you can run from the CFS Terminal. See the CFS Command Line Utility documentation for the full command reference.

Zephyr-specific build notes

For Zephyr RTOS projects, CFS generates a default west build command based on the board and target selected during workspace creation. Many scenarios require passing additional arguments to west or CMake.
Pass KConfig flags directly on the command line for a single build without modifying prj.conf. Use the CFS Terminal:
west build -p auto -b apard32690/max32690/m4 -- -DCONFIG_FAULT_DUMP=1
The double dash -- passes everything that follows directly to CMake.
To make a custom west invocation repeatable, use Copy and Edit in the Actions view to create a custom task based on the default build task, then update the command field in .vscode/tasks.json with your full west build string.

Custom and modified tasks

CFS tasks can be customized to extend or replace the default behavior. Custom tasks appear alongside built-in tasks in the Actions view with a CFS: prefix.

Create a custom task

  • Click the dropdown arrow in the Terminal panel and select Configure Tasks, then choose a task to copy, or
  • In the Actions view, click Copy and Edit next to the task you want to duplicate.
This adds a copy to .vscode/tasks.json. Edit the copy freely — the original task is unaffected.
Append a description to the label field in tasks.json to identify your custom tasks easily. For example: "label": "CFS: build MAX32690-debug".

Modify an existing custom task

  • Click the dropdown in the Terminal panel, choose Configure Tasks, and select your previously created task, or
  • Click Edit next to your custom task in the Actions view.
The .vscode/tasks.json file opens in the editor for direct modification.

Troubleshooting

Environment variables such as CC, CFLAGS, CXXFLAGS, LDFLAGS, LD, and others can silently override the flags CFS sets for your project, causing unpredictable build behavior.To list all active environment variables, run set in a Windows terminal or env on Linux/macOS. Unset any conflicting variables before building.
If the build task fails with a toolchain-not-found error, open VS Code Settings and verify that cfs.sdk.path points to the correct MSDK or Zephyr SDK installation directory. For workspace-specific overrides, edit .vscode/settings.json directly.
The flash task requires an active debug probe connection. Verify that:
  • The debug probe is physically connected to the correct header on your evaluation board.
  • The USB cable is connected to your computer and the board is powered on.
  • The correct driver is installed (Segger J-Link, OpenOCD, or ICE as required by your board).
  • No other application (such as a GDB server or JLink utility) is holding the probe open.
If a Zephyr build produces unexpected results after changing configuration, run CFS: pristine build to remove all cached CMake and Ninja artifacts and force a clean compilation. This is also useful when switching between boards or overlay files.

Build docs developers (and LLMs) love