2025-02-10 6:15 PM
I'm having some difficulty getting debugging working in VSCode for the N6 series. Does anyone have a sample one that actually works? I'm obviously using the `stlink` server backend for `cortex-debug`, and I have tried using CubeIDE to get the exact gdb-server arguments used when it launches a debug session. However even when I do that, I still end up with a corrupted stack pointer or missing sources? The symptom is that the debug session says something to the effect of "??@<hex> Unknown Source". It also seems to have problems halting the core at startup.
Here's something representative of the config I'm using right now:
{
"version": "0.2.0",
"configurations": [
{
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/FSBL/build/<my_project_name>.elf",
"name": "Debug with ST-Link",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"showDevDebugOutput": "none",
"servertype": "stlink",
"serverArgs": [
"-l", "1", "-s", "-m", "1", "-k",
],
},
]
}
I've tried using a lot more arguments spelling out all the possible source locations, post-launch commands, etc, but so far it's been to no avail. Any help is appreciated!
2025-02-11 6:40 AM
Hello @JNT,
This issue is spotted and under investigation for STM32N6 product, the launch.json file is created with default STLink configuration (Not specific to N6), so not able to start a debug session (Internal ticket number: 197953), I will keep you updated!
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-02-27 1:51 PM
@JNT were you able to resolve this issue? I am struggling with the same issue currently, I cannot debug a program using the VSCode plugin.
Additionally, there seems to be no way to debug a non-secure application in STM32CubeIDE, have you encountered that issue as well?
2025-03-09 9:47 PM
I haven't tried debugging a non-secure application yet, and I still haven't solved the debugging in VSCode problem unfortunately. Hoping ST sorts this out so that we can actually get some real work in on this platform. At the moment there are a lot of rough edges (RIF is another bane of my existence right now).