debug_mem
Read or write RAM and registers through an active debug session, with symbol-based access for structs. Works while the core is running, so you can inspect or patch live target memory.
Instructions
Read or write RAM/registers through the debug session.
Works while the core is running (real-time) as well as halted — unlike stm32_read_memory this does not launch a second OpenOCD.
Args: session_id: Session ID from debug_session_start. action: "read" (default) or "write". address: Hex address like "0x20000304". Mutually exclusive with symbol. symbol: Variable name resolved from the session ELF. Structs (size > 4 bytes) are auto-expanded into per-field reads. value: Value to write (hex "0xFF" or decimal) — write only. width: Access width — 8, 16, or 32 bits (auto from symbol size). count: Number of units to read (read only).
Returns: Memory contents as hex values, or write confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| value | No | ||
| width | No | ||
| action | No | read | |
| symbol | No | ||
| address | No | ||
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |