2018-02-21 05:09 AM
I'm trying to implement Virtual Com Port on STM32F3. I use IAR.
I've included all files from a demo project.
However I have numerous errors while compiling the project. Struggling for hours I came to this question
Is there any compiled project with VCP for STM32F3?
Note: this post was migrated and contained many threaded conversations, some content may be missing.2018-02-22 01:14 AM
I'm pretty sure he means implementing a VCP on the target, not a VCP connection via the ST-Link.
I for myself didn't mess much with USB, though
2018-02-22 01:14 AM
My English is bad for sure.
The easiest way to have the VCOM working is to generate the project using CubeMX.
Select a nucleo board for a new project, the CubeMX will ask you if you want to pre-initialize the board hardware. For nucleo-64 boards the UART2 will be initialized. UART2 is connected to the ST-LINK so the ST-LINK driver on the PC will emulate COMxx and you be able to use the VCOM through COMxx (putty terminal, etc).
You can select the uart (enable it) manually as well without calling the pre-initialization wizard in CubeMX.
---
STM32 side: you will need to add UART API to transmit/receive data via UART2. I mean HAL_UART_Transmit()/ HAL_UART_Receive() function.
2018-02-22 01:17 AM
Perhaps this helps to distinguish the USB connection via the on-board ST-Link from the Target microcontroller's USB connection:
2018-02-22 01:18 AM
Probably you are right.
I prefer through the ST-LINK but USB/CDC is also viable solution. Slightly more effort is required when trying to transmit data reliably (need to check if the last piece of data was sent).
2018-02-22 01:24 AM
meyer.frank
might be right and you prefer direct USB connection without ST-LINKDownload F1 CubeMX package and look into an example in the CubeMX installation folder:
..\STM32Cube\Repository\STM32Cube_FW_F1_V1.3.0\Projects\STM3210C_EVAL\Applications\USB_Device\CDC_Standalone
2018-02-22 01:28 AM
erenburg.evgeny.002 wrote:
It's hard to understand what I want?
Yes it is.
It is not clear what, exactly, you mean by 'VCP' here.
As has been pointed out a number of times, all Nucleo boards, and some later Discover boards provide a VCP connection as part of the ST-Link.
Why can you not justuse that?
There is no target software at all required to use the ST-Link's VCP connection - as far as the target STM32 is concerned, it is just a UART connection.
EDIT
See this post for an explanation of the on-board ST-Link:
2018-02-22 01:31 AM
AvaTar wrote:
I'm pretty sure he means implementing a VCP on the target, not a VCP connection via the ST-Link.
Me too - I have made that point many times already!
But the OP doesn't seem clear on the difference - which is probably why he failed to explain?
2018-02-22 01:34 AM
Bogdan Golab wrote:
I prefer through the ST-LINK
Likewise.
And, given the trouble the OP seems to be having, I think it's probably the more appropriate solution here.
USB/CDC is also viable solution.
Maybe that's the key term the OP needs to be searching for - rather than 'VCP' ... ?
Slightly more effort is required
Hugely
more effort is required in getting the USB stack working!!!:(
2018-02-22 01:35 AM
I think I also mentioned both approaches so it's up to the Author of the post which one is better. You know my English is really bad and my responses might be misleading.
The best option is to start experimentation and try both options;)
2018-02-22 02:00 AM
Neil.Andrew wrote:
There is no target software at all required to use the ST-Link's VCP connection - as far as the target STM32 is concerned, it is just a UART connection.
Like this: