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 provides a fully integrated debugging environment for Analog Devices microcontrollers and DSPs. Built on top of VS Code’s native Run and Debug view, it adds embedded-specific capabilities including SVD-based peripheral register inspection, RTOS thread awareness, multi-core session coordination, and post-mortem core dump analysis. This page covers everything from installing debug drivers and connecting hardware through to launching single-core and multi-core debug sessions and interpreting the debug interface.

Supported debug adapters

CFS supports multiple debug probes depending on the target architecture:

Segger J-Link

For Arm Cortex-M targets. Supports SWD and JTAG. Used with JlinkGDBServer or OpenOCD debug configurations.

MAX32625PICO

ADI’s on-board debugger for MAX32xxx evaluation kits. Compatible with OpenOCD over SWD.

Olimex ARM-USB-OCD-H

Required for RISC-V core debugging on dual-core devices such as MAX78002. Used with the ARM-JTAG-20-10 converter and an OpenOCD RISC-V configuration.

ICE-1000 / ICE-1500 / ICE-2000

ADI ICE emulators for SHARC-FX JTAG debugging. Windows only. Required for ADSP-SC83x and ADSP-2183x targets.

On-board J-Link (MAX32657/58)

The MAX32657 and MAX32658 EV kits include an on-board J-Link via USB-C. External J-Link can be enabled through jumper configuration.

Installing debug drivers

Before connecting hardware, install the driver for your debug probe. Driver installation is required only once per machine.

Connecting hardware

Physical connections vary by board and debug probe. The general pattern is:
1

Install drivers

Confirm the appropriate debug probe driver is installed for your target (see above).
2

Connect the debug probe to the board

Use the correct cable and header for your board and debugger:
  • SWD (Arm Cortex-M): 10-pin ribbon cable to the SWD header (for example, J3 on MAX32690EVKIT, JH8 on MAX78002EVKIT).
  • RISC-V JTAG: Olimex adapter with ARM-JTAG-20-10 converter to the RV JTAG header (for example, JH5 on MAX78002EVKIT).
  • SHARC-FX JTAG: ICE emulator ribbon cable to the JTAG header (for example, P6 on ADSP-SC835W board).
3

Connect the UART cable

For serial console output, connect a USB cable to the board’s UART port (for example, CN2 on MAX32690EVKIT or MAX78002EVKIT, J1 on MAX32657EVKIT). Identify the serial port using Device Manager on Windows (COM*), ls /dev/tty.* on macOS, or ls /dev/ttyUSB* /dev/ttyACM* on Linux.
4

Power the board

Connect the power source as required by your board. Some boards are USB-powered; others (such as MAX78002EVKIT) require an external 5 V supply. Flip the power switch to ON.
5

Connect debugger to computer

Plug the debug probe into your computer via USB. For J-Link probes, verify the LED indicator is illuminated. For ICE emulators, verify the LED flashes green.
If you are unsure which serial port corresponds to your board, disconnect the UART cable and note which port disappears from the list, then reconnect.

Starting a debug session

CFS automatically generates a default debug configuration for each new workspace. In most cases, you can start debugging immediately.
1

Build the project

Run CFS: build (or Ctrl+Shift+B) to generate the ELF binary. Debugging requires a valid ELF file in the ./build directory.
2

Open Run and Debug

Click the Run and Debug icon in the Activity Bar (or press Ctrl+Shift+D / Cmd+Shift+D).
3

Select a debug configuration

Choose the configuration that matches your target and debugger from the dropdown:
  • CFS: Debug with GDB and OpenOCD (Arm Embedded) — for Cortex-M with OpenOCD
  • CFS: Debug with JlinkGDBServer and JLink (Arm Embedded) — for Cortex-M with J-Link
  • CFS: Debug with GDB and OpenOCD (RISC-V) — for RISC-V cores
4

Start debugging

Click the green Start Debugging play button to the left of the dropdown, or press F5. The debugger flashes the binary (if configured), connects to the target, and halts at main().
When using the CFS: Debug with GDB and OpenOCD (Arm Embedded) configuration, CFS automatically loads the appropriate SVD file from the CMSIS Pack directory for peripheral register inspection. For other targets, you may be prompted to select an SVD file manually.

The debug interface

Once a session is active and the target is halted, the CFS debugging interface provides the following panels and views:

Execution controls

The floating debug toolbar provides these actions:
ActionDescription
ResetStop and reload the program
PauseSuspend execution at the current instruction
Step OverAdvance to the next source line, skipping into function calls
Step IntoEnter the next function call
Step OutReturn from the current function to its caller
RestartReset the program counter without disconnecting or reflashing
StopTerminate execution and close the session

Variables and watch

The Variables panel shows local, global, and static variables scoped to the current stack frame. Double-click a value to edit it in place. The Watch panel evaluates arbitrary expressions and GDB expressions each time execution pauses.
Watch expressions are not context-aware across stack frames. An expression referencing a local variable from a different scope will fail to evaluate. Expressions that assign values (such as counter = 0) will execute that assignment each time the expression is re-evaluated on pause or step.

