cancel
Showing results for 
Search instead for 
Did you mean: 

USB Host Library - problem on function USBH_BulkReceiveData()

marceldanilo
Associate II
Posted on August 02, 2012 at 16:49

I'm trying to make a custom drive based on MCS driver; In order to run a STM32F4 (on a discovery board) as USB host of a vendor specific device.

Using USBH_BulkSendData I have exchanged data in OUT direction with success;

However, with USBH_BulkReceiveData I cannot receive - IN direction;

The post linked below indicates that the library has some problems in its USB machine (but for STM32F1);

In this case, the programmer also used the USBH_BulkReceiveData fucntion:

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/USBH_BulkReceiveData problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=200]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FUSBH_BulkReceiveData%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=200

Is it really? 

Has ST a perspective to release a corrected version of the library?

Have someone used the function USBH_BulkReceiveData??

Thanks in advance.
2 REPLIES 2
tsuneo
Senior
Posted on August 02, 2012 at 21:22

> However, with USBH_BulkReceiveData I cannot receive - IN direction;

 

I recommend you to get more clues, before blaming USBH_BulkReceiveData

Are you using this function in right way?

Does your target device respond to the bulk IN transaction?

> The post linked below indicates that the library has some problems in its USB machine (but for STM32F1);

The patch on the link implements time out feature (NAK count timeout) to the original ST's code, to cope with a bad-mannered target device, which doesn't terminate transfer with a short packet like ZLP. Of course, time out feature is desirable. But it doesn't concern to your problem.

> Have someone used the function USBH_BulkReceiveData??

 

It is heavily used in USB_Host_Examples\MSC example.

You are starting on this example. Why aren't you aware of?

Tsuneo

marceldanilo
Associate II
Posted on August 02, 2012 at 21:43

It is the point, Tsuneo;

I debugged the STM32 for the MSC example, and I observed that the USBH_BulkReceiveData works perfectly, as all the other functions.

Using a sniffer, as you recommended, I observed that my device can perform Bulk transfers with the PC;

But here is my problem: Why doens't work when the STM32 is the host?

Follows a example of bulk transfer performed between my device and the PC:

Request # 84 [IN]