Skip to main content
h500ca
Visitor II
February 1, 2015
Question

Bug in STM32cube HID code for STM32F103

  • February 1, 2015
  • 1 reply
  • 566 views
Posted on February 01, 2015 at 23:22

I just started playing with the USB code for the stm32f103c8.  I found it quite impressive.  It was the only tool I tried so far that was able to produce working code for a HID device that enumerated properly.  However, I found a bug in the usb wake up interrupt handler.  The code did not clear the EXTI 18 interrupt flag, resulting in a non stop repetition of the interrupt.  This was not apparent until I tried to send a mouse report message.  I fixed it by adding the highlighted line to the user section.

void USBWakeUp_IRQHandler(void)

{

  /* USER CODE BEGIN USBWakeUp_IRQn 0 */

  __HAL_USB_WAKEUP_EXTI_CLEAR_FLAG();    /

  /* USER CODE END USBWakeUp_IRQn 0 */

  HAL_PCD_IRQHandler(&hpcd_USB_FS);

  /* USER CODE BEGIN USBWakeUp_IRQn 1 */

  /* USER CODE END USBWakeUp_IRQn 1 */

}

    This topic has been closed for replies.

    1 reply

    stm32cube-t
    ST Employee
    February 5, 2015
    Posted on February 05, 2015 at 09:44

    Hello,

    Thank you for sharing issue and solution here.

    This issue has already been fixed on our side and will be available with MX release 4.7.

    Best regards