cancel
Showing results for 
Search instead for 
Did you mean: 

USB-HID comm. on stm32f2xx

swer
Associate II
Posted on November 10, 2013 at 12:03

Hello;

My question is about usb-hid protocol which is on stm32f2xx.

I have already use hid communcation on my pic32 project.

I just use control endpoint in order to send and receive data.No other endpoints are used.

without a problem I have been using this code on my pic32.

On the stm32fxx I tried to modificate description table as my needs. Even though it is said in this release 

library can handle only IN traffic, I am able to enable OUT traffic also.

But there is a strange problem I couldn't understand.

After 1024 data package send from HOST(computer) to device(stm32f2xx) , device doesn't respond and freeze,

as I said that each package consists of 64 bytes.

How can I make this straight ? Any help will be appreciated.

{ USB On-The-Go host and device library -  PAGE 39

HID user interface

The USBD_HID_SendReport can be used by the application to send HID reports, the HID 

driver, in this release, handles only IN traffic. }

#stm32fxx #usb #hid
3 REPLIES 3
Amel NASRI
ST Employee
Posted on November 19, 2013 at 11:42

Behavior cannot be garanteed in not supported modes.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

tsuneo
Senior
Posted on November 19, 2013 at 16:08

> After 1024 data package send from HOST(computer) to device(stm32f2xx)

Do you mean,

a) you've defined (more than) 1024-bytes Output (Feature) report, and you've sent it over Set_Report request in single call?

OR

b) you've defined shorter report, and sent a couple of reports over multiple Set_Report requests call?

Because of stupid USB SIE design of Synopsis (ST bought it from Synopsis), which binds all IN endpoints into single FIFO, and ''transfer-oriented'' SIE design (not transaction-oriented), IN transfers on STM32F2/F4 easily get in trouble.

> Even though it is said in this release library can handle only IN traffic

It means HID interrupt IN. The stack doesn't implement HID interrupt OUT.

But you may implement HID interrupt OUT endpoint easily, modifying usbd_hid_core.c

STM32_USB-Host-Device_Lib_V2.1.0\Libraries\STM32_USB_Device_Library\Class\hid\src\usbd_hid_core.c

Tsuneo

tsuneo
Senior
Posted on November 19, 2013 at 16:13

> Behavior cannot be garanteed in not supported modes.

Yah, with this code quality of ST's stack, ''supported'' behavior would not be guaranteed ;-)

Tsuneo