write_hex
Programs a microcontroller with firmware from an Intel HEX file. Optionally erases the chip first and verifies the written memory.
Instructions
Write an Intel HEX file to the target device.
hexfile: absolute path to the .hex file on disk. erase_first: if True, performs a chip erase before writing. Default: False. verify_after: if True, reads back and verifies all written memory. Default: True. Returns 'OK' on success, raises an error if programming or verification fails. For the common case of a full firmware update, prefer the flash tool instead.
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": {
"hexfile": "<hexfile>"
},
"name": "write_hex"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hexfile | Yes | ||
| erase_first | No | ||
| verify_after | No | ||
| device | No | ||
| tool | No | ||
| serialnumber | No | ||
| serialport | No | ||
| baudrate | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |