STM32U5A5: USB HS without XTAL oscillator - WORKS
Struggling to get my own STM32U5A5 board working... the USB HS PHY was not working, until... (see below).
I was confused also with this thread:
https://community.st.com/t5/stm32-mcus-products/stm32u5-and-usb-hs/td-p/571774
This told me actually as well: you need an external XTAL, not a CMOS OSC (and maybe 16 MHz). - But not true.
I have changed my SystemClock_Config() !
Instead of an external 16 MHz XTAL (as on NUCLEO-U5A5ZJ-Q board) I have an external 8 MHz CMOS OSC (not a XTAL).
The USB CDC (VCP UART) project, running on NUCLEO board - runs now also on my own PCB! Cool.
Some other tweaks needed to reuse my NUCLEO-U5A5JZ-Q project (e.g. no UCPD1, no ADC VBUS sensing), but this SystemClock_Confing() did the job:
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;
#ifdef NUCLEO_BOARD
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
#else
RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
#endif
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMBOOST = RCC_PLLMBOOST_DIV1;
#ifdef NUCLEO_BOARD
//16 MHz XTAL, NUCLEO board
RCC_OscInitStruct.PLL.PLLM = 1;
RCC_OscInitStruct.PLL.PLLN = 20;
RCC_OscInitStruct.PLL.PLLP = 10; //32 MHz needed here!
RCC_OscInitStruct.PLL.PLLQ = 2;
RCC_OscInitStruct.PLL.PLLR = 2;
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLLVCIRANGE_1;
#else
//8 MHz OSC, my board
RCC_OscInitStruct.PLL.PLLM = 1; //2; ==> THIS FAILS on USB
RCC_OscInitStruct.PLL.PLLN = 40; //20; ==> THIS FAILS on USB
RCC_OscInitStruct.PLL.PLLP = 10;
RCC_OscInitStruct.PLL.PLLQ = 2;
RCC_OscInitStruct.PLL.PLLR = 2;
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLLVCIRANGE_1;
#endif
So, I can confirm: U5A5 works also with an 8 MHz CMOS OSC, instead of a XTAL (as mentioned in datasheet).
Just: not all possible combinations for PLL settings work, just one particular one.
