How To: STM32F103C8T6 As An USB Device ( Virtual Serial Port / CDC )

  Рет қаралды 117,278

Hugatry's HackVlog

Hugatry's HackVlog

Күн бұрын

In this video I share my knowledge on how to create a STM32F103C8T6 project with virtual serial port (STM32 acting as USB device).
You can buy STM32 board using following affiliate links (no extra cost to you, if you use these links):
Banggood:
www.banggood.c...
EBay: rover.ebay.com...
EDIT: If you are running Windows version prior to 10, you may need to install drivers. www.st.com/en/d...
These $2 STM32 development boards have been featured in multiple Hackaday posts past few days and that inspired me to start playing with them. I had previously installed all the development tools, but something went wrong back then and I ended up putting the boards away and kept playing with other development boards.
Now I reinstalled System Workbench for STM32 and STM32CubeMX. Everything worked flawlessly and I had project with virtual serial port (using STM32 as an USB device) running in no time.
TIMELINE
1:07 - Generating the project "skeleton" with STM32CubeMX
4:10 - Making it compile in SystemWorkbench for STM32
5:12 - Demonstrating the serial communication - Receiving data
9:24 - Demonstrating - Receiving and transfering data
Software:
STM32CubeMX: www.st.com/en/d...
SystemWorkbench for Stm32: www.st.com/en/d...
Hardware:
"BluePill" STM32F103C8T6 -development board and ST-Link V2 compatible programmer/debugger. Wires between GND, SWDIO and SWDCLK pins of programmer and dev board. Board was powered through the microUSB -port.
Thanks to Al Williams for sharing his notes on using this board with SystemWorkbench for STM32: hackaday.io/pr...
If you liked the video, please show it and hit the Like-button!
Check out my other videos:
/ hugatry
Subscribe:
www.youtube.co...

