STMicroelectronics / STM32CubeL4

STM32Cube MCU Full Package for the STM32L4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
262 stars 153 forks source link

STM32L433 HID USB problem #14

Closed christophemonmon closed 3 years ago

christophemonmon commented 3 years ago

I use an STM32L433 and I upgraded from version 1.14.0 to the 1.16.0 package.

There is no quartz and I have a USB and CAN connection. So I use the HSI RC 16MHz to generate SYSCLK. For USB, I use the 48MHz RC.

I encountered a problem with HID on the USB.

In the end, I found that a line is missing in the USBD_CUSTOM_HID_DataOut function of the usbd_customhid.c file.

To correct the problem I put the following line before the return :

  USBD_LL_PrepareReceive(pdev, CUSTOM_HID_EPOUT_ADDR , hhid->Report_buf,
                         USBD_CUSTOMHID_OUTREPORT_BUF_SIZE);

  return (uint8_t)USBD_OK;
}
ALABSTM commented 3 years ago

ST Internal Reference: 45118

ALABSTM commented 3 years ago

Hi @christophemonmon,

Thank you for this report and for the solution suggested. Actually, the call to USBD_LL_PrepareReceive() is now made separately in the new function USBD_CUSTOM_HID_ReceivePacket(). https://github.com/STMicroelectronics/STM32CubeL4/blob/d023c0d560ace11509f9b761c8913a9e48fcf194/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Src/usbd_customhid.c#L678-L694 In your application, simply call USBD_CUSTOM_HID_ReceivePacket() just after USBD_CUSTOM_HID_DataOut().

With regards,

ALABSTM commented 3 years ago

Hi @christophemonmon,

Does the solution above addresses your need? Thank you for you feedback.

With regards,

ALABSTM commented 3 years ago

Hi @christophemonmon,

Any feedback? Is your issue solved with the suggested solution?

With regards,

ALABSTM commented 3 years ago

Hi @christophemonmon,

I think this issue can be closed now. Indeed, this new update of the usbd_customhid.c source file requires you to update your application. You can reopen it if you have anything else to add regarding this point.

With regards,