2023-07-18 12:16 AM - last edited on 2023-07-18 01:59 AM by Amel NASRI
I recently started working the STM32 project on VS Code.
I could apparently compile it with no problem.
However, I have a very hard time trying to make the debugging work.
Error looks like this:
Normally there should be a place to configure the debug mode (JTAG/SWD), and the interface (STLINK, JLINK) etc. But I could not find any of them.
Anyone who could give me some tutorials about how to make the debugging to work, please?
Thanks very much!
2023-08-29 06:25 AM
I had the same issue as you. For some reason none of the path environment variables for the STM32CubeCLT seem to resolve. Hence as workaround, I replaced these with absolute links and this enabled me to run and debug.
I am using a macOS but if you convert to the windows paths for the respective STM32CubeCLT files it should hopefully work for you.
This is what I changed:
1) "miDebuggerPath": "/opt/ST/STM32CubeCLT/GNU-tools-for-STM32/bin/arm-none-eabi-gdb",
2) "debugServerPath": "/opt/ST/STM32CubeCLT/STLink-gdb-server/bin/ST-LINK_gdbserver",
3) "debugServerArgs": "--stm32cubeprogrammer-path /opt/ST/STM32CubeCLT/STM32CubeProgrammer/bin/ --swd --port-number 3333",
4) "svdPath": "/opt/ST/STM32CubeCLT/STMicroelectronics_CMSIS_SVD/STM32F0x0.svd"
2023-08-30 02:06 AM
Hi,
For some reason, when I installed STM32CubeIDE, I could debug it.
It seems like the debugger set paths are referenced to some internal path of CubeIDE.
I thought I could avoid downloading and installing the IDE, but I was wrong.
However, as long as I don't have to open it and use it, it is fine with me.
Thank you for sharing your solution though!
2024-05-15 05:58 PM
Hi Weji,
Please watch my 2 tutorials (link below) which should hopefully help you out. They are targeted towards macOS but VS code debugger setup is very similar on windows:
VS Code STM32 macOS - CMake Project (STM32 VS Code Extension):
VS Code STM32 macOS - Makefile Project
If you still having problems after watching then let me know and ill try to assist further,
Jesse
2024-05-16 08:43 AM
check that your CubeCLT path is correct in the settings