cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in STM32cube HID code for STM32F103

h500ca
Associate
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 */

}

1 REPLY 1
stm32cube-t
Senior III
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