cancel
Showing results for 
Search instead for 
Did you mean: 

USB HID stop working

ambroise
Associate II
Posted on July 01, 2015 at 09:42

Hi,

We are working on USB HID with 64bytes IN and OUT reports with a stm32f401. We're using the stm32cude v1.6.0 for generated code, and we developped on KEIL v5.

The USB peripheral working well, we can speak with it from windows, sending/receiving packets. At a moment, the USB stack on the stm32 stop responding to the computer (we saw it on a logic analyzer, we never had ACK of the USB protocol). The stm32 continue working (leds still blinking, watchdog doesn't reset the board, debugger observation) but without the USB.

The only way we founded to get the USB communication back is unpluging/pluging the USB cable (the stm32 have an external power supply, so unplug/plug the cable doesn't perform a reset). But this solution is not acceptable for our final product.

(We made an eye diagram....etc... of the USB communication the problem isn't on the physical part).

Do you have any idea of what could make this communication failure ?

Thanks for your help !
4 REPLIES 4
Amel NASRI
ST Employee
Posted on July 01, 2015 at 13:38

Hi ambroise2,

I have some questions in order to more understand the issue:

- Is it a repetitive issue (after reset, do you face always same issue)?

- What updates did you made on generated code?

- Are facing the same problem if you try with the example available under STM32Cube_FW_F4_V1.6.0\Projects\STM324xG_EVAL\Applications\USB_Device\HID_Standalone?

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

ambroise
Associate II
Posted on July 01, 2015 at 14:21

Hi Mayla,

thanks for your answer,

- yes, it's repetitive, every time i get this problem

- I used custom hid class, i changed the hid descriptor in file usbd_customhid.c :

USBD_CUSTOM_HID_CfgDesc

USBD_CUSTOM_HID

USBD_CUSTOM_HID_Desc

I updated some defines too (from usbd_conf.h)

I modified functions in usbd_custom_hid_if.c (CUSTOM_HID_OutEvent_FS and USBD_CUSTOM_HID_SendReport_FS)

- i try it today

(no relation with my current problem but this can be useful for other people : i founded a little problem (i think) in usb code generation first time i used cube. In generated file usbd_conf.h, line 80/81, the device is always define as HS whereas i define a FS device in stm32cube)

Thanks for your help

ambroise

Amel NASRI
ST Employee
Posted on July 01, 2015 at 15:54

Hi ambroise2,

Regarding the note you added:

Which CubeMX version are you using? Last one is 4.8.

In lines 76 & 77 of usbd_conf.h, there are defines for DESVICE_FS and DEVICE_HS.

But DEVICE_HS is not used in the generated project.

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

ambroise
Associate II
Posted on July 03, 2015 at 14:27

HI Mayla,

I contact the local FAE for helping me, it will be easier for debugging

thanks for your help,

Ambroise