Skip to main content
Associate II
Oct 19, 2023 4:10 PM UTC
Solved

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

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.
ms360Best answer
Associate II
Oct 19, 2023 4:43 PM UTC

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
Oct 19, 2023 4:43 PM UTC

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