Skip to main content
Lead II
Jan 4, 2024 5:54 AM UTC
Solved

STM32U5A5 vs. STM32U575 - as USB PA11, PA12

I am confused:
I have a PCB designed for STMU575 and I am using USB FS - works.
USB DM and DP are pins PA11 and PA12.

On U575:
- all fine as USB FS, available via AF10 (PA11 = OTG_FS_DM, OTG_FS_DM) - works

I have checked the packages and pin assignments and saw: U5A5 is identical with U5A5 (and I want to solder U5A5 due to larger memories instead of U575).

But UA5A datasheet is a bit different on PA11, PA12:

1. it mentions "OTG_HS_DM(boot)" as "additional functions"
2. in pin mux ALT table: there is nothing under ALT10 - there is NOT an ALT option to configure PA11, PA12 as USB pin

tjaekel_0-1704347098608.png

My questions:

a) changing from U575 to a U5A5 on same PCB and package (LQPF64) - are PA11 and PA12 usable in the same way as USB (FS)?

b) if changing to U5A5 and PA11, PA12 become OTG_HS_DM, OTH_HS_DP now: does it mean I have to configure now USB HS instead of USB FS (as on U575)?

c) how to configure ALT function of USB_HS (if not listed in table) for U5A5?

 

This topic has been closed for replies.
tjaekelBest answer
Lead II
Jan 14, 2024 3:27 AM UTC

"hmmm" - no clear answer for me. Anyway, I close the ticket if you want me to do.

 

10 replies

tjaekelAuthor
Lead II
Jan 4, 2024 6:48 AM UTC

When I see my NUCLEO-U5A5 project (using OTG USB HS:(
- it does NOT configure any PA11, PA12 (nothing for PA11, PA12, no ALT needed neither used)
- instead, it enables in function "void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd)" only the USB HS

So, it looks to me as:

PA11, PA12 are implicitly used as USB_DP, USB_DM when USB HS is enabled (therefore "other functions"):
no need to configure PA11, PA12 via an ALT (not available): it is done (used) automatically via USB HS enabled

But it means also:
on U5A5 PA11, PA12 become USB HS signals now: all my code for FS on 575 has to be changed to use USB HS (and internal PHY)

BTW: very cool that STM MCU has now an internal USB HS PHY! (but obviously just on U5A5). Anyway - very great and I appreciate it. Long time awaited feature, well done.

STTwo-32
ST Technical Moderator
Jan 4, 2024 7:07 AM UTC

Hello @tjaekel 


a) changing from U575 to a U5A5 on same PCB and package (LQPF64) - are PA11 and PA12 usable in the same way as USB (FS)?

 


Yes, when using USB_OTG_HS, PA11 will be USB_OTG_HS_DM and PA11 will be USB_OTG_HS_DP 

STTwo32_1-1704351940841.png

 


b) if changing to U5A5 and PA11, PA12 become OTG_HS_DM, OTH_HS_DP now: does it mean I have to configure now USB HS instead of USB FS (as on U575)?


You can configure the USB HS to work as a USB FS using the internal HS physical interface. 

STTwo32_0-1704351920957.png

 

c) how to configure ALT function of USB_HS (if not listed in table) for U5A5?

 


You can refer to one of the examples in the STM32Cubeu5.

Best Regards.

STTwo-32

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.
tjaekelAuthor
Lead II
Jan 12, 2024 4:16 AM UTC

Great, thank you.

I will give it a try: I have checked CubeMX, some of (my) demo projects (e.g. for NUCLEO-U5A5) and I have a clue now.

I will solder my board for U5A5 asap and try to create a FW for it.

Best regards
Torsten

tjaekelAuthor
Lead II
Jan 13, 2024 7:44 PM UTC

I tried now STM32U5A5 in LQPF64 package - it does NOT work.
When the FW should do:

     /* Reset after a PHY select */

    ret = USB_CoreReset(USBx);

the ret is always HAL_TIMEOUT. And the debugger (external ST-LINK) complains with "Target is not responding, retrying..."
when the bit 0 CSRST in register OTG_HS->GRSTCTL is set. It is never "auto-cleared".

 

So, I assume, the USB_PLL is not locked (not running).

I tried on NUCLEO-U5A5 a similar clock config, e.g. using for USB:

/** Initializes the peripherals clock

*/

PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USBPHY;

PeriphClkInit.UsbPhyClockSelection = RCC_USBPHYCLKSOURCE_PLL1_DIV2; //RCC_USBPHYCLKSOURCE_PLL1_DIV2;

////PeriphClkInit.UsbPhyClockSelection = RCC_USBPHYCLKSOURCE_HSE; //XXXX: in NUCLEO project

 

/** Set the OTG PHY reference clock selection

*/

//XXXX: PLL1_P should be 32 MHz - 16 MHz selected here

HAL_SYSCFG_SetOTGPHYReferenceClockSelection(SYSCFG_OTG_HS_PHY_CLK_SELECT_1);

it works on NUCLEO board.

The only differences which remain:

  • NUCLEO uses a 16 MHz real XTAL oscillator
  • I use a 8 MHz CMOS OSC chip

I made sure to configure the SystremClock properly, e.g. the PLL1_P for 32 MHz (and using it via PLL1_DIV2)

So, it remains: NUCLEO board has real XTAL, I have CMOS OSC.

 

What scares me is this statement in U5A5 datasheet (page 97):

"This interface requires a precise 60 MHz clock that is generated from the internal
USB PHY PLL (the clock source must use a HSE crystal oscillator)."

OK, internal PLL - I use and works also on NUCLEO. But not a HSE crystal oscillator! (CMOS OSC instead).

Is this the reason why it does not work?
Really a need to use HSE with XTAL (and not HSE_OSC_IN without _OUT) - for STM32U5A5 internal OTH_HS_PHY to use?