cancel
Showing results for 
Search instead for 
Did you mean: 

PROBLEM TO RECEIVE FROM HOST TO USB HID KEYBOARD

shalaka
Associate

I want to receive data from my host PC through USB. I'm using the STM32C0 series nucleo board as USB HID device. I have assigned the value of capslock to the user button. and when the button is pressed i want to turn on the user led on the board. the problem is that when i press the user key on stm32 it glows the led but when i press the capslock key on another hid keyboard attaced to my pc then the output is not reflected on the stm32 board. that means it is not receiveing data from host properly . if it's not receiving data properly then why it is turned on by user button . my endpoint settings are as follows. 

 

/* USER CODE BEGIN USB_Device_Init_PreTreatment_1 */

HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x00, PCD_SNG_BUF, 0x0C);

HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x80, PCD_SNG_BUF, 0x4C);

HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x81, PCD_SNG_BUF, 0x8C); // EP1 IN

HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x02, PCD_SNG_BUF, 0xCC); // EP1 OUT

/* USER CODE END USB_Device_Init_PreTreatment_1 */

 

and the code for the keypress logic transmit and receive is attached below.

0 REPLIES 0