cancel
Showing results for 
Search instead for 
Did you mean: 

HID host bug

noam
Associate II
Posted on June 01, 2014 at 18:48

Hi,

I have a problem that looks like a bug in STM USB library. I am using version 2.1 running on STM32F207.

The problem I am facing is as follows:

I have a host running at the STM32F207 (HS) and a mouse connected to it. The code is based on a modified version from the examples. All works fine with one mouse. It is a simple Logitech 3 button + wheel.

When I connect a newer Logitech mouse or a a simple Pixart mouse the host start negotiation with them but fails.

The host reaches the enumeration state but does not call mouse init. I was able to find that it returns an error USBH_BUSY ?

It looks like enumeration is not complete or an error in descriptors transfer.

I have triad running STM unchanged code loaded on the evaluation board (STM3220) and also the latest CUBE for that board and it behaves exactly the same ??

Anyone seen something like that ?

Any input is appreciated.

BR,

Noam.

#stm3220-cube
6 REPLIES 6
noam
Associate II
Posted on June 02, 2014 at 10:16

Hi,

Some more information. I have already tested with 4 other mice’s and none are properly recognized by the host code.

 I am running the latest cube code for STM32F2 as well as my own code.

 This is not a small bug I have triad Microsoft Intellimouse explorer , Logitech professional mouse and PIXART mouse.

None are working with the host code.

The only mice that does work is a simple Logitech mice ???

Mice is enumerated but not reseted. As a result the process is not completed.

Anyone seen something like that before ?

BR,

Noam.
Posted on June 09, 2014 at 11:12

Hi,

It seems to be a connection issue. Please try to increase the delay after the connection event in the connection event callback within the usbh_conf.h file.

/**

* @brief Connect callback.

* @param hhcd: HCD handle

* @retval None

*/

void

HAL_HCD_Connect_Callback(HCD_HandleTypeDef *hhcd)

{

uint32_t i = 0;

USBH_LL_Connect(hhcd->pData);

for

(i = 0; i< 400000; i ++)

{

__asm (

''nop''

);

}

}

With regards.

noam
Associate II
Posted on June 10, 2014 at 14:28

Hi,

I am not using the CUBE code. I am using STM library 2.1

I could not find related code to the problem you described.

Can you elaborate ?

Thanks,

Noam.

noam
Associate II
Posted on June 10, 2014 at 16:19

Hi,

I was able to to load the CUBE code for HID host demo on my board. I found the function you suggested to change. I changed the time out but that did not help as well. Attache please find the captured display.

0690X00000603QpQAI.jpg

BR,

Noam.

noam
Associate II
Posted on June 11, 2014 at 13:04

I found some more information:

After getting the HID and Report descriptors the process idles forever ??

Inside usbh_hid_core.c in function USBH_HID_ClassRequest after case

HID_REQ_GET_REPORT_DESC is processed the next state is

HID_REQ_SET_IDLE

For some reason function USBH_Set_Idle always returns with USBH_BUSY and the state never changes .. like an endless loop ???

jeanmark
Associate II
Posted on June 18, 2014 at 10:29

Hi,

Could you provide the USB Trace, this will help understanding the problem.