cancel
Showing results for 
Search instead for 
Did you mean: 

USB FS unstable on STM32 when using HSI16 + HSI48 (USB3.0 host crash)

amorftor
Associate II

Hello,

I am working on a low-power STM32 system. In my original configuration I was running the core at 32 MHz (PLL from HSI16) with Voltage Scaling 1, and in this setup USB CDC worked without any issues.

To reduce power consumption, I reconfigured the system to run the core at 16 MHz HSI (no PLL) while keeping Voltage Scaling 1. The USB clock source is HSI48.

With this configuration, when connecting to a USB 3.0 host port, the device often crashes during enumeration. Sometimes it enumerates fine, but most of the time it fails. Interestingly, if I connect the device through a USB 2.0 hub, the problem does not appear.

From my research, I found that:

  - USB 2.0 controllers are more tolerant and usually accept HSI48’s +/-1–2% drift.

  - USB 3.0 controllers are stricter, and if HSI48 drift exceeds +/-0.25%, CRC errors occur. This causes descriptors to get corrupted and Windows shows a crash or device not recognized.

My question:
What are the recommended ways to avoid this issue while still keeping the system in low-power mode (16 MHz core)? Should I:
  - Always use HSE + PLL for USB to guarantee clock accuracy?

  - Use CRS synchronization with LSE or USB SOF to stabilize HSI48?

  - Keep the system in Voltage Scale 1 only while USB is active?

Any advice from experience with STM32 USB on USB3.0 hosts would be appreciated.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @amorftor 

For your USB Full-Speed low-power application, I recommend using CRS to synchronize HSI48 with LSE or USB SOF to improve clock stability although this requires more complex software handling.. For the highest accuracy, especially in high-speed USB, using HSE with PLL for the USB clock is preferred.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


View solution in original post

2 REPLIES 2
TDK
Super User

Two options:

  • Using HSE + PLL will work.
  • Using HSI48 + CRS will also work. This is easier.

Introduction to USB hardware and PCB guidelines using STM32 MCUs - Application note

 

HSI48 alone will not satisfy the clock requirements for USB (2.0 or 3.0).

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hi @amorftor 

For your USB Full-Speed low-power application, I recommend using CRS to synchronize HSI48 with LSE or USB SOF to improve clock stability although this requires more complex software handling.. For the highest accuracy, especially in high-speed USB, using HSE with PLL for the USB clock is preferred.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.