Skip to main content
Associate II
October 19, 2023
Solved

USB HID Device callbacks stop functioning when I add RTC via cube/IOC

  • October 19, 2023
  • 1 reply
  • 1168 views

Hi. I have a project using the USB_HID class, and the device sends HID reports just fine, until I enable RTC and recompile.

 
When I enable RTC, without any other changes, I lose my USB event callbacks: HAL_PCD_SuspendCallback and HAL_PCD_ResumeCallback.

 

I thought it may be related to something like this: https://community.st.com/t5/stm32-mcus-products/problem-with-example-usb-code-and-rtc/m-p/491974

Has anybody succeeded in keeping both USB and RTC functioning?

 

 

This topic has been closed for replies.
Best answer by ms360

The solution was declaring my semaphores before initializing the peripherals, because the callbacks were firing at boot before semaphores were ready. 

1 reply

ms360AuthorBest answer
Associate II
October 19, 2023

The solution was declaring my semaphores before initializing the peripherals, because the callbacks were firing at boot before semaphores were ready.