Пікірлер: 141
@PaprikaYT
@PaprikaYT 5 жыл бұрын
There is always that dude with the accent that will help you in your hardest times :D Thanks mate
@goodjob822
@goodjob822 4 жыл бұрын
that's so true
@TheChrisey
@TheChrisey 4 жыл бұрын
Lol very strong finnish accent
@frankfrei6848
@frankfrei6848 2 жыл бұрын
Even after 5 years, this is still an awesome tutorial - thank you, helped a lot!
@QRPLabs
@QRPLabs 6 жыл бұрын
Thanks Hugatry, that's a wonderful video! I needed to learn how to do USB and this taught me instantly. It worked right out, with no compile error (I am using Atollic TrueStudio). One subtlety: When I subsequently implemented it in my own project hardware (STM32F446), it still worked EXCEPT that the terminal text was always "LED 0" (number 0, not letter O), rather than "LED ON" or "LED OFF". It didn't worry me TOO much since I won't really use USB in the same way as this simple test, in my project - but it did worry me a bit because it's not nice to leave little mysteries sleeping in code. I couldn't understand why that worked on the Blue Pill but not on my STM32F446. So I asked my good STM32-expert friend, who replied: "Your unsigned char data[] = "LED ON" will be created on the stack at run-time, and will only exist until execution leaves the 'if {} else {}' construct. But the USB message will only get sent some time later when the USB stack runs ... but which time it is very likely that the text on the stack will have been over-written. This is a rather obscure version of the classic (and extremely common bug) caused by passing a pointer to an automatic variable back *up* to the calling function." And so it does indeed turn out to be! When I replace the line with the CDC_Transmit_FS call with (for example): CDC_Transmit_FS((uint8_t *)"LED ON", 6); Then everything works as it should, I get "LED ON", "LED OFF" as I should. Just a minor comment in case it helps somebody... Many thanks again for the great video! Hans qrp-labs.com
@ЕлизаветаВладимировна-и2е
@ЕлизаветаВладимировна-и2е 4 жыл бұрын
Hello! I'm using Atollic TrueStudio too. I would like to ask how should I manage Run Configuration as there is no Ac6 STM32 Debugging option in TrueStudio.
@evgsurf
@evgsurf 6 жыл бұрын
The Best video of all manuals for SMT32!
@Hugatry
@Hugatry 6 жыл бұрын
Cheers!
@cosmin751
@cosmin751 7 жыл бұрын
Very nice video. In case some people have missed it, in order to make the USB work, CubeMX adjusted the board's clock to 48 MHz (as seen at 3:04 in the video). This adjustment is not optimal. If PLLMul and USB Prescaler are set at x9 and /1.5, respectively, the USB clock will still run at the required standard of 48 MHz, but the board clock (HCLK) will be at the full 72 MHz. For many applications this might not matter (it might even be desired for low power consumption), but in general, one should run the board at the designed 72 MHz. As a final note, my version of CubeMX runs the clock optimization with the 72 MHz HCLK, so for newer CubeMX versions this might not be an issue at all. At least it looks like ST is putting resources into making CubeMX better.
@deryatauson4420
@deryatauson4420 5 жыл бұрын
please send me your email id, i want to learn about stm32f103c8t6, i am new to use keil uvision
@tomislavmak
@tomislavmak 6 жыл бұрын
Extremely useful video as introduction to STM32. Inspires me to start writing some code for it myself. Thank you.
@thesynthimuse2790
@thesynthimuse2790 3 жыл бұрын
Really clear & straightforward video. Thanks!
@ristepindjurov7632
@ristepindjurov7632 6 жыл бұрын
Great video. Explains the basic information in a clear way making it easy to understand.
@foobardrinkingmate
@foobardrinkingmate 7 жыл бұрын
Awesome video. Worked right out of the box. Keep 'em coming bro.
4 жыл бұрын
Very nice step-by-step explanation. It worked well! Thank you!
@wd5gnr
@wd5gnr 7 жыл бұрын
How funny. I just wrote the same code and found a few things were non-obvious. Wish I'd seen your video first! I am going to post some of my code on HaD at some point and I have a reasonable circular buffer for the receiver part. Great job on the video!
@Hugatry
@Hugatry 7 жыл бұрын
Thanks! Few things were indeed non-obvious. I hope this video will be helpful to some who are doing this for the first time. This could be a real time saver, especially if one doesn't know where to start. Looking forward to seeing that code of yours!
@233lynx
@233lynx 4 жыл бұрын
Thanks a lot! If you ever consider writing actual manual instead of that... something ST passes for documentation please go for it.
@gtcollection6933
@gtcollection6933 4 жыл бұрын
Thank you very much for the tutorial, very helpful. All the best
@youloveelectronix4902
@youloveelectronix4902 4 жыл бұрын
A very nice upload, lods of research done by you but i need some more detailed tutorials of advanced commands and builtin functions on cubemx. Do upload some more advanced tutorials👍
@kriskb3
@kriskb3 2 жыл бұрын
Tutorial starts fine but when it comes to the pin configuration thing after the clock setup at 3:07 my STM32CubeMX 6.1.0 doesn't match with your CubeMX. Under what version of STM32CubeMX are you running your tut?
@Hugatry
@Hugatry 2 жыл бұрын
Hi, thanks for the feedback. I don't remember the version number, but whatever it was, it's now at least 5 year old :). In the video I go to "Configuration" tab to setup the default state of the GPIO pin. I think in modern version of STM32CubeMX, if you are in pinout view and click "System view" above the pinout diagram, you'll end up in a similar configuration page. Alternatively, the list with all the available peripherals on the left now has "GPIO". You can click that and you'll end up with same GPIO configuration panel. I hope this helps.
@GloriaRodrigues-e6q
@GloriaRodrigues-e6q 11 ай бұрын
Helped a lot. Thanks a ton!
@Hugatry
@Hugatry 10 ай бұрын
You're welcome!
@equitimer
@equitimer 6 жыл бұрын
Excellent video, informative and easy to follow!
@keoni29
@keoni29 6 жыл бұрын
Thank you for making this video. Very good explanation. I did not have the build error you mentioned.
@Hugatry
@Hugatry 6 жыл бұрын
Good to hear that! That error was PITA and it was nice to see that it got fixed quite quickly.
@sadashivkamath
@sadashivkamath 5 жыл бұрын
Hi, Thanks for detailed explanation. Quite useful..!I'm using TrueSTUDIO Toolchain/IDE. IDE is not detecting target (STM32F103C8T6). Do you suggest any recommended settings for TrueSTUDIO?I see only below 3 Debugger in TrueSTUDIO. What is work-around for this issue?1) ST-LINK2) SEGGER J-TRACE Cortex-M3) SEGGER J-LINK
@kataeff
@kataeff Жыл бұрын
Спасибо за видос! Работает!
@Hugatry
@Hugatry Жыл бұрын
That's great! I'm glad this is still helpful.
@rikilshah
@rikilshah 4 жыл бұрын
Well, that was super clear and easy to follow along!
@bonafide9085
@bonafide9085 6 жыл бұрын
saved me a couple of hours! thanks a lot!
@malgailany
@malgailany 7 жыл бұрын
Very informative, Thanks
@Hugatry
@Hugatry 7 жыл бұрын
Thanks for watching!
@RDCST
@RDCST 3 жыл бұрын
When you enable USB the device can't run at 72MHz as in Arduino projects? Thanks for the video.
@Super_Lizard
@Super_Lizard 3 жыл бұрын
Thank you so much, great tutorial!
@wgfracing3769
@wgfracing3769 9 ай бұрын
hello excellent video. Do you do projects for third parties?
@xDR1TeK
@xDR1TeK 4 жыл бұрын
More power to you!!!!! Namaste.
@kriskb3
@kriskb3 2 жыл бұрын
Autocompletion and other hints during editing: What is the IDE you are using? STM32CubeMX or STM32CubeProgrammer? I'm ondering how to get this feature as well under STM32CubeIDE? Does it require a certain File type or project type to be chosen?
@Hugatry
@Hugatry 2 жыл бұрын
Autocomplete/hints works in STM32CubeIDE by pressing CTRL+Space after typing something, or by waiting 0.5s after typing ".", "->" or "::". I am not sure if this is the case by default, but you can check settings by going to "Window" -> "Preferences" -> "C/C++" -> "Editor" -> "Content Assist".
@iforce2d
@iforce2d 4 жыл бұрын
Thankyou, very helpful!
@rajanverma6093
@rajanverma6093 5 жыл бұрын
Thanks you so much for share this information and thanks for this tutorial.
@qwegmgm4524
@qwegmgm4524 7 жыл бұрын
Молодец дядька. Спасибо.
@Hugatry
@Hugatry 7 жыл бұрын
Cheers!
@geamdjum09
@geamdjum09 6 жыл бұрын
Very informative, usefully for me! Thanks
@HazimEng
@HazimEng 3 жыл бұрын
I followed the same steps. but why on stm32f103c8tx but the usb does not working " USB device not Recognized"?
@new_beginning2571
@new_beginning2571 3 жыл бұрын
STM CDC HOST (micro USB) -> OTG -> TTL I want to make the STM as CDC HOST and connect an OTG cable to STM, later connect an USB TTL to OTG. as TTL is Virtual comm. device. Can This work?? I am trying to simulate STM as host cdc. I am not able to get this to work. Can you please suggest what else can be done??
@kriskb3
@kriskb3 2 жыл бұрын
As far as I understand, this video shows how to build a virtual serial port using the SMT32F103CT8T6 (blue pill) I'm wondering though, which pins of the STM32F103 now act as the (TTL) UART Interface to the outside world? From my understanding, the flashed program behaves like an FTDI Serial Dongle, doesn't it?
@Hugatry
@Hugatry 2 жыл бұрын
Sorry, missed this older comment. To compare what I am doing in this video to those FTDI dongles/chips, this project replaces an FTDI dongle between the PC and STM32. There are no RX and TX pins, because this will only get the data from the PC to the STM32 chip. This is to get data directly to the STM32 project, without external converter dongle/chip.
@Debraj1978
@Debraj1978 6 жыл бұрын
Thank you. I followed your steps for my Stm32F4Discovery board, and the same instructions were exactly working for me. I used CubeMX 4.26.1
7 жыл бұрын
Nice, it helped a lot. Thank you!
@ravirao5798
@ravirao5798 Жыл бұрын
Nice Tutorial. I need one Information. Pl Let me know how this works without Installing CUBE IDE. Which driver Is required. Thanks in Advance. Ravi
@Hugatry
@Hugatry Жыл бұрын
Thanks! When playing with these boards, I have always started by installing the IDE and using the HAL libraries. I don't know how to do it without installing the IDE. Sorry.
@JuanPerez-cc7gb
@JuanPerez-cc7gb 4 жыл бұрын
Thank you very much for this great video. May you please explain when are you using the Adapter USB - TTL Serial and when the USB port? Are you plugging the Adapter to load the code and then unplugging it then plugging the USB to run de code? I am very confused, please expalin.
@AbhishekKr1902
@AbhishekKr1902 7 жыл бұрын
Excellent video buddy, thanks a tonne!!
@mutexembedded2206
@mutexembedded2206 7 жыл бұрын
Thanks mate,,, very very useful :)
@Hugatry
@Hugatry 7 жыл бұрын
Cheers!
@keoni29
@keoni29 6 жыл бұрын
I was wondering if you have experimented with any of the other USB classes. I am struggling to get a usb hid working. I think I need to set the HID ID somewhere. The examples use USBD_HID_SendReport(&hUsbDeviceFS, buffer, 8); but this does not include the ID byte at the start of the report.
@Hugatry
@Hugatry 6 жыл бұрын
I remember creating HID gamepad a while back. But it was just a quick test and it was some time ago, so I don't remember what I did to make it work... I remember that I took the example, changed the report descriptor and variable that indicates the size of the report descriptor. But what else? I have no idea... Sorry, but I don't have any tips or tricks. But good luck! STM32F103 is great platform for custom HID gadgets and I hope you'll figure out how to make it work.
@keoni29
@keoni29 6 жыл бұрын
I modified a project from github for WB4STM32 and that seems to work. Now I can compare it with the source generated by Stm32Cube to see what needs to be altered for it to work.
@omniyambot9876
@omniyambot9876 4 жыл бұрын
do it need an FTDI adapter?
@rtos
@rtos 4 жыл бұрын
Nice explanation!
@rcfreakamit
@rcfreakamit 5 жыл бұрын
Great video! I've been struggling to get ST-Link V2 and source code debugging (OpenOCD) to work from within SW4STM32 eclipse IDE for several days now, finally managed to get it working thanks to this video. The two main items I've been missing all along were - 1) enabling SWD in CubeMX, and 2) manually editing the reset line in the .cfg file. Thanks!
@lc-mn5ww
@lc-mn5ww 6 жыл бұрын
Hi, Can I change to higher baud rate for example 115200. And what role of it exist in system? like one of UART? or separate CDC with special handling input/output method?
@babaroro5942
@babaroro5942 4 жыл бұрын
Thanks a lot for this tutorial :D
@Hugatry
@Hugatry 4 жыл бұрын
You're very welcome!
@mow3890
@mow3890 5 жыл бұрын
Thanks huge help man , cool
@Electromaniaworld
@Electromaniaworld 6 жыл бұрын
thanks nice tutorial
@philipidehen3069
@philipidehen3069 4 жыл бұрын
Well done
@murraymacdonald4959
@murraymacdonald4959 6 жыл бұрын
This is a fantastic tutorial. Thank you very much.
@ankitmaurya1852
@ankitmaurya1852 4 жыл бұрын
With the same procedure, can we do in Keil uvision?
@safiakhan2034
@safiakhan2034 4 жыл бұрын
can please make the same video for stm32l152 discovery board i tried a lot but it is not detected as a virtual com port
@gaborszeman7461
@gaborszeman7461 7 жыл бұрын
Hello Hugatry, Thanks for the detailed work! :) I found your video after two days of tryings. Unfortunatelly it didn't solve my problem that my STM32F103RET6 controller can't be seed in the device manager at all (not even with the little yellow triangle). I took a breakpoint into USBD_CDC_Init() function but it's never called (the function is located in usbd_cdc.c file at line 475). Does your code stopped at this point? Thanks, Gabor
@Hugatry
@Hugatry 7 жыл бұрын
Hi, thanks for your comment! There is a 1.5kOhm pull-up resistor in the D+ line, which tells the host (computer) that USB-device has been connected. In the board shown in the video, that pull-up resistor is wired directly to 3.3V. Even if I don't program the board to be an USB-device, it will show in the device manager (with yellow triangle though). In your board that pull-up resistor is probably​ controlled with GPIO pin. I don't know which and how. If you have schematic for your board, that should tell you which pin it is and if not, you could take continuity meter and try "reverse engineering".
@gaborszeman7461
@gaborszeman7461 7 жыл бұрын
Hello, Thank you for the help. You were right, there is a tricky 1.5K pullup resistor that can be switched on with a GPIO. Now the CDC is fully functionable! :) Greetings, Gabor
@Hugatry
@Hugatry 7 жыл бұрын
That's great! I'm glad I was able to help.
@omersaidozturkstudent2339
@omersaidozturkstudent2339 4 жыл бұрын
CAN I use STM32103C8's USB and CAN bus at the same time ? I have transferred the CAN pins to PB9 and PB8 and using USB at PA12 and PA11. In a new project which I do not use CAN bus I am able to use USB. But in the project with CAN bus, PC does not recognize my device ?
@omersaidozturkstudent2339
@omersaidozturkstudent2339 4 жыл бұрын
according to jeelabs.org/2018/canbus-part-3/ , using CAN bus and USB is not possible at the same time in STM32f103c8. If anyone stuck like me :)
@MrController64
@MrController64 6 жыл бұрын
Great! very thanks
@karl-ve2of
@karl-ve2of 5 жыл бұрын
I have an error code 10 on my Virtual Com in Device Manager. I managed it to work one time but after i disconnect my usb and connect ST-Link programmator to flash new program it stops working and gives error code 10... i don't know what's the problem, it can be the USB cable but I tried on 2 cables and it still doesn't work. I'm using Win10.
@NishantKumar-pe7lh
@NishantKumar-pe7lh 5 жыл бұрын
Is there any way that I can program my STM32F103C8T6 through a USB cable?
@conservativedeveloper7289
@conservativedeveloper7289 5 жыл бұрын
You can flash an Arduino bootloader on it using a usb to serial adapter. After that you can program it through the micro usb port, but you have to use the Arduino IDE.
@KlindCardinale
@KlindCardinale 6 жыл бұрын
Well explained and straigh to the point. Thank you a lot for this video, saved me a couple of hours ̶y̶e̶a̶r̶s̶ .
@Hugatry
@Hugatry 6 жыл бұрын
Thank you for your comment. And you are welcome! I spent way too many hours figuring this out and I'm glad my video helps others save time on such a simple task.
@Hugatry
@Hugatry 6 жыл бұрын
What is the full line that appears in the device manager? If you are using the project created by STM32CubeMX, with no other modifications than the cfg file and you have flashed it successfully, it should work. I'm wondering if the problem is missing drivers (If you are NOT running Windows 10, try drivers from first link in the description). More lines in the config file is probably OK. There have been some updates and there are some extra options that weren't there at the time of making this video.
@KlindCardinale
@KlindCardinale 6 жыл бұрын
Yes! I deleted my comment because I figured out that it was because the missing drivers, I was forgetting that. I just installed drivers and now it works. Again, thank you very much. Keep the awesome work.
@Hugatry
@Hugatry 6 жыл бұрын
I hadn't even thought about searching for drivers, because I've been running Win10 for a while and on Win10 the built-in drivers work just fine. Another commenter mentioned about the drivers couple of days ago and I added link in the description after that. Great to hear that you figured it out and solved the problem. Good luck with the project!
@outlandish791
@outlandish791 4 жыл бұрын
amazing video, but when i connect my stm board to computer using usb cable it says "USB device not recognized", i hope you help me
@joshuamitchell2275
@joshuamitchell2275 6 жыл бұрын
awesome dude.
@Hugatry
@Hugatry 6 жыл бұрын
Awesome!
@renasomar5675
@renasomar5675 3 жыл бұрын
Can anyone help with setting up a command parser through the USB CDC?
@kerneltechnology624
@kerneltechnology624 4 жыл бұрын
This "BluePill" isn't using STM32F103C8T6 as its CPU. Actually, it is STM32F103CBT6 instead.
@mekatronikmuhendisi8420
@mekatronikmuhendisi8420 4 жыл бұрын
Can we use to usb as usart communicate ?
@HaiPham-nv3yb
@HaiPham-nv3yb 6 жыл бұрын
I get issue "Unknown USB Device (Device Descriptor Request Failed" in Device Manager. I run on Windows 10 and the STM32 Virtual COM Port Driver is installed.
@alexandrecrt
@alexandrecrt 5 жыл бұрын
Hello. I'm also having this problem with STM32. I have already uninstalled the driver, deactivated it, reinstalled it but it did not work. I have this problem also with the KL05Z board from NXP Semiconductors. Did you get any solutions to this problem?
@knki_95
@knki_95 6 жыл бұрын
hey nice tutorial, please make more such tutorials with CubeMx and STWorkbench. i am running your project on my Stm32f4 disco. i usb serial device need a driver update.did you have a situation like this ?
@Hugatry
@Hugatry 6 жыл бұрын
Thanks, Kiran! I don't remember if I needed to install drivers or not. I found this page when I searched for "STM32 com port driver": www.st.com/en/development-tools/stsw-stm32102.html On that page it says that native drivers on Windows 10 should work. But as there are lots of people using older Windows versions, I'll add that link to the description. There are many interesting things one can do with STM32 using the CubeMx, but information can be hard to find. This kind of tutorials are definitely in my To Do -list!
@knki_95
@knki_95 6 жыл бұрын
Hugatry's HackVlog turns out that stm32f4 needs several other config changes. Got it though, thanks
@knki_95
@knki_95 6 жыл бұрын
Hugatry's HackVlog bluepill with freertos Should be an interesting combination right?
@Hugatry
@Hugatry 6 жыл бұрын
FreeRTOS is indeed interesting thing. I have never used it, but I do see the advantages of using it in many projects.
@UttshaKhan
@UttshaKhan 7 жыл бұрын
Thank you!
@АлексейБелоцерковский-д1о
@АлексейБелоцерковский-д1о 7 жыл бұрын
this is voice )) like indus robot ))
@1talha686
@1talha686 4 жыл бұрын
excellent!
@dmitriykonopinskiy3793
@dmitriykonopinskiy3793 4 жыл бұрын
How to use USB Full speed?
@TinLethax
@TinLethax 6 жыл бұрын
hi.This will burn new bootloader or edit current bootloader?
@softwarepole
@softwarepole 6 жыл бұрын
Neither, it will leave bootloader intact and burn the program in memore region after bootloader
@ivans9655
@ivans9655 7 жыл бұрын
What is better STM32F103C8T6 or Arduino Nano?
@Hugatry
@Hugatry 7 жыл бұрын
I think both of them are great boards. STM32F103 is more powerful and has features that Nano doesn't have, like USB, DMA and better ADC. On the other hand, Arduino Nano is very easy to use and well supported. Nano is great for simple and quick projects. It's my go-to development board when I need to test some new sensors or other components/modules.
@ivans9655
@ivans9655 7 жыл бұрын
Hugatry's HackVlog thanks. I want to create dynamic LED backlight using WS2812B strip for my monitor. It will be nice addition for gaming and watching movies.
@biotronikapl9670
@biotronikapl9670 6 жыл бұрын
Arduino Nano has 2k SRAM only. It could be too little.
@NetlistPCB
@NetlistPCB 4 жыл бұрын
Thank you
@ashwin372
@ashwin372 6 жыл бұрын
how to do it in keil with codes not with cubemx?
@alighazi6658
@alighazi6658 5 жыл бұрын
i have problem with opening port in windows 10 but when i download stm vertual com port driver for windows 10 the issue was solved :) hope help anybody else
@alighazi6658
@alighazi6658 5 жыл бұрын
perfect .tnx
@ilkeraykut7064
@ilkeraykut7064 4 жыл бұрын
What about Keil?
@jaguarpaw1638
@jaguarpaw1638 5 жыл бұрын
legend
@franciscoaguilera49
@franciscoaguilera49 7 жыл бұрын
So it's like a teensy board or arduino trinket?
@Hugatry
@Hugatry 7 жыл бұрын
I would say it's comparable to Teensy LC or maybe 3.2. More powerful than Trinkets.
@Gamamaha
@Gamamaha 6 жыл бұрын
The Stampede I think it's more like a STM32 board.
@krazyolie
@krazyolie 3 жыл бұрын
thanks
@AnEngineersPOV
@AnEngineersPOV 4 жыл бұрын
Hello,Can i have my STM32 running as a HID device and have a serial port aswell?
@slap_my_hand
@slap_my_hand 7 жыл бұрын
** Programming Started ** auto erase enabled Error: Invalid command argument image.base_address option value ('Test.elf///') is not valid ** Programming Failed ** shutdown command invoked i have no idea what i am doing wrong. Debugging works, but when i click run, it doesn't work.
@Hugatry
@Hugatry 7 жыл бұрын
Apparently that is caused by a space in the project name. That space also goes to the name of .elf file and because that name hasn't been handled safely, it messes up the programming command. As a quick fix you could either recreate the project with STM32CubeMx with project name that doesn't have spaces, or do following in the SW4STM32: 1) Clean project. 2) Rename project and remove the spaces. (Right click on project in project explorer -> Rename) 3) Build the project. 4) Select the new .elf file in Run/Debug settings. (Right click on project in project explorer -> Properties -> Run/Debug settings. Create new if needed, and select the C/C++ application with "Search project...". List should show .elf file with your new project name as a file name.) I haven't personally encountered this problem "In real life", so I don't know if there is more elegant way to solve it. But this was something I came up with after quick research and testing. I hope this helps, cheers!
@slap_my_hand
@slap_my_hand 7 жыл бұрын
Thanks a lot!
@sudipghosh8831
@sudipghosh8831 4 жыл бұрын
Gud gud
@cad3175
@cad3175 7 жыл бұрын
..thanks
@KlindCardinale
@KlindCardinale 6 жыл бұрын
Hello friend! I hope everything still good. Please help me if you know what could be happening to me, I am having issues when trying to upload the code to the microcontroller, I get the error: "OpenOCD child process termination Reason: Wrong devide detected" I am doing exactly the same than before, and I previously could upload the code with no problems, following your steps. I think the only thing I have made different is that once I tried to upload de code using Rigth Click > Target > Program Chip. It failed then I tried to use your method as always but now I cannot make it work again, I have tried changing a configurations but still the same. (I have also tried removing the Launch Configuration and creating a new one, changing the text in the .cfg file, etc) In my console I get the following log: Open On-Chip Debugger 0.10.0-dev-00010-g96aab7b (2018-07-13-06:51) Licensed under GNU GPL v2 For bug reports, read openocd.org/doc/doxygen/bugs.html trst_only separate trst_push_pull Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD adapter_nsrst_delay: 100 adapter speed: 950 kHz Info : clock speed 950 kHz Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748 Info : vid/pid are not identical: 0x0483/0x374B 0x0483/0x3748 Info : using stlink api v2 Info : Target voltage: 3.216284 Error: init mode failed (unable to connect to the target) in procedure 'program' in procedure 'init' called at file "embedded:startup.tcl", line 485 in procedure 'ocd_bouncer' ** OpenOCD init failed ** shutdown command invoked Sorry for the long comment, I hope you can help me. Thanks sir!
@spyke8611
@spyke8611 5 жыл бұрын
Hi I have the same problem, Do you solve it?
@xcelcd2278
@xcelcd2278 6 жыл бұрын
at 8.46(when running the code) i got an OCD error stating -openOCD child process termination Reason: Unplugged target or ST LINK already in use or STlink USB driver not installed . what should i do..?? plus just to clarify we dont need any ST-LINK as per your tutorial right.?
@Hugatry
@Hugatry 6 жыл бұрын
Hi! I was using ST-Link V2 compatible programmer/debugger. I recommend getting one of those (they cost just couple of $ on eBay). One more thing to buy, but it makes life so much easier.
@xcelcd2278
@xcelcd2278 6 жыл бұрын
oh i see thank you for the instant reply.
@gmg1072
@gmg1072 4 жыл бұрын
In CDC_Receive_FS you read Buf[0] before It's assigned, crazy! Then sending data inside receive function is a very bad practice, you have to set a flag and then send data inside main loop.
@Rockdagger
@Rockdagger 5 жыл бұрын
no sound
@lrocky9481
@lrocky9481 5 жыл бұрын
macos catalina无法识别USB设备
@AkbarRajaei
@AkbarRajaei 6 жыл бұрын
05:30 CDC_Receive_FS 09:30 CDC_Transmit_FS
@gulammohamed7052
@gulammohamed7052 5 жыл бұрын
Archive
@asulliv1954
@asulliv1954 6 жыл бұрын
I Do Not Compute,Program Too Difficult To Understand For Beginners!!ssshhhuuuttttdddooowwwnnnnn!!!!,,,,,,.,,.......
@hannuhanhi183
@hannuhanhi183 4 жыл бұрын
Joo joo
@Gamamaha
@Gamamaha 6 жыл бұрын
Very useful video, thank you!
@Hugatry
@Hugatry 6 жыл бұрын
Thanks!
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 108 МЛН
Installing the STM32 USB Bootloader, Easily! [SEE DESCRIPTION]
8:02
Caleb Marting
Рет қаралды 266 М.
USB peripheral on STM32 as serial interface | VIDEO 21
6:47
Matej Blagšič
Рет қаралды 8 М.
The complete Setup-and-Run guide of STM32F103C8T6 or similar
16:50
RideLifeWithGrace
Рет қаралды 41 М.
Easy & Powerful Arduino Alternative? STM32 Beginner's Guide
9:49
GreatScott!
Рет қаралды 1 МЛН
STM32 USB CDC HOST and DEVICE || Communicate using USB || HAL
12:41
ControllersTech
Рет қаралды 44 М.
Program an STM32F103C8T6 | Blue Pill | Different methods
7:17
Tech Talkies
Рет қаралды 4,4 М.
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34