cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix the problem about USB HID "Unknown Device(error code 43)"

MKIM.3
Associate

Hello,

I'm trying a USB HID on the STM32F103C8 Evb board which circuit's attached.

The steps for a USB HID programming are

(1) Generating HAL codes using STM32CubeMX.

(2) Compiling the source codes using turestduio.

(3) downloading the .hex on the evb board.

As a result. PC tells "Unknown USB Device(error code 43)" when plugged a USB Cable.

so. I checked the source codes with a printf.

Below are the functions called in sequences.

(1) void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd) : ISR

(2) PCD_EP_ISR_Handler();

(3) HAL_PCD_SetupStageCallback(hpcd);

(4) USBD_LL_SetupStage();

(5)  USBD_StdDevReq(pdev, &pdev->request);

(6) USBD_GetStatus(pdev, req);

(7) USBD_CtlError(); -> because of  if (req->wLength != 0x2U)   { USBD_CtrlError(); }

(8) USBD_LL_StallEP()

(9) HAL_PCD_EP_SetStall()

(10) USB_EP0_OutStart(); there is the empty code in this function.

I attached my source codes.

please kindly review these and send me any ideas to fix the problem.

Thanks in advances

0 REPLIES 0