You really are an inspiration bro! Found you through your KiCad course, your videos really help me alot. I want to dive deeper into STM32 boards. Wish you the best for 2023
Thank you for this very nice video! Your video provided the hints I was looking for. I've got a working "hello blinky LED" program now. One note in case of my board, I had to press the RESET button on the board before ST link application would recognize the target.
1:31: This caused me a couple of hours frustration; that you can't power MCUs from pin 1 on a [real] ST-LINK/V2. The part where you said "It's just a reference voltage" was something I wish had been made clearer in the docs. I then realised I had to use pin 19 (non-ISOL device only) to power my board at 3.3 V. The confusing part is that pin 1 needs to also be connected, as well as pin 19.
Thank you! You can essentially set the clock frequency to your liking, I just usually set the frequency to the chip’s maximum frequency to get the greatest performance out of it. For the STM32F405RGT6 the max. frequency is 168MHz (as also shown in CubeIDE), but will of course vary for each chip (e.g. some H7’s can go up to 480MHz).
Thanks Phil, great pacing and very useful to help me get started with STM and ST-Link, coming from other embedded tools like TI/CCS, Arduino,VS-Code/ESP32 etc.
Hi Phil, really good job for doing these videos, they are concise and well made! I enjoy the content and apreciate your effort! Do you consider making a video about the prototyping phase - breadboard and/or simulation?
Hi Phil, is it possible to connect to a board using the STM32 debugger and pull the software off or atleast see the software on the chip? as i have been sent a board by a customer who has had an issue with there and it's suspected the chip has lost its data but is unsure.
I have a custom Chinese board which has an Stm32f105RC. The designer has decided to put 4 SWD pins on it. I want to program it using a Chinese clone St-link v2. But Cube can't find the mcu even tho it's power led is on. I guess I am connecting things wrong. My question is, how come swd needs 4 pins(on the board) but the stm32 socket on my debugger has 10 pins?
Can you help me out with something? When I use ST-Link I can connect to my board however when I try to debug with STM32CubeIDE I get an error ST-Link not found.
Hi Phil, i hope you are doing well .is it possible to read hex from Stm32 and write in to new Stm32 with St-link v2 .i just want to understand can we copy this Hex and write in to blank stm32 .my one board damage and want to copy that hex file in to new fresh stm32 .
Great channel. I've learned a lot from your videos. I have a v2 debugger (cheap clone). I have no problems connecting to my stm32 with it. I decided to upgrade to a genuine v3. I got the mini. I was interested in the SWV and virtual comm port (starting to regret this purchase). The V3 looks healthy and took a firmware upgrade but my target refuses to connect. Because it came only with a 1.27 cable, I'm using a jtag adapter to connect to the 2.54 pins on the target. Problem is the the ground detect pin is not accessible - so I just used ground - and am wondering if this is my problem. My other connections are SWDIO, SWCLK, and SWV (not required). I am powering the target through the separate usb. Anyway, I noticed in the comments that you're using v2 but am hoping that one of your followers might have some insight. Thanks for making these videos. Plan b is to butcher the cable but I really don't want to do that.
I bought a V3SET original from its website during free-shipping times. They have UART, SPI connectors but no regular ARM10 so i need adapter as well. Kinda shocked these options on board (and missing cover on bottom which i 3D printed). I haven't tested it but they have jumpers described in manuals (UM2448). If everything fails there's probably a broken link on cable.
Quick question, do you need that device in order to program an STM32? I'm using an STM32 along with a Bluetooth module to make my Bluetooth headphones, but I was planning on using UART and not SWD.
You don't need the ST-Link to program (all?) STM32s. By pulling the BOOT0 pin high, you can usually flash the device via UART, USB (if available), etc.
Hello Phil, how are you doing? Are you only able to debug and read the code in the stm if you are the creator of the code? or can anyone review and edit as long as they have physical access to the chip board? Thank you in advance!
Great videos well done Phils. I’m currently having some issues with STM32H7 chip on a board I designed, and I don’t seem to find resources on how to program the chip directly with STLink/V2 programmer via SWD. Can you suggest me any help? as I haven’t been able to downloaded any code to the chip. Thanks
Hi Phil, just another question about the power inputs. I see you have many voltage sources(More than 2 usb and that lipo source) but my question is, can you plug in all the sources at once? Also if you were to plug in 2 usb, how would 2 5v inputs safely work? What if i wanted to monitor battery while i plug usb to monitor via serial port?
Hi Darren, the power inputs are essentially 'OR'-ed with diodes, so it's safe to plug in multiple power sources at the same time, as only one will be active at any time.
@phil, great work. Love your channel. Could you make a video on debugging using jtag using your st link connector and a demo on writing and reading from the microcontroller registers using the jtag tap pins? The reason is I ask this is because this a common use-case in the industry and a lot of entry level engineers will benefit from knowing this.
Thank you very much! I'm afraid I don't really use JTAG for these projects and have only been using SWD so far, so probably am not experienced enough to make a video on that :/
Hi phil thanks for the video . I have a doubt regarding SWD, st link utility is not detecting my custom made ST32f429 board , its showing target cannot be connected. Please help me on this.
thank you for this verry useful share!..i have a question please...won't you use a RTOS (FreeRTOS for example) when implementing the real code hundling all destinated board functionalities? thank you!
Hello Phil! I have a question about powering the board, i have been using Bluepill board for a while now, and i never had to plug in the USB cable to power it, SW was always sufficient and it also powered my sensors, my question to you is why do you have to plug USB for power?
Hi Mohammed! Typically the ST-Link does not (and shouldn't) provide power to the board but rather sense the working voltage of the target board. Therefore, for custom designs you should always provide external power.
Hallo Phili! Thanks for your great video! Could you please tell me whether this board was delivered by JLCPCB with all of the electriconic components already being soldered? Thank you!
HI Phil, tell me is there any way to debug a 256MU806 (dsPIC33EP) by using the ST-link V2? or which device and software would give me access to the 256MU806...Much appreciate the help, thank you for your content it has helped to understand.
Hi Takumi, I'm afraid I don't think you'll be able to use the ST-Link to debug anything other than ST microcontrollers. PIC-specific debuggers are here: www.microchip.com/DevelopmentTools/Listing/a063fb83-a427-45b7-afa0-71cc9e8f8c44 Maybe the Black Magic Probe (github.com/blacksphere/blackmagic/wikigithub.com/blacksphere/blackmagic/wiki) will let you debug PICs with some tweaking?
@@PhilsLab howsit gent thank you for replying, i spent a few night researching on Mplab debugging programmer the Pickit 4 this device will work with MPLAB X IDE. the pickit3 and below are limited to the microchip on the market, again thank you and thank you for amazing content.
Thanks, this is just what I needed. Just to be clear, is this the method for programming a freshly soldered vanilla STM32 chip ie. not one that has had a bootloader previously flashed?
All STM32 chips come with a bootloader already flashed. Some STM32s however only support certain ways of flashing firmware (e.g. USB, UART, etc.) - but all will of course do SWD.
@@jobaptist I've developed multi core graphics code with threaded debuggers in kernel mode. But for such simple projects, Arduino ide is desirable because I don't have to bother with re-porting libraries or figuring out bit twiddling to enable interrupts, or timers and clocks. I do wish Arduino ide had a debugger, but the trade off is fine for me because, overall, it takes less time to get my Arduino project finished.
I would argue that STM32CubeProgrammer is more current tool than st-link utility for flashing and other development/hacking activities. In fact, it is the only way for those who are not using Windows.
I believe you can use the Arduino IDE, there is this plugin (?) called: STM32Duino (github.com/stm32duino) that'll let you program the devices via the IDE if you wish.
Thanks Phil! I'm just getting into STM32 and custom board design and your videos have been really helpful.
You really are an inspiration bro! Found you through your KiCad course, your videos really help me alot. I want to dive deeper into STM32 boards. Wish you the best for 2023
The Eclipse IDE has come a long way. Thanks Phil, awesome stuff!
Thank you! Yeah, I’m pretty happy ST took over TrueStudio and merged all the CubeMX stuff into their IDE.
Thanks Phil! I didn’t realize I needed swo pin to print. Saved me a lot of struggle!
Spot on information for a newbie to the STM32 tools. Many thanks Phil!
Awesome, thank you for watching!
This is exactly what I needed. Thanks!
I enjoy watching your videos after a long working day.
Thanks, Adam!
Thanks a lot! 5:42 is very important. I originally thought my debugger is broken.
Yes indeed, very clear and useful. The debugger is complex with a steep learning curve. This helps.
Great video, clear explanation with simple software and hardware example! Thank you for sharing the knowledge!
Thank you very much!
Realy cool.. realy clearly good voice .. is not to fast yor trutoreal everything is good to understand.. you are a very good teacher
Thank you very much, John!
Thank you for this very nice video! Your video provided the hints I was looking for. I've got a working "hello blinky LED" program now.
One note in case of my board, I had to press the RESET button on the board before ST link application would recognize the target.
the best stm32 tutorials on youtube
Thank you, Brendan!
1:31: This caused me a couple of hours frustration; that you can't power MCUs from pin 1 on a [real] ST-LINK/V2. The part where you said "It's just a reference voltage" was something I wish had been made clearer in the docs. I then realised I had to use pin 19 (non-ISOL device only) to power my board at 3.3 V. The confusing part is that pin 1 needs to also be connected, as well as pin 19.
You make some of the best videos!
You have yourself another subscriber!
Thank you, Saad!
very clear explanation like ever.
I just dont understand why you have to set 168mhz. But sounds like is something to have in mind
Thank you! You can essentially set the clock frequency to your liking, I just usually set the frequency to the chip’s maximum frequency to get the greatest performance out of it. For the STM32F405RGT6 the max. frequency is 168MHz (as also shown in CubeIDE), but will of course vary for each chip (e.g. some H7’s can go up to 480MHz).
Thanks Phil, great pacing and very useful to help me get started with STM and ST-Link, coming from other embedded tools like TI/CCS, Arduino,VS-Code/ESP32 etc.
Thank you very much, Richard!
You explain so well, congrats, and continue the good work.
Thank you, Fabio.
Hi Phil, really good job for doing these videos, they are concise and well made! I enjoy the content and apreciate your effort! Do you consider making a video about the prototyping phase - breadboard and/or simulation?
Thank you very much! I was planning on making a video (or series) on going from initial idea through to final product. Now just need an idea haha!
@@PhilsLab Well, I might have a good idea for you.
Hello! Could You describe the model/producer (maybe part number) of white connectors? Thanks a lot!
@5:45 why you choose Serial Wire instead of JTAG4/5 !? and what is the difference between them!?
SWD typically only requires 2 signal pins and works perfectly fine for these applications.
St- link V2 will it work for STM32H7 series as debugger?
Hi Phil, is it possible to connect to a board using the STM32 debugger and pull the software off or atleast see the software on the chip? as i have been sent a board by a customer who has had an issue with there and it's suspected the chip has lost its data but is unsure.
I have a custom Chinese board which has an Stm32f105RC. The designer has decided to put 4 SWD pins on it. I want to program it using a Chinese clone St-link v2. But Cube can't find the mcu even tho it's power led is on. I guess I am connecting things wrong.
My question is, how come swd needs 4 pins(on the board) but the stm32 socket on my debugger has 10 pins?
Can you help me out with something? When I use ST-Link I can connect to my board however when I try to debug with STM32CubeIDE I get an error ST-Link not found.
Good video!! At last something without arduino stuff ;) thanks for sharing!
Thank you! Haha yeah, breaking away from Arduino stuff opened up a whole new world.
Hi Phil, i hope you are doing well .is it possible to read hex from Stm32 and write in to new Stm32 with St-link v2 .i just want to understand can we copy this Hex and write in to blank stm32 .my one board damage and want to copy that hex file in to new fresh stm32 .
Great channel. I've learned a lot from your videos. I have a v2 debugger (cheap clone). I have no problems connecting to my stm32 with it. I decided to upgrade to a genuine v3. I got the mini. I was interested in the SWV and virtual comm port (starting to regret this purchase). The V3 looks healthy and took a firmware upgrade but my target refuses to connect. Because it came only with a 1.27 cable, I'm using a jtag adapter to connect to the 2.54 pins on the target. Problem is the the ground detect pin is not accessible - so I just used ground - and am wondering if this is my problem. My other connections are SWDIO, SWCLK, and SWV (not required). I am powering the target through the separate usb. Anyway, I noticed in the comments that you're using v2 but am hoping that one of your followers might have some insight. Thanks for making these videos. Plan b is to butcher the cable but I really don't want to do that.
I bought a V3SET original from its website during free-shipping times. They have UART, SPI connectors but no regular ARM10 so i need adapter as well. Kinda shocked these options on board (and missing cover on bottom which i 3D printed). I haven't tested it but they have jumpers described in manuals (UM2448). If everything fails there's probably a broken link on cable.
this was really helpful! Thanks a lot! Hoping you have a related playlist :)))
Thank you, glad to hear that! Yes, I have a few vids on STM32 hardware design and programming :)
Quick question, do you need that device in order to program an STM32? I'm using an STM32 along with a Bluetooth module to make my Bluetooth headphones, but I was planning on using UART and not SWD.
You don't need the ST-Link to program (all?) STM32s. By pulling the BOOT0 pin high, you can usually flash the device via UART, USB (if available), etc.
Phil S Gotcha makes sense, thanks for the help.
Hello sir,
big fan!!
Please make video on designing a ST-Link with custom software which can be incorporated in one of projects.
Can swd do boundary scan like jtag?
Hello Phil, how are you doing?
Are you only able to debug and read the code in the stm if you are the creator of the code? or can anyone review and edit as long as they have physical access to the chip board?
Thank you in advance!
You save me a lot of time thanks
Glad to hear that, thanks!
Great videos well done Phils. I’m currently having some issues with STM32H7 chip on a board I designed, and I don’t seem to find resources on how to program the chip directly with STLink/V2 programmer via SWD. Can you suggest me any help? as I haven’t been able to downloaded any code to the chip.
Thanks
Very useful! Thanks and cheers!
Awesome, I'm glad to hear that!
Hi Phil, just another question about the power inputs. I see you have many voltage sources(More than 2 usb and that lipo source) but my question is, can you plug in all the sources at once? Also if you were to plug in 2 usb, how would 2 5v inputs safely work? What if i wanted to monitor battery while i plug usb to monitor via serial port?
Hi Darren, the power inputs are essentially 'OR'-ed with diodes, so it's safe to plug in multiple power sources at the same time, as only one will be active at any time.
Do you have a video where you make this particular pcb?
I have a video showing the basic design steps for this PCB (Flight Control System Design).
very usefull video
Thanks!
Thankyou Phil..
Thank you for watching!
Thank you very much Phil, this will solve my problem,,,
Very glad to hear that!
@phil, great work. Love your channel. Could you make a video on debugging using jtag using your st link connector and a demo on writing and reading from the microcontroller registers using the jtag tap pins? The reason is I ask this is because this a common use-case in the industry and a lot of entry level engineers will benefit from knowing this.
Thank you very much! I'm afraid I don't really use JTAG for these projects and have only been using SWD so far, so probably am not experienced enough to make a video on that :/
Thank you so much! This helped me get going with the MIKROE board, the documentation of MikroSDK and their forum were barely helpful
Glad to hear that, thanks for watching!
Hi phil thanks for the video . I have a doubt regarding SWD, st link utility is not detecting my custom made ST32f429 board , its showing target cannot be connected. Please help me on this.
Hi Sreerag, do you have any schematics I could look at?
thank you for this verry useful share!..i have a question please...won't you use a RTOS (FreeRTOS for example) when implementing the real code hundling all destinated board functionalities?
thank you!
Thank you! Yes, I'm currently using FreeRTOS for this. I hope to make some more videos about that as well.
thanks! i hope that too!... good luck!
Hello Phil!
I have a question about powering the board, i have been using Bluepill board for a while now, and i never had to plug in the USB cable to power it, SW was always sufficient and it also powered my sensors, my question to you is why do you have to plug USB for power?
Hi Mohammed! Typically the ST-Link does not (and shouldn't) provide power to the board but rather sense the working voltage of the target board. Therefore, for custom designs you should always provide external power.
@@PhilsLab Thank you for the answer Phil 😀
how can i change/modify variable's values while code runinng.
A treat !
Thank you!
Hallo Phili! Thanks for your great video! Could you please tell me whether this board was delivered by JLCPCB with all of the electriconic components already being soldered? Thank you!
Hi Sam, This board was actually made by PCBWay - and yeah all components were soldered on when I got them.
Good video! Is there a way to program multiple STM32F303 parts on a board using a multi-drop SWD or other interface?
Thanks! I'm not sure if that's possible via SWD. It should be possible via JTAG I think but not entirely sure of that either!
What Gps chip are you using? Is it available in on-offs?
HI Phil, tell me is there any way to debug a 256MU806 (dsPIC33EP) by using the ST-link V2? or which device and software would give me access to the 256MU806...Much appreciate the help, thank you for your content it has helped to understand.
Hi Takumi, I'm afraid I don't think you'll be able to use the ST-Link to debug anything other than ST microcontrollers. PIC-specific debuggers are here: www.microchip.com/DevelopmentTools/Listing/a063fb83-a427-45b7-afa0-71cc9e8f8c44
Maybe the Black Magic Probe (github.com/blacksphere/blackmagic/wikigithub.com/blacksphere/blackmagic/wiki) will let you debug PICs with some tweaking?
@@PhilsLab howsit gent thank you for replying, i spent a few night researching on Mplab debugging programmer the Pickit 4 this device will work with MPLAB X IDE. the pickit3 and below are limited to the microchip on the market, again thank you and thank you for amazing content.
Thanks, this is just what I needed. Just to be clear, is this the method for programming a freshly soldered vanilla STM32 chip ie. not one that has had a bootloader previously flashed?
All STM32 chips come with a bootloader already flashed. Some STM32s however only support certain ways of flashing firmware (e.g. USB, UART, etc.) - but all will of course do SWD.
@@PhilsLab Thanks Phil.
Hi Phil, Can this ST-Link also be used for STM 8 bit controllers? or is it specific to STM32 controllers?
Hi, I believe so - but never tried myself.
Going from the Arduino IDE to a fully-featured, debug-enabled IDE, is like switching from a kids bike to a sport's car
Exactly! It's incredibly hard to ever go back to such a basic environment after you've been exposed to something as cool as a debug-enabled IDE.
But do you lose all the Arduino libraries? ( I'd hate to port all the lcd display code.)
Thats why i watch these videos. I dont like Arduino IDE
arduino is shit
@@jobaptist I've developed multi core graphics code with threaded debuggers in kernel mode. But for such simple projects, Arduino ide is desirable because I don't have to bother with re-porting libraries or figuring out bit twiddling to enable interrupts, or timers and clocks. I do wish Arduino ide had a debugger, but the trade off is fine for me because, overall, it takes less time to get my Arduino project finished.
Hello. Do you suggest to but st-link V2 or V3?
I've still got the 'old' V2 and it's sufficient for pretty much all devices I work on.
Thank you!
My pleasure!
hi, whats the name of your board and what is that for ?
This is an early version of my flight control board. There is another video on my channel going into a bit more detail.
perfect
Why do people use smt32s? Aren't ESP better for 90% of cases?
I would argue that STM32CubeProgrammer is more current tool than st-link utility for flashing and other development/hacking activities. In fact, it is the only way for those who are not using Windows.
Yes, I’d agree with that as well. I pretty much exclusively use SWD + CubeIDE, so the other programs are just for quick checks (for me).
can you use an arduino ide?
I believe you can use the Arduino IDE, there is this plugin (?) called: STM32Duino (github.com/stm32duino) that'll let you program the devices via the IDE if you wish.
thanx
I got it.
cool xt30 socket
Don't you need an antenna!? 😦
There's a GPS antenna connector (SMA) on the board. Wasn't using GPS for this video so didn't attach it.
@@PhilsLab I thought it was a transmitter connector that you forgot to attenuate. You definitely know what you are doing! Great videos, thanks a lot!
You forgot to close gp1 gp2 on board
🍮🍮🍮🍮🍮🍮🍯🍯🍯🍯🥤🥤🥤🥤🧁🧁🧁
How do i setup a ground control station for this??
Super helpful!