2026-01-13 5:54 PM
How can I attach to a running STM32 target while using its specific JTAG address?
I want to debug on an already-running STM32 without altering its memory state (no reset, no download of new firmware). I currently do this on STM32CubeIDE by setting my debug configuration to "No reset" in the "Debugger" tab and setting "Download" to "false" in the "Startup" tab.
The target STM32 is in a JTAG chain with other devices.
On the VSCode extension: If I select "attach" in "request" the "serverJtagCfg" option becomes invalid. Not entirely sure where to look for this. Any help is appreciated.
Thanks
Solved! Go to Solution.
2026-01-14 12:25 AM
Hi @Visques,
There is a difference between "hot attach" and "request attach.":
Hot attach: The GDB server is launched by the adapter (i.e., at the start of the debug session) with no reset and no download. You need to load the symbols at least to debug, using the attribute "imagesAndSymbols" -> "symbolFileName".
This is the use case you described.
Request attach: The GDB server is already running, and you connect to it either remotely or locally.
That’s why only a few server attributes are available in the debug configuration, because the adapter does not manage the server launch.
So, for your use case, it is the hot attach. You can set the serverJtagCfg attribute using the request launch:
{
"type": "jlinkgdbtarget",
"request": "launch",
"name": "STM32Cube: STM32 Launch JLink GDB Server",
"origin": "snippet",
"cwd": "${workspaceFolder}",
"preBuild": "${command:st-stm32-ide-debug-launch.build}",
"runEntry": "main",
"serverReset": "None",
"serverInterface": "JTAG",
"serverJtagCfg": "9,2",
"imagesAndSymbols": [
{
"symbolFileName": "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}"
}
]
}
Note: I just saw that you already asked this question in our previous thread, my bad, I missed the notification.
KR,
Flo
2026-01-14 12:25 AM
Hi @Visques,
There is a difference between "hot attach" and "request attach.":
Hot attach: The GDB server is launched by the adapter (i.e., at the start of the debug session) with no reset and no download. You need to load the symbols at least to debug, using the attribute "imagesAndSymbols" -> "symbolFileName".
This is the use case you described.
Request attach: The GDB server is already running, and you connect to it either remotely or locally.
That’s why only a few server attributes are available in the debug configuration, because the adapter does not manage the server launch.
So, for your use case, it is the hot attach. You can set the serverJtagCfg attribute using the request launch:
{
"type": "jlinkgdbtarget",
"request": "launch",
"name": "STM32Cube: STM32 Launch JLink GDB Server",
"origin": "snippet",
"cwd": "${workspaceFolder}",
"preBuild": "${command:st-stm32-ide-debug-launch.build}",
"runEntry": "main",
"serverReset": "None",
"serverInterface": "JTAG",
"serverJtagCfg": "9,2",
"imagesAndSymbols": [
{
"symbolFileName": "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}"
}
]
}
Note: I just saw that you already asked this question in our previous thread, my bad, I missed the notification.
KR,
Flo
2026-01-14 9:14 AM
Thanks for the quick and detailed response @Florent V . Just to confirm: it is this line the one that prevents reset and download?
"serverReset": "None",
2026-01-15 12:12 AM
This line prevents only the reset.
"serverReset": "None",
Concerning the download it is :
"imagesAndSymbols": [
{
"symbolFileName": "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}"
}
]ImagesAndSymbols is an array of object.
Each object corresponds to a binary. In each object, you can:
Note:
When using ST-Link or J-Link adapters, you can define only imageFileName; it will automatically load the symbols as well, minimizing redundancy in the debug configuration for users. However, if you set only symbolsFileName, the download will not be performed.
Regards,
Flo
2026-01-15 12:43 PM
Excellent, thanks so much @Florent V