Thanks a lot for sharing this, I was searching for the VCP over USB for some time and other tutorials made life very complicated.. Thanks again for sharing this
Hello, I am using STM32F429i Disc1 Board. I followed the exact same procedure as demonstrated. But the device isn't recognized by the PC at all. I couldn't find the virtual COM port of USB OTG. I verified heap size, installed VCP Driver (Am using Windows 10) and double checked everything. Couldn't figure the issue. Please help.
Hi I am using F411 board and there is no separate individual comport created its showing the same com port as previous but the working of com port is shifted to mini usb com port
hi Mohamed, Your video is brilliant. Could you please make a video of how to use the STM32F4 as a speaker(audio output device)? For example, read the data from the audio output through micro-usb and write the data into memory. I will be appreciate if you can help me!
Thanks for this video. I already got everything set up, connecting and transmitting data back and forth but I was unsure how to go about using the driver w.r.t receiving data. Do you think it’s necessary to have the callback to main? Essentially the CDC function is a callback so you could just put your logic in there?
MYaqoobEmbedded Thanks for your suggestion :) I’ve decided to implement a ring buffer message system as a separate module where incoming messages can be queued and processed. So far so good :)
Hi Mohamed, So we cannot use the st link itself to do this virtual com port if we have older version of this board right? I read it so online. But would like to know it from you. I wanted to use the virtual com port for a debug purpose to send messages to terminal. That's why. I'm just getting started with this microcontroller though I have had this board for quite a long time.
Can we use St-Link ( The Mini USB VCP) for communication with PC. Because the VCP of the ST-link is not connected to UART of STM32F407. Also are the drivers of USB VCP of the Stm(Mini) available for Windows 10.
This might be a dumb Question. I believe that there is some kind of interrupt generated when you send data from PC to the COM port causing the static function to be called. Is it correct? I couldn't really trace it from the code. Could you please help understand?
Selam Mohamed, Is it possible to combine VCP and HID in the same USB Interface? I mean with two different descriptors so I can see HID device and the Virtual Serial com at the same time on my machine. If yes would you please make a video for it? Thank you
I am working with Stm32f207zg as a host and I want to send data like you did to a device which is another microcontroller and the only function available is USBH_CDC_Transmit and i didnt understand how to work with it i need your help
Hi i want to control a robot arm with mouse(buttons and cursor) connected to my PC(not with Stm directly)..is it possible to control it that way?if yes so can you share any idea how to achieve that..the flow will be like this..Mouse->PC->Stm->robot.
I have installed VCP_V1.4.0_Setup.exe from st.com. I am able to build the program and load on the board and run, when i connect the USB to my laptop, device manager i see STMicroelectronics Virtual Comport 4 with yellow icon (not initialised fully). Also com4 is not getting open hyper terminal serial port program. Can you please advice what driver we need to install on laptop.
Hi Mehrez, You would need to install the STM VCP USB driver. You can download it from here: www.st.com/en/development-tools/stsw-stm32102.html Good Luck :)
I tried the transmit data portion of this video on my stm32f103 board and it works fine but the receive portion does not although i did the same code which is in this video, can anyone tell me the reason please please
@@mutexembedded2206 thank you. In fact if you could do timers without cube MX for start, it would be too good. I tried some exercises by myself using the default HAL and understanding each register which worked and motivated a lot even though it took some time.
Hi Mohamed, Thank you for these videos! On this one, if I send "Hello" as you did, everything is fine, but if I type one character at a time, I get "H@ el@l@o" with "junk" characters. Why is that?
Hey Mohamed, when i connect the usb to the laptop i have an error: the laptop does not recognize the usb, i checked my device manager, there is no virtual com, so this is the problem. my OS is Windows 10 can ou help me please
if you are using STM32CubeMx to generate code, go under "Middleware" category in "Options" and select "USB_DEVICE" and then select "Communication Device class (Virtual Port Communication)" and then generate code. you will be fine.
Hi Mohammad , when I connect the FS port to my computer, it is not detected, can you tell me what is going wrong? The computer fails to acknowledge that anything is connected at all.
Hello, great video. I want to know how to configure OTG/dual mode. I am using cube, so I have selected the option but I am not sure what is the code to enable this dual mode. Your help would be appreciated.
thanks for the reply, try to come up with a video referring this feature it would be very helpful and appreciated. Can I ask you if there is any tutorial explaining about the sleep modes and how to implement them in code.
MYaqoobEmbedded and how do you program the board, by the virtual COM port 4? In that case, what driver do you use. Because I can only program mine by the USB driver and it dont generate any COM port.
+MYaqoobEmbedded hi mohamed how are u ? i installed the virtual com driver from st website but the port still not detected , when i checked the device manager i find only stlink virtual com !!!!!! i can't know what's the problem !!!
@@behnammoradi1449 Hi, Go to your device manager when you plug the ST Micro USB (i.e. you need to plug both USBs one for ST Link&power other for USB communication). Then check for undefined USB ports.
God bless you dude, it is really anoying that this simple stuff goes so difficult to figure out
Thanks a lot for sharing this, I was searching for the VCP over USB for some time and other tutorials made life very complicated.. Thanks again for sharing this
Excellent way of explanation. I loved it. Thank you
Hello, I am using STM32F429i Disc1 Board. I followed the exact same procedure as demonstrated. But the device isn't recognized by the PC at all. I couldn't find the virtual COM port of USB OTG. I verified heap size, installed VCP Driver (Am using Windows 10) and double checked everything. Couldn't figure the issue. Please help.
did you manage to get it working for this board?
Hi
I am using F411 board and there is no separate individual comport created its showing the same com port as previous but the working of com port is shifted to mini usb com port
Great tutorials. simple and very clear. thank you very much
thank you very much for this video
hi Mohamed,
Your video is brilliant. Could you please make a video of how to use the STM32F4 as a speaker(audio output device)? For example, read the data from the audio output through micro-usb and write the data into memory.
I will be appreciate if you can help me!
Thanks for this video. I already got everything set up, connecting and transmitting data back and forth but I was unsure how to go about using the driver w.r.t receiving data. Do you think it’s necessary to have the callback to main? Essentially the CDC function is a callback so you could just put your logic in there?
Hi,
Usually it is better not to process data inside the callback, in advanced systems with RTOS, data are added to some sort of processing queue
MYaqoobEmbedded Thanks for your suggestion :) I’ve decided to implement a ring buffer message system as a separate module where incoming messages can be queued and processed. So far so good :)
@@Kefford666 Good :)
thank you so much, do you know how stablich conexion with bus CAN between two boards stm32f407vet6?
Hi , I am using an STM32f401, it has only one usb port. I tried your function but it doesn't work, do you know why?
Hi Mohamed, So we cannot use the st link itself to do this virtual com port if we have older version of this board right? I read it so online. But would like to know it from you. I wanted to use the virtual com port for a debug purpose to send messages to terminal. That's why. I'm just getting started with this microcontroller though I have had this board for quite a long time.
Do a quick read to the User Manual of your board, most case if it feature micro USB, then you should be able to do so
Great tutorial, thank you :)
How to get fast data.
Eg. Im reading 4096 ADC samples at 1 sec .. i need to store or transmi to pc very fast . How ,,,give reply.
Can we use St-Link ( The Mini USB VCP) for communication with PC. Because the VCP of the ST-link is not connected to UART of STM32F407. Also are the drivers of USB VCP of the Stm(Mini) available for Windows 10.
This might be a dumb Question. I believe that there is some kind of interrupt generated when you send data from PC to the COM port causing the static function to be called. Is it correct? I couldn't really trace it from the code. Could you please help understand?
That is correct
Thank you very much, excellent video....!!
Hello, why did you use that specific baud rate in the terminal?
Selam Mohamed,
Is it possible to combine VCP and HID in the same USB Interface?
I mean with two different descriptors so I can see HID device and the Virtual Serial com at the same time on my machine.
If yes would you please make a video for it?
Thank you
Genius!!!!, Thanks!!!!
I am working with Stm32f207zg as a host and I want to send data like you did to a device which is another microcontroller and the only function available is USBH_CDC_Transmit and i didnt understand how to work with it i need your help
Hi i want to control a robot arm with mouse(buttons and cursor) connected to my PC(not with Stm directly)..is it possible to control it that way?if yes so can you share any idea how to achieve that..the flow will be like this..Mouse->PC->Stm->robot.
I have installed VCP_V1.4.0_Setup.exe from st.com. I am able to build the program and load on the board and run, when i connect the USB to my laptop, device manager i see STMicroelectronics Virtual Comport 4 with yellow icon (not initialised fully). Also com4 is not getting open hyper terminal serial port program. Can you please advice what driver we need to install on laptop.
Hi Rasheed,,
Sorry for my very late reply, just saw it now,, Do you still have the problem?
MYaqoobEmbedded yes it worked
Awesome!
hello abdulrasheed01 , i am having the same problem, do you mind telling me how you fixed it ?
Hi Mehrez,
You would need to install the STM VCP USB driver. You can download it from here:
www.st.com/en/development-tools/stsw-stm32102.html
Good Luck :)
Thank you, this is very usfull for me
I tried the transmit data portion of this video on my stm32f103 board and it works fine but the receive portion does not although i did the same code which is in this video, can anyone tell me the reason please please
Thank you for the great and clear tutorials Mohamed. Will you make a tutorial for CAN communication as well?
Although this comment is 2 years old, I second this! Haha
great channel, thx!
good man keep making video for us
Mohamed, Your videos are really good and I wanted to know if you think it's possible to develop a driver for USB by ourselves like you did for ADC.
it was really healpful
Hello,
is there a function that transmits uint16_t valuses?
You can make one for your application using the u8 provided by library. It is easy
@@mutexembedded2206 thank you for your answer, but I am bad at C
@@babotvoj You can read a bit about variables types and typecasting
Is there a non-CubeMx version for USB?
Yes, I personally do not favor using CubeMX for advanced middleware like USB. I will make non-cube videos over the next couple of months.
@@mutexembedded2206 thank you. In fact if you could do timers without cube MX for start, it would be too good. I tried some exercises by myself using the default HAL and understanding each register which worked and motivated a lot even though it took some time.
Hi Mohamed, Thank you for these videos! On this one, if I send "Hello" as you did, everything is fine, but if I type one character at a time, I get "H@ el@l@o" with "junk" characters. Why is that?
Hey Mohamed,
when i connect the usb to the laptop i have an error: the laptop does not recognize the usb, i checked my device manager, there is no virtual com, so this is the problem.
my OS is Windows 10
can ou help me please
elmzaiti youssef
Salam,
You need to install STM32 VCP USB driver.. google it.
Good luck
if you are using STM32CubeMx to generate code, go under "Middleware" category in "Options" and select "USB_DEVICE" and then select "Communication Device class (Virtual Port Communication)" and then generate code. you will be fine.
what is the overall code size?
how can i use the Virtual COM port for windows 10
Need to install STM VCP USB Driver. You will find that in ST Website
@@mutexembedded2206 worked out well, thank you
@@mutexembedded2206 how can i display a picture in real term terminal used usb virtual com port ?
Hi , @@mutexembedded2206 the website says thee drivers aren't needed for Windows 10, is this still needed to be done?
Hi Mohammad , when I connect the FS port to my computer, it is not detected, can you tell me what is going wrong? The computer fails to acknowledge that anything is connected at all.
Tahira Jabeen
Hi Tahira,
You need to install STM VCP USB driver:
www.st.com/en/development-tools/stsw-stm32102.html
I am using a STM32F746G- Discovery board, will the clock configuaration be different for it?
nice
Hello, great video.
I want to know how to configure OTG/dual mode. I am using cube, so I have selected the option but I am not sure what is the code to enable this dual mode. Your help would be appreciated.
Hi,
That's an interesting one,, I have not used this mode before,, definitely worth a look.. But I don't know the answer now I'm afraid.
thanks for the reply, try to come up with a video referring this feature it would be very helpful and appreciated.
Can I ask you if there is any tutorial explaining about the sleep modes and how to implement them in code.
roddam usha
Hi Roddam,
Putting the STM to sleep and then perhaps wake up with an interrupt?
hi Mohamed,
can you say a how to send adc values from microcontroller to pc through usb.
thank you.
Hi,
You just need to convert the ADC values to string,, you can use sprintf function to so that, it's that simple. Good luck
Hi Mohamed,
What Windows_OS are you using?
Hi Juan,
10
MYaqoobEmbedded and how do you program the board, by the virtual COM port 4? In that case, what driver do you use.
Because I can only program mine by the USB driver and it dont generate any COM port.
Great !!
Hey is there anyway we can connect this VCP to the USART2 ?
yes check the documentation of the stm32f4 in st you need to solder PA2 and PA3 to the stlink, but only if you have the DISC-1 version
Very nice video.
Can u please explain about the rcc setting...
+MYaqoobEmbedded
hi mohamed how are u ? i installed the virtual com driver from st website but the port still not detected , when i checked the device manager i find only stlink virtual com !!!!!! i can't know what's the problem !!!
Hi Ala,
Search for the USB ports on device manager and update the undefined USB port with Auto update.
Another cause could be the wire.
+MYaqoobEmbedded
yes i did an update and i tried with another wire but same problem , really weird !!
Interesting! You may forgot to increase Stack & Heap size like I shown at 2:17
@@behnammoradi1449
Hi,
Go to your device manager when you plug the ST Micro USB (i.e. you need to plug both USBs one for ST Link&power other for USB communication).
Then check for undefined USB ports.
@@mutexembedded2206 Awesome! I did forgot to increase Stack & Heap size like you shown at 2:17 and got same problem like yours.
you can make gui with visual basic 8 and emwin builder