You're quite an expert on this subject. Your videos are an excellent source to learn, but it is a pitty you just produced 3 videos. Hope someday you upload more videos on Embedded stuff. Thanks for sharing you knowledge!
This video is exactly what I was looking for. I'm working on some bare metal stm32 projects and was already using vscode but couldn't get the debugger to work. This is an awesome setup. Thanks.
Ok, that seems strange, usually you just have to restart VSCode. Depending on which terminal you use in VSCode, perhaps there could have been an instance of that open elsewhere? with terminals, it's usually the same, system variables are loaded when they start.
For those who struggle to receive data on serial monitor (ex. Tera Term) you need to configure the serial monitor correctly. As in my case serial monitor was set to 9600 Baud rate while stm32cubemx project was configured to 115200
Whenever you do the Debug launch.json part at 9:37, that dosnt pop up or is an option to me. I doenloaded the cortex debugger extension but is there anything else that i am missing?
This is one of the best tutorial, straight to the point, very useful. There is one thing I'm not sure I fully understand, since ad the end we lounch "make" from a cmd to compile and build, why shall I write all the defines, the compiler path, options etc in the c_cpp_properties.json , it seems they will never be used. Thanks
Glad you liked it! The reason to have it in the properties json-file is fore the code completion and checking in VSCode to use the same settings as when you build with make. The code will run just fine without it, but your experience with VSCode will be much better.
Great tutorial! At 11:45 you bring over a new window that doesn't pop up for me. Do you have to install Tera Term in order to see the UART output? I can see the gdb-server in the terminal section in vscode but it only shows halted info not the UART output. Thanks again for the tutorial!
In the video I use a Nucleo-board with a built in ST-Link that also has a USB-serial connected to one of the UARTS. No need for any external debuggers or serial interfaces. On custom bords I tend to use the ST-Link v3 with the STDC-14 connector that also has a builtin USB to serial converter.
@@emgeek thanks , I could use the usart1 too. I remenber that before we had to configurate the port_pin to use alternative function like this: h_gpioC.Pin = GPIO_PIN_6; h_gpioC.Mode = GPIO_MODE_AF_PP; h_gpioC.Speed = GPIO_SPEED_FREQ_MEDIUM; h_gpioC.Alternate = GPIO_AF8_USART6; HAL_GPIO_Init(GPIOC,&h_gpioC); I couldn't find this in the generated code by CubeMX. Do you know where could i find it?
The way I prefer to do it now is using ${default} in c_cpp_properties.json and then setup your defaults in the VSCode settings JSON-file. This makes the project much more portable, specially if you are using it on both Windows and Linux machines.
Like the previous one: very informative! Some questions: if i were to add another .c and .h file in the core directory i need to manually update the makefile. Correct? Also, if i made a change in the CubeMX file and export the files again it will overwrite the make file. Correct?
Yes, you are correct, you need to add them manually. There are a lot of ways making the Makefile more manageable, that may be the scope of another video. I usually have a separate "my_code.mk" that extend on the sources variable and just include that one in the main Makefile. Changing stuff in CubeMX is a bit hit and miss. Usually it works, but sometimes it breaks down. I would recommend to add the stuff you need first with CubeMX and then make your changes.
Next video is already recorded and edited, there I cleaned out some stuff from the makefile. I just have to do the voiceover before I upload it. The next one after that, I'll make sure to split up the makefile a bit.
I have followed the part1 and this video step by step but I have come across 1 problem. At 9:38 you select Debug:Open launch.json. No such option is available for me. I have downloaded Cortex debug extension and went through all the possible Debug commands but this one does not exist. Any clues?
There could have been changes in VSCode or differences in configuration. The easiest workaround would probably be to just create a launch.json in the .vscode folder manually.
when i hit F5 button this message shows in the terminal "The terminal process failed to launch: Path to shell executable "%{My Path}%/gcc" does not exist. " how to fix this ?
thank you for the tutorial. Is it possible to get similar to Keil MDK watch functionality in debug mode? I mean auto update variable that are being watched when they change without halting the program?
@@emgeek me neither and I'm actually trying to convince a colleague to ditch it away, but he brought up the debug functionality of Keil, I was wondering it it's possible to achieve it using open software.
Hi, thanks for the video it worked very well, however I habe one small problem , when I hit F5 it uploads the code and starts the debugging mode but it does not comile the code it allways uploads the last verion of the elf file. It isnt that much of a Problem beacuse I can just use the command line to compile via the make file but I if you have any thoughts on how to fix the issue, please let me know. Thank you.
That's a great idea! I've used docker for building stm32 code with the same tools as in the video, a lot easier setting up make, GCC and git. Running docker with the wsl2 backend under windows makes the performance great as well. The main drawback as I see it is that there's no straight forward way to get USB passthrough working to enable flashing and debugging directly from the container.
@@emgeek I found this one (stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device) but still does not have necessary knowhow to figure it out. hope it help.
Thanks for your very helpful tutorial ! I cannot used make with PowerShell or "command terminal" but only with git tutorial ... Can you help me please ?
Really good video! Personally I have an STM32F407G−DISC1 (devboard) and my host OS is Linux (i3 on Ubuntu22). I was not able to follow along, I got errors in my main.c, also when you did the comand palette seach for "Debug: Open launch.json" I got no such options even though I installed the plugins. If you would have the time in the future to remake this video-series (you can use same STM32F0) for Linux that would be so helpfull.
Can CUBEMX be used to create the Makefile and start up assembly code only? That is no auto generated C code, no clock initialization. Only the bare minimum to start writing C code for an embedded project from scratch. Mostly just interested in having a startup assembly file, a Makefile, and paths generated for files like the system_stm32f4xx.h(defines all the macros for the peripherals) I am using stm32f4 chips for my current project and the Keil IDE for compiling and debugging which is terribly outdated and slow. Just hoping you can point me in the right direction. Maybe doing all of this manually is better, what are your thoughts? My knowledge is still pretty basic on setting up a project from scratch. I have seen some tutorials on writing your own startup.s file and have written some basic Makefiles for C programs I've run in bash, but not for an embedded project. I would be interested in a tutorial for starting from scratch if you're up for it. Thanks in advance!
(DO NOT RESPOND) @@emgeek How does the autogenerated makefile flashing the board? I am only familiar with using st-flash in the linux environment, and I see that you are using openocd. After looking through the stm32 makefile I don't comprehend where there is an equivalent "st-flash write main.bin 0x8000000" command. Is ST leaving it up to us to define the flashing tool? Thanks for the quick response!
I kinda figured it out. I didn't realize at first that you were using openocd to flash. I assume that ST leaves it up to the developer to set a "make flash" parameter or just use the ST-Link Utility or something? I watched each video about 4 times to really understand everything. Setting up the dev environment is still mostly new to me as opposed to using an IDE that does everything for you. I am so excited to use debugging in VSC. Keil makes me want to barf :)
Yes, you are correct, sorry for not getting back to you earlier. The makefile generated by CubeMX does not contain anything to help you flash your binary.
Any idea why I get this message in the VSC output window? [4/13/2021, 10:09:03 PM] Unable to resolve configuration with compilerPath "C:\Dev-ARM\tools\gcc-arm-none-eabi-10-2020-q4-major-win32\bin/arm-none-eabi-gcc.exe". Using "/usr/bin/gcc" instead. I've messed around with the environment variables a bunch and I cannot understand why it's unable to resolve the path. I pretty confident it's an issue with VSC as I have no issue with the arm gcc in the terminal. I've tried giving the c_cpp_properties.json the complete path and nothing seems to work. I don't understand the problem well enough to know where to look.
Thank you for the video. It worked well! However, when I tried to modify CubeMX such as adding or changing pins, etc, "make" command doesn't work anymore. The error message I got was makefile:119. Is there a way to fix it?
Difficult to say without seeing your makefile, but I've had an issue where CubeMX adding a duplicate row for one of the include directories if the project is re-generated. Look in the c includes section if the last row is a duplicate, especially if the second from last row does not have a trailing backslash to indicate that the expression continues on the row below.
@@emgeek Thank you for your advice. I found out that the last row is a duplicate, which was "IDrivers/CMSIS/Include". Not sure why this is duplicated though. Thanks!
Hi! Thanks a lot for the video! I wanted to be able to debug in VSCode and it works now! I only have one problem: After stopping to debug by clicking "Stop" (red square) I cannot reconnect to the Device again until I unplug the ST-Link and plug it in again. It gives the following two error messages in the "Output" tab when it tries to start the OpenOCD server: Error: libusb_open() failed with LIBUSB_ERROR_ACCESS Error: open failed: jtag_libusb_open() returned error -4 Did anyone have the same problem or got any idea to fix it? Thanks in advance!
@@emgeek Yes its on windows. I had a deeper look into the problem during the past few hours and it seems that the Cortex-Debug extension actually does not close the OpenOCD server. It keeps running and connected to the targrt in the background. I can still see it in the Task-Manager and I can even connect to it with putty via telnet. If i kill it manually, I can start the next debug session. I found a related issue from December 2020 in the Cortex-Debug GitHub repository, but the Maintainer has not responded yet.
Hi, very nice and helpful video. I followed all the steps and successfully built the project with the make command. For debugging, when I press ctrl+shift+p to open command toolbar and click on debug:open launch.json I can't find the cortex debug option there. I have installed the extension. I have also tried to restart vscode but still not there. Please help me..!
@@emgeek I did some searching and found a vscode extension called stm32 debug, installed that and now I can flash and debug. Thanks and hope to see more videos in the future.
I did everything as stated in this video and was very pleased. Because I really liked the syntax highlighting, auto-completion and much more. Thank you very much for this video. But my happiness did not last long. At any point in time, the debugger can detach. I tried a short wire, reinstall the driver. But I always end up with an error. just by walking through the code in debug, it stops working. SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed GDB server session ended. I don't know, what i have i done wrong?
I got the same message. I can compile and download the program to the target, but I cant debug. Are you using the same board? (I am using the 32F746GDISCOVERY) Did you find a solution? or You moved to uVision?
@@arlenalem I can debug the program, but at any given time, debugging stops with this message. I have tried different boards. The problem is the same. On Ubuntu, there is no such problem. Unfortunately, I did not find a solution to this problem. i'm searching it..
Are you running this under windows? I do not recognize those issues but from the error message it sounds like there is something in the VSCode debugger that have trouble keeping the connection active to openocd. Make sure nothing is either killing openocd or preventing it to receive connections. The connection between the VSCode GDB client and the GDB server (openocd) is through a local TCP connection that can be prevented by some firewall or antivirus software. And OpenOCD could perhaps trigger som antivirus software to kill it. I guessed you have tried another debugger (I've had great success with the ST-Link v3 and v3 mini) and another USB cable. Also make sure there aren't any strange groud-loops from connecting the debugger to one computer and a USB or USB/Serial connection to another.
@@emgeek yes, i am. in terminal i saw gdbserver.exe -p 50000. Perhaps a problem with the port? I do not know what or who can kill the connection, but I will try to fix it.
I have no specific keybinding for debug. You can also initiate debugging from the menu. Make sure you have the cortex debug extension installed and that the launch.json in the .vscode directory is correct.
There's a pretty common problem with CubeMX generating duplicate include lines in the makefile if you re-generate the code. Could this be the case for you?
It's not very often that you find a tutorial that explains exactly what you're looking for and does it this succinctly!!! THANK YOU! SUBSCRIBED!
Great to hear, thanks!
You're quite an expert on this subject. Your videos are an excellent source to learn, but it is a pitty you just produced 3 videos. Hope someday you upload more videos on Embedded stuff. Thanks for sharing you knowledge!
Fantastic tutorial, thank you very much! Got my Nucleo earlier today, and now I'm all set up thanks to your videos!
Great to hear! Good luck hacking!
This video is exactly what I was looking for. I'm working on some bare metal stm32 projects and was already using vscode but couldn't get the debugger to work. This is an awesome setup. Thanks.
Thanks! Next video will be some bare metal C++ with this setup.
THANK YOU VERY MUCH!!! Great video series.
Thanks for this clear explanation! I just want to note that I had to restart my system in order to have VS Code recognize the make systemvariable.
Ok, that seems strange, usually you just have to restart VSCode. Depending on which terminal you use in VSCode, perhaps there could have been an instance of that open elsewhere? with terminals, it's usually the same, system variables are loaded when they start.
Amazing video! Can't wait to try it!
I was looking for this so long awesome content keep doing the good work 🙏
Glad you liked it
Thanks for your time. Very useful video 👍 part1&2.
Thanks!
thank you for the videos, it was very useful
it would be great to make more such video (especially about stm 32)
Thanks, more are coming! Next one will be about c++ on embedded.
@@emgeek that's very interesting !!!
thanks again
It is the elegant way to code on STM32. Even better than CLion.
I agree!
For those who struggle to receive data on serial monitor (ex. Tera Term) you need to configure the serial monitor correctly. As in my case serial monitor was set to 9600 Baud rate while stm32cubemx project was configured to 115200
Yes, the baudrate is very important, if it's not correct you will only receive gibberish.
Very clean. Great video.
Thanks!
Whenever you do the Debug launch.json part at 9:37, that dosnt pop up or is an option to me. I doenloaded the cortex debugger extension but is there anything else that i am missing?
Thank you very much! This was super useful.
Glad to hear!
This was very helpful. Thank you.
You're welcome!
This is one of the best tutorial, straight to the point, very useful. There is one thing I'm not sure I fully understand, since ad the end we lounch "make" from a cmd to compile and build, why shall I write all the defines, the compiler path, options etc in the c_cpp_properties.json , it seems they will never be used. Thanks
Glad you liked it!
The reason to have it in the properties json-file is fore the code completion and checking in VSCode to use the same settings as when you build with make.
The code will run just fine without it, but your experience with VSCode will be much better.
Love this walkthrough tutorial!
Thanks!
Great tutorial! At 11:45 you bring over a new window that doesn't pop up for me. Do you have to install Tera Term in order to see the UART output? I can see the gdb-server in the terminal section in vscode but it only shows halted info not the UART output. Thanks again for the tutorial!
Do you have any tips or videos on how to get this setup with a C++ project instead of a C project?
Thanks for your videos, they are really helpful.
Do you use an external ST-LINK in order to use the serial-usb port?
In the video I use a Nucleo-board with a built in ST-Link that also has a USB-serial connected to one of the UARTS. No need for any external debuggers or serial interfaces.
On custom bords I tend to use the ST-Link v3 with the STDC-14 connector that also has a builtin USB to serial converter.
@@emgeek thanks , I could use the usart1 too.
I remenber that before we had to configurate the port_pin to use alternative function like this:
h_gpioC.Pin = GPIO_PIN_6;
h_gpioC.Mode = GPIO_MODE_AF_PP;
h_gpioC.Speed = GPIO_SPEED_FREQ_MEDIUM;
h_gpioC.Alternate = GPIO_AF8_USART6;
HAL_GPIO_Init(GPIOC,&h_gpioC);
I couldn't find this in the generated code by CubeMX. Do you know where could i find it?
I found it =),
I am testing and debugging , and waiting if i got any problem
I just found that VS Code extension "Makefile Tools" can help to config the C/C++ IntelliSense Mode for a makefile project.
The way I prefer to do it now is using ${default} in c_cpp_properties.json and then setup your defaults in the VSCode settings JSON-file.
This makes the project much more portable, specially if you are using it on both Windows and Linux machines.
Like the previous one: very informative! Some questions: if i were to add another .c and .h file in the core directory i need to manually update the makefile. Correct? Also, if i made a change in the CubeMX file and export the files again it will overwrite the make file. Correct?
Yes, you are correct, you need to add them manually. There are a lot of ways making the Makefile more manageable, that may be the scope of another video. I usually have a separate "my_code.mk" that extend on the sources variable and just include that one in the main Makefile.
Changing stuff in CubeMX is a bit hit and miss. Usually it works, but sometimes it breaks down. I would recommend to add the stuff you need first with CubeMX and then make your changes.
@@emgeek I was afraid of that. I would love to see a video on how you split up your makefiles...!
Next video is already recorded and edited, there I cleaned out some stuff from the makefile. I just have to do the voiceover before I upload it. The next one after that, I'll make sure to split up the makefile a bit.
This is fantastic! Well done!
Thanks! More is coming...
perfect! Thanks a lot for this.
I have followed the part1 and this video step by step but I have come across 1 problem. At 9:38 you select Debug:Open launch.json. No such option is available for me. I have downloaded Cortex debug extension and went through all the possible Debug commands but this one does not exist. Any clues?
There could have been changes in VSCode or differences in configuration. The easiest workaround would probably be to just create a launch.json in the .vscode folder manually.
when i hit F5 button this message shows in the terminal "The terminal process failed to launch: Path to shell executable "%{My Path}%/gcc" does not exist.
" how to fix this ?
thank you for the tutorial. Is it possible to get similar to Keil MDK watch functionality in debug mode? I mean auto update variable that are being watched when they change without halting the program?
Sorry, but I'm no big fan of the Keil suit of compilers.
@@emgeek me neither and I'm actually trying to convince a colleague to ditch it away, but he brought up the debug functionality of Keil, I was wondering it it's possible to achieve it using open software.
Hi, thanks for the video it worked very well, however I habe one small problem , when I hit F5 it uploads the code and starts the debugging mode but it does not comile the code it allways uploads the last verion of the elf file. It isnt that much of a Problem beacuse I can just use the command line to compile via the make file but I if you have any thoughts on how to fix the issue, please let me know. Thank you.
There's probably a way to get VSCode to build before debugging, but personally I just run make in the command line before hitting F5
Hi, thanks for the video. Would be wonderful if you add docker for this series.
That's a great idea! I've used docker for building stm32 code with the same tools as in the video, a lot easier setting up make, GCC and git.
Running docker with the wsl2 backend under windows makes the performance great as well. The main drawback as I see it is that there's no straight forward way to get USB passthrough working to enable flashing and debugging directly from the container.
@@emgeek I found this one (stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device) but still does not have necessary knowhow to figure it out. hope it help.
Yes, under Linux its most likely doable, however I run docker under windows with the wsl2 backend. And wsl2 does not have support for USB passthrough.
Thanks for your very helpful tutorial !
I cannot used make with PowerShell or "command terminal" but only with git tutorial ... Can you help me please ?
Really good video!
Personally I have an STM32F407G−DISC1 (devboard) and my host OS is Linux (i3 on Ubuntu22).
I was not able to follow along, I got errors in my main.c, also when you did the comand palette seach for "Debug: Open launch.json" I got no such options even though I installed the plugins.
If you would have the time in the future to remake this video-series (you can use same STM32F0) for Linux that would be so helpfull.
Can CUBEMX be used to create the Makefile and start up assembly code only? That is no auto generated C code, no clock initialization. Only the bare minimum to start writing C code for an embedded project from scratch.
Mostly just interested in having a startup assembly file, a Makefile, and paths generated for files like the system_stm32f4xx.h(defines all the macros for the peripherals)
I am using stm32f4 chips for my current project and the Keil IDE for compiling and debugging which is terribly outdated and slow. Just hoping you can point me in the right direction. Maybe doing all of this manually is better, what are your thoughts? My knowledge is still pretty basic on setting up a project from scratch. I have seen some tutorials on writing your own startup.s file and have written some basic Makefiles for C programs I've run in bash, but not for an embedded project. I would be interested in a tutorial for starting from scratch if you're up for it.
Thanks in advance!
I don't think so, but it's quite easy to do yourself, I have a video on that.
(DO NOT RESPOND) @@emgeek How does the autogenerated makefile flashing the board? I am only familiar with using st-flash in the linux environment, and I see that you are using openocd. After looking through the stm32 makefile I don't comprehend where there is an equivalent "st-flash write main.bin 0x8000000" command. Is ST leaving it up to us to define the flashing tool? Thanks for the quick response!
I kinda figured it out. I didn't realize at first that you were using openocd to flash. I assume that ST leaves it up to the developer to set a "make flash" parameter or just use the ST-Link Utility or something? I watched each video about 4 times to really understand everything. Setting up the dev environment is still mostly new to me as opposed to using an IDE that does everything for you.
I am so excited to use debugging in VSC. Keil makes me want to barf :)
Yes, you are correct, sorry for not getting back to you earlier. The makefile generated by CubeMX does not contain anything to help you flash your binary.
Any idea why I get this message in the VSC output window?
[4/13/2021, 10:09:03 PM] Unable to resolve configuration with compilerPath "C:\Dev-ARM\tools\gcc-arm-none-eabi-10-2020-q4-major-win32\bin/arm-none-eabi-gcc.exe". Using "/usr/bin/gcc" instead.
I've messed around with the environment variables a bunch and I cannot understand why it's unable to resolve the path. I pretty confident it's an issue with VSC as I have no issue with the arm gcc in the terminal. I've tried giving the c_cpp_properties.json the complete path and nothing seems to work. I don't understand the problem well enough to know where to look.
Hi. Thank you for the tutorial. Would it be possible to add a similar video concerning Stm8 microcontrollers?
I would be greatful for any suggestions as well ;)
I'm sorry, but I haven't worked with the STM8 line myself.
Hi ! Thank for this very good tutorial ! Do you know how to print a message without UART (print inside the debug console) ?
You probably need to use the Trace/SWO feature for that.
Thank you for the video. It worked well! However, when I tried to modify CubeMX such as adding or changing pins, etc, "make" command doesn't work anymore. The error message I got was makefile:119. Is there a way to fix it?
Difficult to say without seeing your makefile, but I've had an issue where CubeMX adding a duplicate row for one of the include directories if the project is re-generated.
Look in the c includes section if the last row is a duplicate, especially if the second from last row does not have a trailing backslash to indicate that the expression continues on the row below.
@@emgeek Thank you for your advice. I found out that the last row is a duplicate, which was "IDrivers/CMSIS/Include". Not sure why this is duplicated though. Thanks!
Hello,
do you know how to implement the cmsis dsp library into the visual studio?
Should'n be depending on Visual studio, Just add the CMSIS library to the project and makefiler
how to use cmsis way?
Not sure, haven't used CMSIS that much, prefer setting stuff up myself.
Hi! Thanks a lot for the video! I wanted to be able to debug in VSCode and it works now!
I only have one problem: After stopping to debug by clicking "Stop" (red square) I cannot reconnect to the Device again until I unplug the ST-Link and plug it in again. It gives the following two error messages in the "Output" tab when it tries to start the OpenOCD server:
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: open failed: jtag_libusb_open() returned error -4
Did anyone have the same problem or got any idea to fix it? Thanks in advance!
Sounds like OpenOCD does not release the USB- device correctly. Is this on Windows?
@@emgeek Yes its on windows. I had a deeper look into the problem during the past few hours and it seems that the Cortex-Debug extension actually does not close the OpenOCD server. It keeps running and connected to the targrt in the background. I can still see it in the Task-Manager and I can even connect to it with putty via telnet. If i kill it manually, I can start the next debug session. I found a related issue from December 2020 in the Cortex-Debug GitHub repository, but the Maintainer has not responded yet.
I guessed it was something along those lines. Had similar issues running OpenOCD from Eclipse.
I'm afraid I can't help you that much.
Hi, very nice and helpful video. I followed all the steps and successfully built the project with the make command. For debugging, when I press ctrl+shift+p to open command toolbar and click on debug:open launch.json I can't find the cortex debug option there. I have installed the extension. I have also tried to restart vscode but still not there.
Please help me..!
Which STM32 part are you using? I can prepare a launch.json for you
@@emgeek I am using STM32F103RBT6 on nucleo board
@@emgeek I did some searching and found a vscode extension called stm32 debug, installed that and now I can flash and debug. Thanks and hope to see more videos in the future.
I did everything as stated in this video and was very pleased. Because I really liked the syntax highlighting, auto-completion and much more.
Thank you very much for this video.
But my happiness did not last long. At any point in time, the debugger can detach.
I tried a short wire, reinstall the driver. But I always end up with an error. just by walking through the code in debug, it stops working.
SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended.
I don't know, what i have i done wrong?
I got the same message.
I can compile and download the program to the target, but I cant debug.
Are you using the same board? (I am using the 32F746GDISCOVERY)
Did you find a solution? or You moved to uVision?
@@arlenalem I can debug the program, but at any given time, debugging stops with this message.
I have tried different boards. The problem is the same. On Ubuntu, there is no such problem. Unfortunately, I did not find a solution to this problem. i'm searching it..
@@arlenalem i'm using stm32cubeide now, but i want to use vscode =(
Are you running this under windows?
I do not recognize those issues but from the error message it sounds like there is something in the VSCode debugger that have trouble keeping the connection active to openocd. Make sure nothing is either killing openocd or preventing it to receive connections.
The connection between the VSCode GDB client and the GDB server (openocd) is through a local TCP connection that can be prevented by some firewall or antivirus software. And OpenOCD could perhaps trigger som antivirus software to kill it.
I guessed you have tried another debugger (I've had great success with the ST-Link v3 and v3 mini) and another USB cable. Also make sure there aren't any strange groud-loops from connecting the debugger to one computer and a USB or USB/Serial connection to another.
@@emgeek yes, i am.
in terminal i saw
gdbserver.exe -p 50000.
Perhaps a problem with the port?
I do not know what or who can kill the connection, but I will try to fix it.
I can build and flash the file ...but i cant debug!! ... pressing f5 doesnt do anything.. Can you share the keybindings json also
I have no specific keybinding for debug. You can also initiate debugging from the menu.
Make sure you have the cortex debug extension installed and that the launch.json in the .vscode directory is correct.
@@emgeek Hi, thanks for the quick reply.. its working now.. i had some issues with settings json which i configured before. :)
Glad to hear. Happy debugging. 😀
I have this problem. how you can fix it?
I get "missing separator" error while running "make" command.
There's a pretty common problem with CubeMX generating duplicate include lines in the makefile if you re-generate the code. Could this be the case for you?
@@emgeek Yes, it was.
But, how I can just build(to see if I have any errors) or just upload the "sketch" to the board, without debugging?
@@emgeek missed part from last video. Thanks, it works really nice!
@@emgeek Sorry, how to see size in terminal after make/make upload command(like in Arduino)
If you use the makefile generated by CubeMX it will call the arm-none-eabi-size command after compiling. It will show you the flash usage.
Nice i hope you are end this tutorial🌷🌷🌷🌷
I will, at some point. Just got caught up in other projects at the moment.