stm32_flash
Flashes firmware files to an STM32 board over ST-Link/SWD using OpenOCD, with optional reset and verification after programming.
Instructions
Flash firmware to STM32 board via ST-Link.
Writes the specified .elf (or .bin/.hex) file to the connected STM32's flash memory using OpenOCD over SWD.
Args: elf_path: Absolute path to the firmware file (.elf, .bin, or .hex). reset: If true, hard-reset the board after flashing. verify: If true, verify flash contents match the file. probe: Board nickname, probe nickname, or ST-Link SN to target a specific board.
Returns: Flash result — ST-LINK info, download status, verify result.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"elf_path": "<elf_path>"
},
"name": "stm32_flash"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| probe | No | ||
| reset | No | ||
| verify | No | ||
| elf_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |