cancel
Showing results for 
Search instead for 
Did you mean: 

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

THe.2
Associate

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?

3 REPLIES 3

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

JW

THe.2
Associate

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);

​> 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​