TheDocumentation 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.
cfsutil tasks commands let you enumerate and execute the build, flash, clean, and debug tasks associated with a CodeFusion Studio workspace project — without opening the IDE. Task discovery combines the platform tasks generated for each project with any custom tasks defined in .vscode/cfs.tasks.json. Serial port output capture is supported for tasks that flash and run firmware, including Zephyr CTF trace collection.
Task commands operate on a generated workspace directory that contains a
.cfs/ folder. Do not pass the source .cfsworkspace file to these commands — pass the workspace root directory instead.cfsutil tasks list
Flag reference
| Flag | Short | Description |
|---|---|---|
--workspace=<path> | -w | Workspace root to inspect. Defaults to the current directory. The directory must contain .cfs/, or be a project directory inside a workspace that contains .cfs/ |
--project=<name> | -p | Filter output to a specific project folder |
--verbose | -v | Also display the shell command associated with each task |
cfsutil tasks run
<task> argument must match a sanitized task name exactly as printed by cfsutil tasks list.
Argument and flag reference
| Argument / Flag | Short | Description |
|---|---|---|
<task> | Required. Task name to run (as printed by tasks list) | |
--workspace=<value> | -w | Workspace path for task discovery. Defaults to the current directory |
--project=<value> | -p | Project folder name, relative to the workspace root |
--verbose | -v | Enable verbose output |
--capture | -c | Capture serial port output after task execution. Requires --port and --project. Continues until Ctrl+C |
--port=<value> | Serial port name (for example, COM3, /dev/ttyUSB0). Used with --capture | |
--zephyrTraceFile=<value> | -z | Output file path for Zephyr TEF trace. The CLI collects raw CTF data and generates the TEF file when capture stops |
Common task names
The following tasks are generated by CFS for most projects. Usecfsutil tasks list to see the exact names available for your workspace and project.
| Task name | Description |
|---|---|
build | Compile the project |
clean | Remove build artifacts |
erase_JLink | Erase device flash via J-Link |
flash_JLink | Flash firmware via J-Link |
flash_run_JLink | Flash firmware and start execution via J-Link |
cfsutil tasks run accepts only the sanitized task names printed by cfsutil tasks list. If a task label contains spaces or special characters, tasks list will show the sanitized form to use.Defining custom tasks for CLI use
Custom tasks must be defined in.vscode/cfs.tasks.json within the project directory:
cfs.tasks.json example:
Supported variable families
The CLI resolves these variable families incfs.tasks.json:
${config:<key>}— from merged CFS settings${env:<name>}— from the current shell environment${command:<name>}— supported CFS command lookups (for example, tool path resolution)${workspaceFolder}— the project directory used to run the task${workspaceFolderBasename},${userHome},${pathSeparator},${/}${cfs:...}— values handled by the CFS variable resolver
Configuration file
The CLI reads machine-wide settings fromconfig.json:
| Platform | Default location |
|---|---|
| Linux / macOS | ~/.config/cfsutil/config.json |
| Windows | %LOCALAPPDATA%\cfsutil\config.json |
CFSUTIL_CONFIG_HOME environment variable.
Example config.json:
J-Link erase tasks (
erase_JLink) require cfs.jlink.path to be set in config.json or the project’s .vscode/settings.json, pointing to your J-Link installation directory (for example, /opt/SEGGER/JLink_<version>).Serial port discovery
Before using--capture, identify the correct port name with:
CI/CD integration
For headless CI builds, usetasks run build after creating the workspace. Avoid --capture in CI unless you have a connected target and serial adapter.