Hi @lugama
>The code was ported from the USB package of STM3210E.
Could you reproduce with USB classic stack STMicroelectronics/stm32h5-classic-coremw-apps: Provide a set of applications for STM32H5xx series based on the STM32 Classic Core Middleware libraries. (github.com)
I am suspecting the porting since it's a different product, we should stick to library dedicated for this controller.
I found a similar erratum for an old revision which is not exactly the same issue: ESOF interrupt timing desynchronized after resume signaling.
Upon signaling resume, the device is expected to allow full 3ms of time to the host or hub for sending the initial SOF (start of frame) packet, without triggering SUSP interrupt. However, the device only allows two full
milliseconds and unduly triggers SUSP interrupt if it receives the initial packet within the third millisecond.
Workaround: When the device initiates resume (remote wakeup), mask the SUSP interrupt by setting the SUSPM bit for 3 ms, then unmask it by clearing SUSPM.