cancel
Showing results for 
Search instead for 
Did you mean: 

why USB is not recognized when I reduce the clock speed? and How to keep it working at low clock speeds

HAlzo
Senior

I am using STM32h743 , code is generated using STM32CubeMx.

I am using USB_OTG_FS in device only mode, with USB_DEVICE middleware configered as CDC class .

Here's my clock configuration

0693W000000XLrWQAW.pngThe usb is clocked from RC480693W000000XLrlQAG.png

I could reduce the clock from 480MHz to 120 MHz by changing RCC_OscInitStruct.PLL.PLLP from 2 to 8 .

But when I try to change clock to 96MHz or 80 MHz by changig RCC_OscInitStruct.PLL.PLLP to 10 or 12, the USB is not recognized by windows!!!

I am using windows 10 .

How to overcome this problem?

1 ACCEPTED SOLUTION

Accepted Solutions

OK so try with decreasing the clock change the AHB prescaler so that AHB frequency stays at or above 60MHz.

Did that change anything?

JW

View solution in original post

6 REPLIES 6

0693W000000XOMlQAO.png

JW

When I change RCC_OscInitStruct.PLL.PLLP fro 2 to 8 the AHB Clock is reduced from 240MHz to 60MHz,

when I set RCC_OscInitStruct.PLL.PLLP to 10 the AHB clock is 48MHz

when I set RCC_OscInitStruct.PLL.PLLP to 12 the AHB clock is 40MHz

So the AHB Freuquanc is still greater than 30MHz

OK so try with decreasing the clock change the AHB prescaler so that AHB frequency stays at or above 60MHz.

Did that change anything?

JW

0693W000001cFUuQAM.pngyes, it's working

reducing main CPU clock while keeping AHB clock high solves the problem

Sometimes the USB device is mapped to different VCOMPort even that I am using the same serial number string descriptor

and sometimes The device is not recognized by Windows as shown in the attached pics0693W000001cIISQA2.png0693W000001cIINQA2.png

Sorry, I don't have a magical answer to all the bugs which come with Cube, or may be introduced by yourself, or Windows, or the used hardware...

JW