cancel
Showing results for 
Search instead for 
Did you mean: 

Custom hid device only send report after 200ms

Quoc Khai Trang
Associate
Posted on June 06, 2018 at 06:44

Hi all,

I'm trying to create a custom keyboard with STM32F103C8, for the first version, i use HID class. Then i figured out that i can not update leds status. So, i changed to Custom HID class. And i hit this issue. Seem like i only can send one report after 200ms.

This is my code:

Clear_HID_Report();
 keyboardHID.keys[0] = 0x15;
 USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof(keyboardHID_t));
 HAL_Delay(100);
 Clear_HID_Report();
 keyboardHID.keys[0] = 0x17;
 tmp = USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof(keyboardHID_t));
 HAL_Delay(100);
 Clear_HID_Report();
 keyboardHID.keys[0] = 0x10;
 USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof(keyboardHID_t));
 HAL_Delay(200);
 Clear_HID_Report();
 USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof(keyboardHID_t));
�?�?�?�?�?�?�?�?�?�?�?�?�?�?

This code return: 'rm', 't' are missing.

Then i increase the delay time to 200ms for all HAL_Delay, and i receive 'rtm'. Is there anyone can help me?

I event try this

do {
 tmp = USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS, &keyboardHID, sizeof(keyboardHID_t));
 } while (tmp != USBD_OK);�?�?�?

It's not help, too.

#usb-device #custom-hid-class #timing #keyboard #hid-device
0 REPLIES 0