cancel
Showing results for 
Search instead for 
Did you mean: 

About USBD_HID_SendReport

pass3master
Associate III

The value returned from USBD_HID_SendReport always returns USBD_FAIL,

What settings are wrong?

 

We think we am doing the settings in project.ioc correctly.

[IDE]STM32CubeIDE 1.14.0

Connectivity -> USB_OTG_FS -> [Mode]Device_Only

Middleware -> USB_DEVICE -> [Class For FS IP]HID

[board]​ NUCLEO-F446RE

1 ACCEPTED SOLUTION

Accepted Solutions

Hi again @pass3master 

 

You need to dig deeper and diagnose clock duty cycle, also, you need to check the packets using USB Analyzer.

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.

View solution in original post

5 REPLIES 5
FBL
ST Employee

Hello @pass3master 

Have you tried this example STM32CubeF4/Projects/STM32F446ZE-Nucleo/Applications/USB_Device/HID_Standalone at ec8744184587ef76b0e1704d1ee3e391f1aa2b90 · STMicroelectronics/STM32CubeF4 (github.com)

It uses remote-wakeup through key button

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.

No, I have not tried.
We think it is a similar function, but my question was not answered.
When is USBD_FAIL returned from USBD_HID_SendReport?

・Is Pinout & Configuration wrong?
・Clock Configuration is wrong?
・Is NUCLEO-F446RE not allowed to be connected via microUSB?

The USBD_FAIL status can be returned from USBD_HID_SendReport under several conditions.

It can occur if the USB device is not properly initialized, if the class is not correctly registered, or if the device process does not start correctly. More likely, the clock could potentially cause this problem with the USB communication.

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.

We have verified that Error_Handler is not called in the following process.

 

void MX_USB_DEVICE_Init(void)

{

/* Init Device Library, add supported class and start the library. */

if (USBD_Init(&hUsbDeviceFS, &FS_Desc, DEVICE_FS) != USBD_OK)

{

Error_Handler();

}

if (USBD_RegisterClass(&hUsbDeviceFS, &USBD_HID) != USBD_OK)

{

Error_Handler();

}

if (USBD_Start(&hUsbDeviceFS) != USBD_OK)

{

Error_Handler();

}

}

 

If so, does this mean that the clock is the problem?
Where can we find out if there is a clock problem?

Hi again @pass3master 

 

You need to dig deeper and diagnose clock duty cycle, also, you need to check the packets using USB Analyzer.

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.