cancel
Showing results for 
Search instead for 
Did you mean: 

HID setup

dceccon87
Associate

I'm tring to set up an HID on a NUCLEO-STM32H743ZI. My demo code is very simple:

uint8_t buffer[8] = { 1, 0, 0, 0x04, 0, 0, 0, 0 };
 
while (1) {
	/* USER CODE END WHILE */
	/* USER CODE BEGIN 3 */
	if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13) == GPIO_PIN_SET) {
		buffer[3] = 0x4E;
		USBD_HID_SendReport(&hUsbDeviceFS, buffer, 8);
		HAL_Delay(100);
		buffer[3] = 0x0;
		USBD_HID_SendReport(&hUsbDeviceFS, buffer, 8);
		HAL_Delay(100);
	}
}

I have changed also in the USBD_HID_CfgDesc the nInterfaceProtocol to 1 (keyboard).

I have some other trouble:

  1. When i start the device, my Windows 7 recognise the new device but can't install driver. It's normal? how i can resolve this? (Update: with an XUbuntu 18.04 i see device without any problem ;) )
  2. If i try to send a signal, hhid->state is always on state HID_BUSY. Why??

0 REPLIES 0