2025-11-15 4:39 AM
Hi,
I'm trying to move towards developing in VSCode to not rely on VMs for the IDE. While code generation via CubeMX and flashing the device works as expected, I'm having issues trying to use the debugger on my STM32H747 DISCO board.
When using the latest (v3.6.4) It kept prompting command not found error.
Downgrading it to v2.1.1 seems to fix the issue and the debugger manages to run. However, it seems to always timed out waiting for the other core (CM4) to enters in stop mode. p.s. I am trying to debug the CM7 at the moment.
Is there something that needs to be done on the STLink server or .ioc file to make the debugger works? Any help will be be much appreciated
2025-11-16 6:45 AM
Hi,
Is it possible to share your debug configuration with us?
For your information, the extension offered by ST had a major update between version 2 and 3. Previously, it used the cortex-debug adapter, but now it provides its own solution. To use it, you need to create a new debug configuration using for example "STM32 Launch ST-Link GDB Server".
Regarding the H7 dual-core project generated by CubeMX, there is indeed a behavior where the CM7 waits for the CM4 to enter sleep mode and then wakes it up.
So, if you want to debug only the CM7, either the CM4 must be flashed, or you need to modify the code to avoid being "waiting" for the CM4.
Here an example of debug configuration for CM7 and CM4 for H7 dual core: https://community.st.com/t5/stm32cubeide-for-visual-studio/missing-the-tasks-json-file-required-for-code-flash/m-p/847397#M1219
Kind Regards,
Flo
2025-11-16 12:27 PM
Hi Flo
Thank you for the reply.
I was indeed using the "Launch ST-Link GDB Server" option and made sure that the server from the extension was running. But sadly to no avail.
To my confusion, apparently I forgot to enable the DEBUG setting in the .ioc file. It is weird that the extension using v2.1.1 manages to run the debugger anyway. However, setting the DEBUG properly did not fix the issue. Both had this on their .ioc setting:
Mcu.IP2=DEBUG
NVIC1.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC2.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
PA13\ (JTMS/SWDIO).GPIOParameters=PinAttribute
PA13\ (JTMS/SWDIO).Mode=Serial_Wire
PA13\ (JTMS/SWDIO).PinAttribute=CortexM7
PA13\ (JTMS/SWDIO).Signal=DEBUG_JTMS-SWDIO
PA14\ (JTCK/SWCLK).GPIOParameters=PinAttribute
PA14\ (JTCK/SWCLK).Mode=Serial_Wire
PA14\ (JTCK/SWCLK).PinAttribute=CortexM7
PA14\ (JTCK/SWCLK).Signal=DEBUG_JTCK-SWCLKFor sanity check I created a new project from scratch again (also with extension v3.6.4) and somehow it works without any hiccup. It seems that something went wrong in the first project build. Tthe only difference I can think of is that I enabled the DEBUG setting in the .ioc file before the first code generation from STMCubeMX. Perhaps something of this could be the cause?
For the first project I can't remember how I trigger the creation but it was automatically created when I go to the Run and Debug tab. Though on the second project aince there were no launch.json file, I had to press on the blue Run and Debug button, select the ST-Link option to invoke the debugging. I also had to manually click the create launch.json link to have the file. I will attach both of these test projects should it help for future investigation. Note that on the second project that is working I saved the CM7 and CM4 settings to easily launch the debugger for each core.