← Back to Documentation

Custom Target MCUs

Add support for your own target MCUs and custom OpenOCD paths without recompiling ProbeCodex.

Why Custom Targets?

Overview

ProbeCodex ships with built-in configurations for common MCU families (STM32, Nuvoton, NXP, etc.). When you need to debug a target that isn't built-in, you can add it via a JSON config file.

Probes vs Targets

Custom Probes

Configured in custom-probes.json. Describes the USB debug adapter (J-Link, ST-Link, etc.) - the device plugged into your computer.

See Custom Probes docs →

Custom Targets

Configured in custom-targets.json. Describes the MCU on your board - the chip being debugged. Maps to OpenOCD target config files.

Create the Config File

Create a file at ~/.probecodex/custom-targets.json

macOS / Linux

~/.probecodex/custom-targets.json

Windows

%USERPROFILE%\.probecodex\custom-targets.json

Example Path

/Users/you/.probecodex/custom-targets.json

Quick Setup Commands

# macOS / Linux
mkdir -p ~/.probecodex
nano ~/.probecodex/custom-targets.json
# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.probecodex"
notepad "$env:USERPROFILE\.probecodex\custom-targets.json"

Alternatively, use the target_add_custom MCP tool to add targets programmatically from within Claude Code.

Config File Format

{
  "customTargets": [
    {
      "id": "my_custom_mcu",
      "target": "stm32f4x",
      "flashBase": "0x08000000",
      "notes": "My custom board with STM32F407"
    },
    {
      "id": "m480_custom",
      "target": "numicroM4",
      "flashBase": "0x00000000",
      "openocd": "/opt/custom-openocd/bin/openocd",
      "notes": "Nuvoton M480 with custom OpenOCD path"
    }
  ],
  "customOpenOcd": {
    "nuvoton": "/my/custom/path/to/nuvoton-openocd",
    "standard": "/my/custom/path/to/openocd"
  }
}

Target Fields

FieldRequiredDescription
idYesUnique lookup key. Matched case-insensitively with partial matching (e.g., "m483" matches "m483sidae")
targetYesOpenOCD target config file name (e.g., stm32f4x, numicroM4, cortex_m)
flashBaseOptionalFlash base address as hex string (e.g., 0x08000000). Defaults to 0x00000000
openocdOptionalPath to a specific OpenOCD binary for this target (e.g., a Nuvoton OpenOCD fork)
notesOptionalHuman-readable description

customOpenOcd Section

Global OpenOCD path overrides by variant. Use this when your OpenOCD installations are at non-standard paths.

FieldDescription
nuvotonPath to Nuvoton OpenOCD binary (used for Nu-Link probes and Nuvoton targets)
standardPath to standard OpenOCD binary (used for all other targets)

Examples

New MCU Family

Adding a target for a custom board with an unsupported MCU:

{
  "customTargets": [
    {
      "id": "my_board_v2",
      "target": "stm32h7x",
      "flashBase": "0x08000000",
      "notes": "Custom H7 board with dual-bank flash"
    }
  ]
}

Nuvoton M480 with Custom OpenOCD

Using a Nuvoton OpenOCD fork installed at a non-standard location:

{
  "customTargets": [
    {
      "id": "m480",
      "target": "numicroM4",
      "flashBase": "0x00000000",
      "openocd": "/opt/nuvoton-openocd/bin/openocd",
      "notes": "Nuvoton M480 - custom OpenOCD build"
    }
  ]
}

Override Built-in Target

Custom targets with the same ID as a built-in target will override it:

{
  "customTargets": [
    {
      "id": "stm32f4",
      "target": "stm32f4x",
      "flashBase": "0x08020000",
      "notes": "STM32F4 with bootloader offset"
    }
  ]
}

Note: This overrides the built-in stm32f4 config, changing the flash base address for all STM32F4 targets.

Global OpenOCD Path Overrides

Set custom OpenOCD paths globally without specifying per-target:

{
  "customTargets": [],
  "customOpenOcd": {
    "nuvoton": "/home/user/nuvoton-tools/OpenOCD/bin/openocd",
    "standard": "/opt/openocd-0.12/bin/openocd"
  }
}

Adding Targets via MCP Tool

You can add custom targets directly from Claude Code using the target_add_custom MCP tool, without manually editing the JSON file.

# Example: Add a custom target via MCP
target_add_custom(
id: "my_board",
target: "stm32f4x",
flash_base: "0x08000000",
notes: "My custom dev board"
)

Built-in Presets

Using a known preset ID auto-fills defaults. On Windows, Nuvoton presets also auto-detect the OpenOCD path.

Preset IDTargetFlash BaseNotes
nuvoton_m483numicroM40x00000000Nuvoton M483 (Cortex-M4F)
nuvoton_m467numicroM40x00000000Nuvoton M467 (Cortex-M4F)
nuvoton_m2354numicro0x00000000Nuvoton M2354 (Cortex-M23)
# Using a preset - auto-fills target, flashBase, and notes
target_add_custom(id: "nuvoton_m483")

Custom OpenOCD Paths

Some targets require specific OpenOCD builds (e.g., Nuvoton chips require the Nuvoton OpenOCD fork). If your OpenOCD is installed at a non-standard location, you can configure the path in two ways:

Per-Target Override

Set the openocd field on a specific target entry. Only that target will use the specified binary.

"openocd": "/opt/my-openocd/bin/openocd"

Global Override

Set paths in the customOpenOcd section. Applies to all targets of that variant (nuvoton or standard).

"customOpenOcd": {
  "nuvoton": "/path/to/nuvoton-openocd"
}

Priority Order

When resolving which OpenOCD binary to use, ProbeCodex checks in this order:

  1. Per-target openocd field
  2. Global customOpenOcd paths (nuvoton/standard)
  3. Platform-specific default paths (e.g., Nuvoton Tools install directory)
  4. System PATH (openocd)

Built-in Target List

ProbeCodex includes built-in configurations for these MCU families. Custom targets with the same ID will override these.

STM32

stm32f0, stm32f1, stm32f2, stm32f3, stm32f4, stm32f7

stm32g0, stm32g4, stm32h7

stm32l0, stm32l1, stm32l4, stm32l5

stm32u5, stm32wb, stm32wl

Flash base: 0x08000000

Nuvoton

m031, m251, m261 (Cortex-M0/M23)

m460, m480 (Cortex-M4)

m2354 (Cortex-M23)

Flash base: 0x00000000 | Requires Nuvoton OpenOCD

NXP

lpc11, lpc17, lpc55, kinetis

Flash base: 0x00000000

Generic

cortex_m, cortex_m0, cortex_m3, cortex_m4, cortex_m7

Use as fallback when specific target isn't available

Troubleshooting

Target not recognized?

  • Verify the target field matches an actual OpenOCD config file name (e.g., stm32f4x, not stm32f4)
  • Check that flashBase is a valid hex string with 0x prefix
  • Validate JSON syntax (no trailing commas, proper quotes)
  • Restart ProbeCodex after saving the config file

Custom OpenOCD path not used?

  • Verify the binary exists at the specified path
  • On Windows, use backslashes in the path (e.g., C:\\Program Files\\...)
  • Check ProbeCodex logs for "[OpenOCDConfig]" messages showing loaded custom paths

Need help?

Contact support via the Portal Support Chat with your target MCU details and we'll help you configure it.

Related