analyze_stack
Reports stack used and free bytes for a halted STM32 core, then checks a given size or limit to deliver a clear overflow verdict. Use it to diagnose stack overflows during firmware debugging.
Instructions
Reports stack used/free bytes and a clear overflow verdict for the halted core. stack_top defaults to the initial MSP (first word of the vector table at vector_table_addr). Give stack_size or stack_limit for the overflow check (else only usage is reported). The key tool for diagnosing stack overflows.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "analyze_stack"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | No | Optional debug-session name. Omit for the default target. | |
| stack_top | No | Top-of-stack address (hex). Default: initial MSP from the vector table. | |
| stack_size | No | Stack size in bytes (used as stack_top - stack_size if stack_limit omitted). | |
| stack_limit | No | Lowest valid stack address (hex). | |
| vector_table_addr | No | Vector table base for the initial MSP (default '0x08000000'). |