cancel
Showing results for 
Search instead for 
Did you mean: 

VCP for STM32F3

Posted on February 21, 2018 at 14:09

I'm trying to implement Virtual Com Port on STM32F3. I use IAR.

I've included all files from a demo project.

0690X00000609h4QAA.png

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.
57 REPLIES 57
Andrew Neil
Evangelist III
Posted on February 22, 2018 at 11:45

MY DEAR LORD!!!

IS THERE ANY ADEQUATE PERSON ON THE FORUM UNDERSTANDING ME???

Posted on February 22, 2018 at 11:12

Neil.Andrew wrote:

Hugely

more effort is required in getting the USB stack working!!!

As demonstrated in the OP's previous thread:

https://community.st.com/0D50X00009XkfBRSAZ

Posted on February 22, 2018 at 11:22

Right, you need to understand USB callback when receiving data from the USB, need to take care of unfinished transmit to make transmit reliably. A lot of stuff. That's why I promoted ST-LINK Virtual COM.

Posted on February 22, 2018 at 11:47

You seem to be the one failing to understand.

As has been explained a number of times, there are two possible ways to have a 'VCP' on a Nucleo or Discovery board. 

You have not yet clarified which particular 'VCP' option you require.

So, please answer the simple question: Is using the VCP provided by the ST-Link sufficient for you?

Posted on February 22, 2018 at 12:01

Provided by the ST-LINK??? How ST-LINK involved here?

I have STM32F3DISCOVERY BOARD (MB1035B)

I debug/program on USB-LINK connector. And VCP communication I what to run on USB USER connector.

A piece of the demo code

while ( 1 ) {

        if (bDeviceState == CONFIGURED)

        {

            STM_EVAL_LEDOn(LED6);

            CDC_Receive_DATA();

            /* Check to see if we have data yet */

            if (Receive_length  != 0)

            {

                STM_EVAL_LEDOn(LED4);

                int i;

                for (i = 0; i < Receive_length; i++) {

                    localBuffer[i] = Receive_Buffer[i];

                }

                CDC_Send_DATA(localBuffer, Receive_length);

                Receive_length = 0;

            }

        }

    }

The problem I can not compile the demo so I want to see compiled example for IAR.

Jesus Christ

! What I'm asking? NASA project?
Posted on February 22, 2018 at 12:10

Stay calm. It's a user forum, the voluntary one. You are trying in this piece of code USB/CDC. Not the ST_LINK

Posted on February 22, 2018 at 12:14

erenburg.evgeny.002 wrote:

 How ST-LINK involved here?

For goodness sake - have you not read any of the replies in this thread??

Look again at this picture:

0690X00000609n1QAA.png

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.

This is by far the simplest way to get a VCP connection from a Nucleo or Discovery board to a PC.

So, again, why can you not simply use the VCP provided by the ST-Link??

Posted on February 22, 2018 at 12:16

The B version of the board probably does not have the Virtual COM emulated by the ST_link so you have no choice and need to use USB/CDC.

Posted on February 22, 2018 at 12:18

Or use a different board.

Or use a separate USB-to-UART converter; eg,

http://www.ftdichip.com/Images/TTL232RRPI%201_a.jpg