0
\$\begingroup\$

I'm using STM32 VCP firmware on STM32F4 discovery. I generated the code with CubeMX and I could successfully integrate it into my Eclipse project. After calling the initialisation functions, the device appears on my PC as virtual com port, so the drivers are fine.

But where can I find the functions in the library, which do the trasmitting and receiving data on the STM32 device? I know this is a very basic question, but I'm looking for them for a long time.

asked Mar 12, 2015 at 9:51
\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

In my VCP project:

file: usbd_cdc_vcp.c

uint16_t VCP_DataTx (uint8_t* Buf, uint32_t Len); <-You call it to send data from STM to PC

and

uint16_t VCP_DataRx (uint8_t* Buf, uint32_t Len) {
 // Called when data from PC to STM is available. 
 // YOUR CODE IS HERE
 return USBD_OK
}
answered Mar 13, 2015 at 8:26
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thank you, I found the transmit function in file: usbd_cdc_if.c named as: uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len); It is probably generated by CubeMX with a different file and function name. \$\endgroup\$ Commented Mar 13, 2015 at 16:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.