cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-U575 vs. NUCLEO-U5A5: demo project for the differences on USB - for you

tjaekel
Lead

I have a project ported from STMU575-EV board to NUCLEO-U575 as well as now also NUCLEO-U5A5 (providing an USB device).

It is an USB ECM application (demo) - but it shows you the differences between all the different boards used, in terms of USB initialization and use.
It should help also to get an USB VCP (CDC, ACM) project working with both boards.

If you want to see how the USB differs on a U5A5 (which has an USB OTH HS PHY integrated) vs. an U575 (with has just an USB OTH FS), and how to use U5A5 HS PHY also for FS speed...:
you can have a look at my project:

https://github.com/tjaekel/STM32U5xx_USB_ECM 

The main differences to be found are in:

  • void SystemClock_Config(void):
    the U5A5 works only with an external HSE, and it seems to need some dedicated PLL setting
  • void MX_USB_OTG_HS_PCD_Init(void):
    the initialization is different, but watch that still the USB_OTG_HS is set on instance, even I use later the HS PHY in PCD_SPEED_FULL mode
  • void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd):
    this is also different
  • stm32u5xx_it.c:
    see the USB INT vector implementations

Now, the USB works fine with USB on both - U575 and U5A5 - boards (even they differ a lot on USB, e.g. FS PHY vs. HS PHY integrated).
The main difference to realize:

  • an U575 board, with OTG USB FS (only), will configure PA11 and PA12 with ALT as GPIO_AF10_USB
  • but on a U5A5 board, with OTG USB HS PHY (only): there is not any need to do so as well: the PA11 and PA12 pins are used "automatically" as USB pins (there is not an ALT for USB at these pins)

Also important:

  • use the right Startup file: startup_stm32u575ritxq.s vs. startup_stm32u5a5zjtxq.s:
    the INT vector table is different! The U575 has an OTG_FS_IRQHandler, where the U5A5 has an OTG_HS_IRQHandler (but both vector numbers seem to be the same. So, you could "reuse" the same vector.)
  • the linker script, e.g. STM32U575RITXQ_FLASH.ld is also slightly different: the U5A5 has larger memories:
    but in my case: I use the same linker script settings, even resulting in smaller memories for U5A5 - it works on both MCUs

So, this (demo) project shows you the differences how to use USB on U575 vs. U5A5.

Remark:
The project it based on the new AZURE RTOS (and its USB stack), not the "old" STM USB stack (with FreeRTOS and STM Middleware USB stack). The AZURE environment is pretty cool and feature reach.
There are not any other dependencies in the AZURE USB stack for FS vs. HS - great! It works for me on both boards.

1 ACCEPTED SOLUTION

Accepted Solutions
tjaekel
Lead

If you want to see my other projects for U575 and U5A5, as USB VCP (virtual) UART:

https://github.com/tjaekel/STM32U5A5-VCP_UART 

https://github.com/tjaekel/STM32U575-VCP-UART 

View solution in original post

1 REPLY 1
tjaekel
Lead

If you want to see my other projects for U575 and U5A5, as USB VCP (virtual) UART:

https://github.com/tjaekel/STM32U5A5-VCP_UART 

https://github.com/tjaekel/STM32U575-VCP-UART