Skip to main content
Visitor II
August 17, 2022
Question

USB VCP host(STM32F4xx) ,how to receive the device data?

  • August 17, 2022
  • 3 replies
  • 1158 views

We need to use f4xx as the usb vcp host side,

The virtual com port code project on the usb host side is generated with cubeide.

after inserted vcp device, the host can be recognized it normally.

However, it is found that the datas sent by the usb vcp device will not be actively received by the host.

The host needs to call the receive function regularly to receive it. Is there a way to make the host not poll for reading?

    This topic has been closed for replies.

    3 replies

    Super User
    August 17, 2022

    USB is a polled bus, the host has to poll the devices regularly.

    JW

    THe.2Author
    Visitor II
    August 18, 2022

    thank you

    I wonder why the host VCP driver on PC(&some PC software of COM assistance)need not poll the USB VCP device?

    I​ used Bus Hound can not see any poll package form the PC host.

    besides, can we used the api "USBH_CDC_Receive()" to poll the CDC device?

    if yes,

    the host does not know the length of the device datas In advance,

    the question is what should we give the parameter(length)​ of the API in every poll step?

    USBH_StatusTypeDef USBH_CDC_Receive(USBH_HandleTypeDef *phost,

                       uint8_t *pbuff,

                       uint32_t length);

    Super User
    August 18, 2022

    ​> I​ used Bus Hound

    ​I don't know what is Bus Hound, but if it looks at communication between application and driver, it may not see that the driver is polling the device continuously and autonomously, without requiring the application to poll.

    Typically, in ​PC you don't own the low level drivers.

    I don't know how the C​ube implementation of USB stack works. I don't use Cube.

    JW​