2020-08-07 10:41 AM
Hello there,
I've prototyped a custom PCB, but I'm having issues getting USB to work, Windows is unable to read the Device Descriptor.
The IO, from what I understand, is connected correctly and the generated code is (seemingly) successfully able to initialize the PHY, and the PC will only detect it as plugged in once the `USBD_Start` method within `MX_USB_DEVICE_Init` was executed thats generated by CubeMX.
Apart from having configured the Clocks and USB HS / Device (Com port example) it is a blank project
As the 3300 needs a 24MHz clock I've decided to configure it as shown here by using MCO2. My clock configuration looks like this: https://i.imgur.com/lAhx1jD.png
I've tried to simplify it by setting PLLI2S to x120 / 5 and thus have the MCO2 be /1 with no difference.
I've tried to switch to Full Speed over High Speed with no difference.
Any help would be appreciated, thank you.
2020-08-11 11:33 AM
2020-08-11 01:16 PM
My configuration is equal to the one from the page 173 here where it says 24 or 26 MHz
2020-08-11 01:21 PM
2020-08-11 01:24 PM
Try this: https://www.st.com/resource/en/datasheet/stm32f407vg.pdf
Here it is Page 188. Looking at it again now it makes even more sense since in the diagram the output clock does not go trough the PLL but instead outputs the input clock.
2020-08-11 01:25 PM
Fixed link:
https://datasheet.lcsc.com/szlcsc/STMicroelectronics-STM32F407VGT6_C12345.pdf
I think you're misinterpreting what it's saying. That is only an example configuration.
2020-08-11 01:28 PM
The source clock for MCO2 can be selected. You can use the system clock:
2020-08-11 01:28 PM
Yes it is an example configuration which I decided to use, because on JLCPCB, a 24MHz crystal is an Extended part, thus has a 3$ upmark over a 25MHz one, which is a basic part, so I used a 25MHz one driving the STM and output a 24MHz clock trough the PLL to see if it is a feasible solution. Worst case I'd have to do what I have to do now, which is switching it out for a 24MHz one.
It would be possible to only have a crystal on the USB PHY directly and no HSE on the STM itself, which is what they mean when saying its not necessary to drive the STM with an external crystal since the PHY will output a clock to the STM for communication with it, but at clean 24MHz input into the PHY is required so that the communication does not corrupt on the USB end.
2020-08-11 02:03 PM
How would using the system clock help me? It would still be going trough the PLL, just like the clock configuration in the entry post, and I'd need to run the MCU at a lower speed. I've tried it regardless with the same result.
2020-08-11 04:23 PM
> How would using the system clock help me?
I don't think I've implied that it would. I'm suggesting that the errors in your program are not due to the PLL and are from something else. You're free to have you own opinions. Best of luck.
2020-08-11 06:03 PM
I was just curious, maybe you knew something that I didnt. Thank you regardless. I'll pursue trying to solder on a 24MHz crystal as I honestly dont have any better idea for something that I could try out.