-
Notifications
You must be signed in to change notification settings - Fork 262
Description
Is your feature request related to a problem? Please describe.
The default cortex-debug configuration doesn't seem to be able to launch a program on STM32N657.
This is a new STM32 which doesn't have internal FLASH, but instead either boot from external flash, or from RAM directly when in debug mode (this can be configured using BOOT0 and BOOT1 pins).
I'm sharing here the required launch.json to be able to launch a program using ST-Link (thanks for the ability to override commands !):
{
"cwd": "${workspaceFolder}",
"executable": "${command:cmake.launchTargetPath}",
"name": "Debug STM32N657 with ST-Link",
"request": "launch",
"type": "cortex-debug",
"servertype": "stlink",
"runToEntryPoint": "main",
"svdPath": "STM32N657.svd",
"serverArgs": [
"-m",
"1"
],
"overrideLaunchCommands": [
"-target-download",
"-interpreter-exec console \"monitor halt\""
]
},
The important parts are:
-m 1ST-Link arguments, ST-Link won't attach without that argument.overrideLaunchCommandsoverride the default commands to avoid a reset after loading. A reset will make the just-loaded binary in RAM lost.
Describe the solution you'd like
I'm not sure how this special case can be handled as I guess the reset is otherwise necessary on other devices.
But I guess this might at least help other seeking to debug a STM32N6 using VSCode.
Describe alternatives you've considered
I've not tried other gdbservers (like openocd), maybe they can be easier to use in that particular case.