Call stack and disassembly

The Call Stack panel displays the full call chain with function names, PC addresses, and source information. Select any frame to inspect its local variables and registers. Right-click the active frame and choose Open Disassembly View to inspect machine-level instructions.
While the Disassembly view is focused, each step action advances by a single assembly instruction rather than a source line.

Breakpoints

CFS supports three breakpoint types:
  • Line breakpoints — click the left margin next to a line number to set a standard breakpoint.
  • Conditional breakpoints — right-click an existing breakpoint, select Edit breakpoint → Expression, and enter a condition. Execution only pauses when the condition is true.
  • Inline breakpoints — place the cursor at the exact expression within a line and use Shift+F9 (Windows/Linux) or Cmd+F9 (macOS) to break mid-expression.

Peripheral registers

The XPeripherals view provides a nested tree of all memory-mapped peripheral registers and their individual bit fields, loaded automatically from the SVD file. Hover over any register or bit for documentation. Click to copy a value, or click to modify it.
Some register bits are reserved and not listed in the SVD. When writing to a full register value, ensure reserved bits remain zero.

RTOS thread awareness

When debugging a Zephyr RTOS application, the XRTOS tab displays all active thread names, states, and stack usage. Enable the following Kconfig flags in your prj.conf:
CONFIG_THREAD_NAME=y
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_THREAD_ANALYZER=y
You need the RTOS Views VS Code extension to use the XRTOS tab.

Serial output

View UART output from the target using any serial terminal. The VS Code Serial Monitor extension provides a built-in terminal; third-party tools such as Tera Term, Minicom, or PuTTY are also supported (baud rate: 115200).
Arm CMSIS-DAP debuggers (including MAXPICO and MAX32xxxx on-board debuggers) use the serial Break signal to trigger a target reset. Microsoft’s Serial Monitor sends a Break before connecting, which resets the processor. Connect to the serial port before starting a debug session when using CMSIS-DAP probes, or use an external terminal such as Minicom or PuTTY.

SHARC-FX debugging notes

SHARC-FX debugging is Windows only and requires the Xtensa toolchain and ICE emulator. ADSP-SC83x multicore SoCs require starting the SHARC-FX core debug session before attaching the ARM core.
1

Install ICE drivers and Xtensa toolchain

Ensure ICE drivers are installed. Log in with your myAnalog account and install xtensa_sharcfx_toolchain/15.5.0 via the Command Palette (CFS: Install Required Packages) or cfsutil pkg install xtensa_sharcfx_toolchain/15.5.0.
2

Connect the ICE emulator

Attach the ICE emulator USB cable to your computer, then connect the ribbon cable to P6 (JTAG header) on the board. Connect the board’s USB-C power/data cable to P1. Verify both LEDs flash green.
3

Configure the ICE model (if not ICE-2000)

If using ICE-1000 or ICE-1500, update .vscode/settings.json:
"cfs.openocd.interface": "interface/ice1000.cfg"
Also update the adapter speed in .vscode/launch.json (maximum 5000 for ICE-1000/ICE-1500):
"openOCDLaunchCommands": ["adapter speed 5000"]
4

Build and start the SHARC-FX debug session

Run Build (sfx) from the Actions view, then select Debug with GDB and OpenOCD (sfx) and press F5. The preload application runs and configures clocks. Click the Reset device icon to load the main application.
5

Start the ARM debug session (multicore only)

Once the SHARC-FX session is halted at main(), launch Debug with GDB and OpenOCD (ARM) as a second session.

Remote debugging

To debug hardware connected to a remote machine, start a GDB server on the remote host and connect to it over the network from your local CFS environment. On the remote machine (J-Link example):
# macOS / Linux
./JLinkGDBServerCLExe -device MAX32690 -if SWD -nolocalhostonly -port 2331
Then configure .vscode/launch.json on the local machine:
{
  "servertype": "external",
  "gdbTarget": "192.168.1.50:2331"
}
Use a firewall or VPN to restrict GDB server port access to trusted hosts. Remote debug access allows intrusive control of the target, including reading and writing memory.

Troubleshooting

If CFS cannot locate an SVD file in the CMSIS Pack directory, it displays an error notification with a Browse button. Use it to navigate to the .svd file for your device, or manually set the svdFile path in .vscode/launch.json.
The VS Code Serial Monitor sends a Break signal before opening the port, which resets Arm CMSIS-DAP targets. Connect to the serial port before launching the debug session, or switch to Tera Term, Minicom, or PuTTY.
If OpenOCD exits immediately for SHARC-FX, the ICE emulator model in .vscode/settings.json may not match the connected hardware. Update cfs.openocd.interface to the correct model (ice1000.cfg, ice1500.cfg, or ice2000.cfg) and adjust adapter speed if using ICE-1000 or ICE-1500.
Add your user to the dialout group and log out/log in again:
sudo usermod -aG dialout <username>

Build docs developers (and LLMs) love